public static List <string> GetServNameFromPackage(ushort id) { var list = new List <string>(); db.ReaderRows(db.ReturnCommand($"select * from tbPackItem where PackId='{id}'"), row => { list.Add(((ushort)row[0]) + ""); }); return(list.Select(s => ServiceDAO.GetById(Convert.ToUInt16(s)).Name).ToList()); }
public static List <Service> GetServicesFromPackage(ushort id) { var list = new List <string>(); Database.ReaderRows(Database.ReturnCommand($"select * from vw_PackageItems where IdPacote='{id}'"), row => { list.Add(((ushort)row[1]) + ""); }); return(list.Select(s => ServiceDAO.GetById(Convert.ToUInt16(s))).ToList()); }
public static List <Schedule> GetList() { var list = new List <Schedule>(); db.ReaderRows(db.ReturnCommand("select * from vw_SchedulesCustomer"), row => { list.Add(new Schedule(Convert.ToUInt32(row[0]), EmployeeDAO.GetById(Convert.ToUInt32(row[1])), CustomerDAO.GetById(Convert.ToUInt32(row[2])), ServiceDAO.GetById(Convert.ToUInt16(row[3])), row[4] + "")); }); return(list); }
public static Schedule GetById(uint id) { object[] row = db.ReaderRow(db.ReturnCommand($"select * from vw_SchedulesCustomer where SchedId = '{id}'")); Schedule schedule = new Schedule(Convert.ToUInt32(row[0]), EmployeeDAO.GetById(Convert.ToUInt32(row[1])), CustomerDAO.GetById(Convert.ToUInt32(row[2])), ServiceDAO.GetById(Convert.ToUInt16(row[3])), row[4] + ""); return(schedule); }