示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }