コード例 #1
0
        /// <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());
            }
        }
コード例 #2
0
        /// <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());
            }
        }
コード例 #3
0
        /// <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());
            }
        }
コード例 #4
0
 public ActionResult Edit(Category pCategory)
 {
     db.Entry(pCategory).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index", "Category"));
 }
コード例 #5
0
 public ActionResult Edit(Bill pBill)
 {
     db.Entry(pBill).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index", "Bill"));
 }
コード例 #6
0
 public ActionResult Edit(Product pProduct)
 {
     db.Entry(pProduct).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index", "Product"));
 }
コード例 #7
0
 public ActionResult Edit(Costumer pCliente)
 {
     db.Entry(pCliente).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index", "Costumer"));
 }
コード例 #8
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public virtual void Update(T entity)
 {
     _dbContext.Entry <T>(entity).State = EntityState.Modified;
 }