private void btnEditRole_Click(object sender, EventArgs e)
 {
     try
     {
         Account.RoleMaster objForm = getRole();
         btn             = objForm.btnSave;
         objForm.btnSave = Common.setUpdate(btn);
         objForm.ShowDialog();
         onPageLoad();
     }
     catch (Exception ex)
     {
         Common.showDenger(ex.Message);
     }
 }
 public Account.RoleMaster getRole()
 {
     try
     {
         Account.RoleMaster obj = new Account.RoleMaster();
         DataGridViewSelectedRowCollection row = gridRoleMaster.SelectedRows;
         if (row.Count > 0)
         {
             role = role.getRole(Convert.ToInt32(row[0].Cells["RoleId"].Value));
             obj.txtRolename.Text = role.RoleName;
             return(obj);
         }
         else
         {
             return(new Account.RoleMaster());
         }
     }
     catch (Exception ex)
     {
         Common.showDenger(ex.Message);
         return(null);
     }
 }
 private void btnNewRole_Click(object sender, EventArgs e)
 {
     Account.RoleMaster objForm = new Account.RoleMaster();
     objForm.ShowDialog();
     onPageLoad();
 }