Esempio n. 1
0
        public int AddMedicine(tblMedicine obj)
        {
            //obj.ID = 18;

            db.tblMedicines.Add(obj);
            db.SaveChanges();
            return(obj.ID);
        }
Esempio n. 2
0
        public void UpdateMedicine(tblMedicine obj)
        {
            db.tblMedicines.Attach(obj);
            var update = db.Entry(obj);

            update.Property(x => x.Description).IsModified = true;

            update.Property(x => x.isActive).IsModified           = true;
            update.Property(x => x.MedicineCategoryID).IsModified = true;
            update.Property(x => x.MedicineName).IsModified       = true;
            db.SaveChanges();
        }