public eDrug getOneDrug(int id) { var result = drugdal.getOneDrug(id); eDrug e = new eDrug(); e.TypeID = result.TypeID; e.Description = result.Description; e.DrugID = result.DrugID; e.Name = result.Name; e.Price = Convert.ToDouble(result.Price); return(e); }
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); edr.TypeID = dr.TypeID; ls.Add(edr); } return(ls); }
public bool updateDrug(eDrug e) { try { Drug d = new Drug(); d.Description = e.Description; d.DrugID = e.DrugID; d.Name = e.Name; d.Price = Convert.ToDecimal(e.Price); d.TypeID = e.TypeID; drugdal.updateDrug(d); 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); }
public bool updateDrug(eDrug e) { throw new NotImplementedException(); }