private void btnSave_Click(object sender, EventArgs e) { try { if (txtPermissionName.Text == "") { MessageBox.Show("You Must Enter Permission Name"); return; } Permission.Add(new Permission() { Permission_Code = int.Parse(txtPermissionCode.Text), Permission_Name = txtPermissionName.Text }); btnSave.Enabled = false; btnAddNew.Enabled = btnDelete.Enabled = btnModify.Enabled = true; txtPermissionCode.Text = txtPermissionName.Text = ""; MessageBox.Show("New Permission Successfully Added"); FRM_Permission_Load(null, null); btnLast_Click(null, null); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public ActionResult AddPermission(Permission model) { if (ModelState.IsValid) { _permissionManager.Add(model); } return(RedirectToAction("Index", "Permission")); }
public IActionResult SubmitAddRoleAccess(string obj) { TControllerRoleAccess objRoleAccess = new TControllerRoleAccess(); string errMsg = ValidateRoleAccess(obj, ref objRoleAccess); if (errMsg == "") { objRoleAccess.RoleID = objRoleAccess.RoleID.ToUpper(); bool isDuplicate = prm.CheckDuplicateRoleAccess(objRoleAccess.ControllerName, objRoleAccess.RoleID, ref errMsg); if (errMsg == "") { errMsg = isDuplicate ? "Data Already Exist" : ""; } else { errMsg = "Internal Server Error"; } } if (errMsg == "") { errMsg = prm.Add(objRoleAccess) == "" ? "" : "Internal Server Error"; } return(Z_Result.SetResult(errMsg)); }