public ActionResult Delete(string id) { RoleModel roleModel = new RoleModel(); roleModel.Id = id; using (RoleBAL roleBAL = new RoleBAL(ContextInfo)) { roleBAL.GetRoleModel(roleModel); } SiteMapHelper.PrepareSiteMapModel(roleModel.SiteMapModel, roleModel.Id); return(View(roleModel)); }
public ActionResult Delete(RoleModel roleModel) { using (RoleBAL roleBAL = new RoleBAL(ContextInfo)) { roleBAL.Delete(roleModel); if (roleModel.HasErrorByType()) { roleBAL.GetRoleModel(roleModel); } } if (roleModel.HasErrorByType()) { SiteMapHelper.PrepareSiteMapModel(roleModel.SiteMapModel, roleModel.Id); } return(View(roleModel)); }
public ActionResult Create(RoleModel roleModel) { using (RoleBAL roleBAL = new RoleBAL(ContextInfo)) { if (ModelState.IsValid) { roleBAL.Create(roleModel); } if (roleModel.HasErrorByType(LMYFrameWorkMVC.Common.LookUps.ErrorType.Critical) || roleModel.HasSuccess(LMYFrameWorkMVC.Common.LookUps.SuccessType.Full)) { return(base.RedirectToActionWithData(new Dictionary <string, object> { { "baseModel", roleModel } })); } roleBAL.GetRoleModel(roleModel); } return(View("Create", roleModel)); }