/// <summary> /// 删除模块权限 /// </summary> /// <param name="ml"></param> /// <returns></returns> public static int DeleteModelLicense(ModelLicenses ml) { API api = new API(); using (SysDbContext context = api.CreateDbContext()) { context.Entry(ml).State = System.Data.EntityState.Deleted; return(context.SaveChanges()); } }
/// <summary> /// 删除模块 /// </summary> /// <param name="model"></param> /// <returns></returns> public static int UpdateModel(Model model) { API api = new API(); using (SysDbContext context = api.CreateDbContext()) { context.Entry(model).State = System.Data.EntityState.Modified; return(context.SaveChanges()); } }
/// <summary> /// 删除一个用户 /// </summary> /// <param name="user"></param> /// <returns></returns> public static int DeleteUser(User user) { API api = new API(); using (SysDbContext context = api.CreateDbContext()) { context.Entry(user).State = System.Data.EntityState.Deleted; return(context.SaveChanges()); } }
public ActionResult Edit(Category pCategory) { db.Entry(pCategory).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", "Category")); }
public ActionResult Edit(Bill pBill) { db.Entry(pBill).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", "Bill")); }
public ActionResult Edit(Product pProduct) { db.Entry(pProduct).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", "Product")); }
public ActionResult Edit(Costumer pCliente) { db.Entry(pCliente).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", "Costumer")); }
/// <summary> /// 修改 /// </summary> /// <param name="entity"></param> /// <returns></returns> public virtual void Update(T entity) { _dbContext.Entry <T>(entity).State = EntityState.Modified; }