Ejemplo n.º 1
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));
        }
Ejemplo n.º 2
0
        public void Update()
        {
            RolePermissionsDAL R = new RolePermissionsDAL();

            if (_Permission_Id != null && _Permission_Id != 0)
            {
                R.RolePermissions.Permission_Id = _Permission_Id;
            }

            if (_Roles_Id != null && _Roles_Id != 0)
            {
                R.RolePermissions.Roles_Id = _Roles_Id;
            }

            if (_IsActive != null)
            {
                R.RolePermissions.IsActive = _IsActive;
            }

            R.RolePermissions.InsertDate = DateTime.Now;

            R.Update();
        }