public eTypeOfDrug getOneTypeDrug(int id) { var result = typedal.getOneTypeOfDrug(id); eTypeOfDrug temp = new eTypeOfDrug(); temp.Description = result.Description; temp.Type = result.Type; temp.TypeOfDrugID = result.TypeOfDrugID; return(temp); }
public List <eTypeOfDrug> getAllTypeDrugs() { List <eTypeOfDrug> ls = new List <eTypeOfDrug>(); foreach (TypeOfDrug record in typedal.getAllTypeOfDrug()) { eTypeOfDrug temp = new eTypeOfDrug(); temp.Description = record.Description; temp.Type = record.Type; temp.TypeOfDrugID = record.TypeOfDrugID; ls.Add(temp); } return(ls); }
public bool updateTypeDrug(eTypeOfDrug e) { try { TypeOfDrug temp = new TypeOfDrug(); temp.Description = e.Description; temp.Type = e.Type; temp.TypeOfDrugID = e.TypeOfDrugID; typedal.updateTypeOfDrug(temp); return(true); } catch { return(false); } }
List <eDrug> IService1.getAllDrugs() { List <eDrug> ls = new List <eDrug>(); foreach (Drug dr in drugdal.getAllDrug()) { eDrug edr = new eDrug(); edr.DrugID = dr.DrugID; edr.Description = dr.Description; edr.Name = dr.Name; edr.Price = Convert.ToDouble(dr.Price); TypeOfDrug t = new TypeOfDrug(); t = typedal.getOneTypeOfDrug(dr.TypeID); eTypeOfDrug et = new eTypeOfDrug(); et.Type = t.Type; et.Description = t.Description; edr.Type = et; ls.Add(edr); } return(ls); }