CinderellaMGS.SQL_Queries.getCinderellaStatus C# (CSharp) 메소드

getCinderellaStatus() 공개 메소드

Retrieves all cinderellas with the current specified status.
public getCinderellaStatus ( string statustocheck, string orderby ) : DataSet
statustocheck string Status that you are checking for (ie. shopping, pending, etc)
orderby string How the data should be ordered (ie. lname)
리턴 System.Data.DataSet
        public DataSet getCinderellaStatus(string statustocheck, string orderby)
        {
            string time = DateTime.Now.ToShortDateString();
            string query = "SELECT transID, CinderellaTimestamp.cinderellaID, n.Name, CinderellaTimestamp.timestamp, CinderellaTimestamp.status, n.apptDate, n.apptTime FROM CinderellaTimestamp, (SELECT ID, lastname + ', ' + firstname AS NAME, apptDate, apptTime FROM Cinderella) n, (SELECT cinderellaID, MAX(TIMESTAMP) AS TIMESTAMP FROM CinderellaTimestamp GROUP BY cinderellaID) a WHERE a.cinderellaID= cinderellaTimestamp.cinderellaID AND a.timestamp= cinderellaTimestamp.timestamp AND n.ID= cinderellaTimestamp.cinderellaID AND cinderellaTimestamp.status='";
            query += statustocheck + "' Order By " + orderby;

            return database.getDataSet(query, "tableName");
        }