Пример #1
0
 public ActionResult Edit(string MenuID, Models.SysMenu collection)
 {
     try
     {
         string outputId = _dataobject.Update(collection);
         return(RedirectToAction(this.ActionReturn()));
     }
     catch (Exception ex)
     {
         Services.GlobalErrors.Parse(ModelState, _dataobject.Errors, ex);
         return(PartialView(this._updateview, collection));
     }
 }
Пример #2
0
 public string Update(Models.SysMenu data)
 {
     try
     {
         this.Validate(data);
         this._db.Entry(data).State = System.Data.Entity.EntityState.Modified;
         this._db.SaveChanges();
         return(data.MenuID);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #3
0
 public string Insert(Models.SysMenu data)
 {
     try
     {
         this.Validate(data);
         this._db.SysMenus.Add(data);
         this._db.SaveChanges();
         return(data.MenuID);
     }
     catch (Exception)
     {
         throw;
     }
 }