public async Task <ActionResult> Edit([Bind(Include = "ID,Code,Name,State,CreatedTime")] Setting setting)
        {
            if (ModelState.IsValid)
            {
                db.Entry(setting).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(setting));
        }
        public async Task <ActionResult> Edit(Menu menu)
        {
            if (ModelState.IsValid)
            {
                db.Entry(menu).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.Permission = db.Permissions;

            return(View(menu));
        }
Beispiel #3
0
 public int Insert(TEntity entity)
 {
     dbcontext.Entry <TEntity>(entity).State = EntityState.Added;
     return(dbcontext.SaveChanges());
 }
Beispiel #4
0
 public int Insert <TEntity>(TEntity entity) where TEntity : class
 {
     dbcontext.Entry <TEntity>(entity).State = EntityState.Added;
     return(dbTransaction == null?this.Commit() : 0);
 }