public void Add(TEntity entity) { entity.IsDeleted = false; entity.AddDate = DateTime.Now; entity.UpdateDate = DateTime.Now; dbSet.Add(entity); db.SaveChanges(); }
public static void Update(WebUser webUser) { using (MVCFormContext db = new MVCFormContext()) { db.Entry(webUser).State = EntityState.Modified; db.SaveChanges(); } }
public static void Update(RootObject rootObject) { using (MVCFormContext db = new MVCFormContext()) { db.Entry(rootObject).State = EntityState.Modified; db.SaveChanges(); } }
public void Update(TEntity entity) { using (MVCFormContext db = new MVCFormContext()) { db.Entry(entity).State = EntityState.Modified; db.SaveChanges(); } }
public static void Update(Field field) { using (MVCFormContext db = new MVCFormContext()) { db.Entry(field).State = EntityState.Modified; db.SaveChanges(); } }
public static void Delete(int id) { using (MVCFormContext db = new MVCFormContext()) { WebUser webuser = db.WebUsers.FirstOrDefault(q => q.id == id); webuser.IsDeleted = true; webuser.DeleteDate = DateTime.Now; db.SaveChanges(); } }
public static void Delete(int id) { using (MVCFormContext db = new MVCFormContext()) { RootObject rootObject = db.RootObjects.FirstOrDefault(q => q.id == id); rootObject.IsDeleted = true; rootObject.DeleteDate = DateTime.Now; db.SaveChanges(); } }
public static void Delete(int id) { using (MVCFormContext db = new MVCFormContext()) { Field field = db.Fields.FirstOrDefault(q => q.id == id); field.IsDeleted = true; field.DeleteDate = DateTime.Now; db.SaveChanges(); } }
public static void Add(WebUser webuser) { using (MVCFormContext db = new MVCFormContext()) { webuser.AddDate = DateTime.Now; webuser.IsDeleted = false; webuser.UpdateDate = DateTime.Now; db.WebUsers.Add(webuser); db.SaveChanges(); } }
public static void Add(RootObject rootObject) { using (MVCFormContext db = new MVCFormContext()) { rootObject.AddDate = DateTime.Now; rootObject.IsDeleted = false; rootObject.UpdateDate = DateTime.Now; db.RootObjects.Add(rootObject); db.SaveChanges(); } }
public static void Add(Field field) { using (MVCFormContext db = new MVCFormContext()) { field.AddDate = DateTime.Now; field.IsDeleted = false; field.UpdateDate = DateTime.Now; db.Fields.Add(field); db.SaveChanges(); } }
public static void AddAdminUser(AdminUser adminuser) { using (MVCFormContext db = new MVCFormContext()) { adminuser.InsertedUserID = 1; adminuser.UpdatedUserID = 1; adminuser.AddDate = DateTime.Now; adminuser.IsDeleted = false; adminuser.UpdateDate = DateTime.Now; db.AdminUsers.Add(adminuser); db.SaveChanges(); } }