/// <summary>
 /// Bind customer grid
 /// </summary>
 private void BindGridGadgetAccess(int RoleId)
 {
     DataSet ds = null;
     objRoleGadgetMappingDal = new RoleGadgetMappingDal();
     objRoleGadgetMappingBDto = new RoleGadgetMappingBDto();
     objRoleGadgetMappingBDto.RoleID = RoleId;
     ds = objRoleGadgetMappingDal.GetGadgetByRole(objRoleGadgetMappingBDto);
     radGridAccess.DataSource = ds;
     radGridAccess.DataBind();
 }
 protected void btnSave_OnClick(object sender, EventArgs e)
 {
     int result;
     bool SaveFail = true;
     objRoleGadgetMappingBDto = new RoleGadgetMappingBDto();
     objRoleGadgetMappingDal = new RoleGadgetMappingDal();
     foreach (GridDataItem item in radGridAccess.Items)
     {
         CheckBox chkRead = (CheckBox)item.FindControl("grdChkRead");
         if (item["GADGET_ID"] != null)
             objRoleGadgetMappingBDto.GadgetID = int.Parse(item["GADGET_ID"].Text);
         if (item["MODULE_ID"] != null)
             objRoleGadgetMappingBDto.ModuleID = int.Parse(item["MODULE_ID"].Text);
         if (GlobalRoleId != 0)
             objRoleGadgetMappingBDto.RoleID = GlobalRoleId;
         objRoleGadgetMappingBDto.ReadAccess = chkRead.Checked;
         result = objRoleGadgetMappingDal.InsertAccess(objRoleGadgetMappingBDto);
         if (result != 1)
             SaveFail = false;
     }
     if (SaveFail)
     {
         Master.DisplayMessage(ConfigurationSettings.AppSettings[SuccessMessage.Save].ToString());
         Master.MessageCssClass = "successMessage";
     }
     pnlAccessGrid.Visible = false;
 }