Пример #1
0
        public ActionResult RolePermissionsGVPAddNew([ModelBinder(typeof(DevExpressEditorsBinder))] App.Marriage.Models.RoleMV.RolePermissionsViewModel item)
        {
            var model = new RolePermissionsViewModel();

            //if (ModelState.IsValid)
            //{
            try
            {
                // Insert here a code to insert the new item in your model
            }
            catch (Exception e)
            {
                ViewData["EditError"] = e.Message;
            }
            //}
            //else
            //    ViewData["EditError"] = "Please, correct all errors.";
            return(PartialView("~/Views/RolePermissions/_RolePermissionsGVP.cshtml", model));
        }
Пример #2
0
        public ActionResult RolePermissionsGVPUpdate([ModelBinder(typeof(DevExpressEditorsBinder))] App.Marriage.Models.RoleMV.RolePermissionsViewModel item)
        {
            //if (ModelState.IsValid)
            //{
            try
            {
                RolePermissionsDAL RP = new RolePermissionsDAL(item.Id);
                RP.RolePermissions.IsActive = item.IsActive;
                RP.Update();
                // Insert here a code to update the item in your model
            }
            catch (Exception e)
            {
                ViewData["EditError"] = e.Message;
            }
            //}
            //else
            //    ViewData["EditError"] = "Please, correct all errors.";
            var model = RolePermissionsViewModel.GetRolePermissionsList();

            return(PartialView("~/Views/RolePermissions/_RolePermissionsGVP.cshtml", model));
        }