public virtual CloudAccountDA.FormGridCompanyAdminMasterDataTable GetData(int?ModuleID) { this.Adapter.SelectCommand = this.CommandCollection[0]; if (ModuleID.HasValue) { this.Adapter.SelectCommand.Parameters[1].Value = ModuleID.Value; } else { this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value; } CloudAccountDA.FormGridCompanyAdminMasterDataTable dataTable = new CloudAccountDA.FormGridCompanyAdminMasterDataTable(); this.Adapter.Fill(dataTable); return(dataTable); }
public virtual int Fill(CloudAccountDA.FormGridCompanyAdminMasterDataTable dataTable, int?ModuleID) { this.Adapter.SelectCommand = this.CommandCollection[0]; if (ModuleID.HasValue) { this.Adapter.SelectCommand.Parameters[1].Value = ModuleID.Value; } else { this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value; } if (this.ClearBeforeFill) { dataTable.Clear(); } return(this.Adapter.Fill(dataTable)); }
private void SetRecord(string cmpID, string cmpLoginID, string mID) { if (CompanyAdminRightsMaster.AddMode == "Edit") { this.objCompanyAdminUserRightsMasterDT = this.objCompanyAdminUserRightsMasterBll.GetDataBySelectRightsDetails(int.Parse(cmpID), int.Parse(cmpLoginID), int.Parse(mID)); if (this.objCompanyAdminUserRightsMasterDT.Rows.Count <= 0) { return; } this.ddlCompanyAdmin.SelectedValue = this.objCompanyAdminUserRightsMasterDT.Rows[0]["CompanyID"].ToString(); this.ddlCompanyAdmin.DataBind(); this.ddlCompanyAdmin_SelectedIndexChanged((object)null, (EventArgs)null); this.ddlCompanyLogin.SelectedValue = this.objCompanyAdminUserRightsMasterDT.Rows[0]["CompanyAdminID"].ToString(); this.ddlCompanyLogin.DataBind(); this.ddlModule.SelectedValue = this.objCompanyAdminUserRightsMasterDT.Rows[0]["ModuleID"].ToString(); this.ddlModule.DataBind(); this.objFormGridMasterDT = this.objFormGridMasterBll.GetAllData(new int?()); this.gvForm.DataSource = (object)this.objCompanyAdminUserRightsMasterDT; this.gvForm.DataBind(); this.gvForm.Enabled = false; this.btnEdit.Visible = true; } else { this.objCompanyAdminUserRightsMasterDT = this.objCompanyAdminUserRightsMasterBll.GetDataBySelectRightsDetails(int.Parse(cmpID), int.Parse(cmpLoginID), int.Parse(mID)); if (this.objCompanyAdminUserRightsMasterDT.Rows.Count <= 0) { return; } this.hfCompanyID.Value = this.ddlCompanyAdmin.SelectedValue = this.objCompanyAdminUserRightsMasterDT.Rows[0]["CompanyID"].ToString(); this.ddlCompanyAdmin.DataBind(); this.ddlCompanyAdmin_SelectedIndexChanged((object)null, (EventArgs)null); this.ddlCompanyLogin.SelectedValue = this.objCompanyAdminUserRightsMasterDT.Rows[0]["CompanyAdminID"].ToString(); this.ddlCompanyLogin.DataBind(); this.ddlModule.SelectedValue = this.objCompanyAdminUserRightsMasterDT.Rows[0]["ModuleID"].ToString(); this.ddlModule.DataBind(); this.objFormGridMasterDT = this.objFormGridMasterBll.GetAllData(new int?()); this.gvForm.DataSource = (object)this.objCompanyAdminUserRightsMasterDT; this.gvForm.DataBind(); this.gvForm.Enabled = true; this.btnEdit.Visible = true; } }
private void ViewRecord(string cmpID, string cmpLoginID) { this.objCompanyAdminUserRightsMasterDT = this.objCompanyAdminUserRightsMasterBll.GetDataByViewRecords(int.Parse(cmpID), int.Parse(cmpLoginID)); if (this.objCompanyAdminUserRightsMasterDT.Rows.Count <= 0) { return; } this.ddlCompanyAdmin.SelectedValue = this.objCompanyAdminUserRightsMasterDT.Rows[0]["CompanyID"].ToString(); this.ddlCompanyAdmin.DataBind(); this.ddlCompanyAdmin_SelectedIndexChanged((object)null, (EventArgs)null); this.ddlCompanyLogin.SelectedValue = this.objCompanyAdminUserRightsMasterDT.Rows[0]["CompanyAdminID"].ToString(); this.ddlCompanyLogin.DataBind(); this.objFormGridMasterDT = this.objFormGridMasterBll.GetAllData(new int?()); if (this.objFormGridMasterDT.Rows.Count <= 0) { return; } this.gvForm.DataSource = (object)this.objFormGridMasterDT; this.gvForm.DataBind(); this.gvForm.Enabled = false; this.btnEdit.Visible = false; }
private void SubBindGrid() { if (CompanyAdminRightsMaster.AddMode == "Edit") { string selectedValue = this.ddlModule.SelectedValue; if (string.IsNullOrEmpty(this.ddlModule.SelectedValue) && string.IsNullOrEmpty(this.ddlCompanyAdmin.SelectedValue)) { this.objFormGridMasterDT = this.objFormGridMasterBll.GetAllData(new int?()); if (this.objFormGridMasterDT.Rows.Count <= 0) { return; } this.gvForm.DataSource = (object)this.objFormGridMasterDT; this.gvForm.DataBind(); this.gvForm.Enabled = false; this.btnEdit.Visible = false; } else { this.objCompanyAdminUserRightsMasterDT = this.objCompanyAdminUserRightsMasterBll.GetDataBySelectRightsDetails(int.Parse(this.ddlCompanyAdmin.SelectedValue.Trim()), int.Parse(this.ddlCompanyLogin.SelectedValue.Trim()), int.Parse(this.ddlModule.SelectedValue.Trim())); if (this.objCompanyAdminUserRightsMasterDT.Rows.Count > 0) { this.gvForm.DataSource = (object)this.objCompanyAdminUserRightsMasterDT; this.gvForm.DataBind(); this.gvForm.Enabled = false; this.btnEdit.Visible = true; } else { this.objFormGridMasterDT = this.objFormGridMasterBll.GetAllData(new int?(int.Parse(selectedValue))); if (this.objFormGridMasterDT.Rows.Count > 0) { this.gvForm.DataSource = (object)this.objFormGridMasterDT; this.gvForm.DataBind(); this.gvForm.Enabled = false; this.btnEdit.Visible = false; } else { this.gvForm.DataSource = (object)this.objFormGridMasterDT; this.gvForm.DataBind(); this.btnEdit.Visible = false; } } } } else { string selectedValue = this.ddlModule.SelectedValue; if (string.IsNullOrEmpty(this.ddlModule.SelectedValue) && string.IsNullOrEmpty(this.ddlCompanyAdmin.SelectedValue)) { this.objFormGridMasterDT = this.objFormGridMasterBll.GetAllData(new int?()); if (this.objFormGridMasterDT.Rows.Count <= 0) { return; } this.gvForm.DataSource = (object)this.objFormGridMasterDT; this.gvForm.Enabled = false; this.btnSubmit.Visible = false; this.btnReset.Visible = false; this.gvForm.DataBind(); } else { this.objCompanyAdminUserRightsMasterDT = this.objCompanyAdminUserRightsMasterBll.GetDataBySelectRightsDetails(int.Parse(this.ddlCompanyAdmin.SelectedValue.Trim()), int.Parse(this.ddlCompanyLogin.SelectedValue.Trim()), int.Parse(this.ddlModule.SelectedValue.Trim())); if (this.objCompanyAdminUserRightsMasterDT.Rows.Count > 0) { this.gvForm.DataSource = (object)this.objCompanyAdminUserRightsMasterDT; this.gvForm.DataBind(); this.gvForm.Enabled = false; this.btnSubmit.Visible = false; this.btnReset.Visible = false; } else { this.objFormGridMasterDT = this.objFormGridMasterBll.GetAllData(new int?(int.Parse(selectedValue))); if (this.objFormGridMasterDT.Rows.Count > 0) { this.gvForm.DataSource = (object)this.objFormGridMasterDT; this.gvForm.DataBind(); this.gvForm.Enabled = true; this.btnSubmit.Visible = true; this.btnReset.Visible = true; } else { this.gvForm.DataSource = (object)this.objFormGridMasterDT; this.gvForm.DataBind(); this.btnSubmit.Visible = false; this.btnReset.Visible = false; } } } } }