示例#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());
            }
        }
 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"));
 }
 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"));
 }
示例#8
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public virtual void Update(T entity)
 {
     _dbContext.Entry <T>(entity).State = EntityState.Modified;
 }