예제 #1
0
        public Drug GetDrugDetails(int?id)
        {
            Drug drug = db.Drugs.Find(id);

            return(drug);
        }
예제 #2
0
 public void DeleteDrug(Drug oldDrug)
 {
     db.Drugs.Remove(oldDrug);
     db.SaveChanges();
 }
예제 #3
0
 public void EditDrug(Drug oldDrug)
 {
     db.Entry(oldDrug).State = EntityState.Modified;
     db.SaveChanges();
 }
예제 #4
0
 public void CreateDrug(Drug newDrug)
 {
     db.Drugs.Add(newDrug);
     db.SaveChanges();
 }