protected void btnPermission_Click(object sender, EventArgs e) { hidTAB.Value = "#tab3"; if (string.IsNullOrEmpty(this.txtPermDesc.Text)) { this.lblPermsnMsg.Text = MessageFormatter.GetFormattedErrorMessage("Permission Description required!"); return; } if (mp.getPermssn(this.txtPermDesc.Text, this.txtController.Text, this.txtAction.Text, this.txtFormURL.Text) == true) { this.lblPermsnMsg.Text = MessageFormatter.GetFormattedErrorMessage("Permission already exist!"); return; } else { try { bool newPermssn = mp.CreatePermissions(this.txtPermDesc.Text, this.txtController.Text, this.txtAction.Text, this.txtFormURL.Text); if (newPermssn == true) { this.lblPermsnMsg.Text = MessageFormatter.GetFormattedSuccessMessage("Permission Created Succesfully!"); clearPermissionForm(); } else { this.lblPermsnMsg.Text = MessageFormatter.GetFormattedErrorMessage("Error Creating Permission!"); } } catch (Exception ex) { this.lblPermsnMsg.Text = MessageFormatter.GetFormattedErrorMessage("Error:" + ex.Message); } //User for getting indebt exception error messages. //catch (DbEntityValidationException dbEx) //{ // foreach (var validationErrors in dbEx.EntityValidationErrors) // { // foreach (var validationError in validationErrors.ValidationErrors) // { // System.Console.WriteLine("Property: {0} Error: {1}", validationError.PropertyName, validationError.ErrorMessage); // } // } //} } // Permssn.Attributes.Add("class", "active"); }