예제 #1
0
 public bool Create_Dosage(Dosage d)
 {
     try
     {
         d.Dosage_Code = fetch_PK("Dosage");
         dbContext.Dosages.Add(d);
         dbContext.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
예제 #2
0
        public bool update_dosage_details(Dosage dosage, String dosageid)
        {
            var original = dbContext.Dosages.Find(dosageid);

            try
            {
                dbContext.Entry(original).CurrentValues.SetValues(dosage);
                dbContext.SaveChanges();
                return(true);
            }
            catch (Exception e)
            {
                return(false);
            }
        }