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); } }
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); } }