public JsonResult InsertMainMenu(tblMainMenu tblMainMenu) { var result = new Result(); result = _adminService.InsertMainMenu(tblMainMenu); return(Json(result)); }
public bool AddMainMenu(MainMenuVM _mainMenu) { try { if (HttpContext.Current.Session["User"] != null) { var user = (LoginVM)HttpContext.Current.Session["User"]; var mm = new tblMainMenu(); mm.MenuName = _mainMenu.MenuName; mm.isActive = _mainMenu.isActive; mm.IconClass = _mainMenu.IconClass; mm.CreatedDate = System.DateTime.Now; mm.ModifiedDate = System.DateTime.Now; mm.CreatedBy = user.RoleId; mm.ModifiedBy = user.RoleId; _mainMenuResp.Add(mm); _unitOfWork.Complete(); return(true); } else { return(false); } } catch (Exception e) { return(false); } }
public ActionResult DeleteConfirmed(int id) { tblMainMenu tblMainMenu = db.tblMainMenu.Find(id); db.tblMainMenu.Remove(tblMainMenu); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,MainMenu")] tblMainMenu tblMainMenu) { if (ModelState.IsValid) { db.Entry(tblMainMenu).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tblMainMenu)); }
public ActionResult Create([Bind(Include = "Id,MainMenu")] tblMainMenu tblMainMenu) { if (ModelState.IsValid) { db.tblMainMenu.Add(tblMainMenu); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tblMainMenu)); }
public bool InsertMainMenu(tblMainMenu tblMainMenu) { try { _entity.tblMainMenu.Add(tblMainMenu); _entity.SaveChanges(); } catch (Exception ex) { throw ex; } return(true); }
public Result InsertMainMenu(tblMainMenu tblMainMenu) { try { return(adminManager.InsertMainMenu(tblMainMenu)); } catch (Exception ex) { return(new Result { IsSuccess = false, Message = ex.Message }); } }
// GET: MainMenus/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblMainMenu tblMainMenu = db.tblMainMenu.Find(id); if (tblMainMenu == null) { return(HttpNotFound()); } return(View(tblMainMenu)); }
public Result InsertMainMenu(tblMainMenu tblMainMenu) { try { IAdmin iAdmin = new WCMS_DAL_Admin(); using (TransactionScope transaction = new TransactionScope(TransactionScopeOption.Required, ApplicationState.TransactionOptions)) { Result _Result = new Result(); _Result.IsSuccess = iAdmin.InsertMainMenu(tblMainMenu); if (_Result.IsSuccess) { transaction.Complete(); } return(_Result); } } catch (Exception ex) { throw ex; } }