private void initDDLSuburbs() { CustomerEDSC.v_SuburbExplorerDTDataTable dt = new CustomerDAC().RetrieveSuburbs(); CustomerEDSC.v_SuburbExplorerDTDataTable dtSub = new CustomerDAC().RetrieveSuburbs(); ListItemCollection subList = new ListItemCollection(); DropDownCheckBoxes1.DataSource = dtSub; DropDownCheckBoxes1.DataTextField = "Name"; DropDownCheckBoxes1.DataValueField = "ID"; DropDownCheckBoxes1.DataBind(); }
protected void BindData() { DataSet ds = new DataSet(); string blank = " "; string cmdstr = "select Email from SCreateAdmin where not Email=' '"; SqlDataAdapter adp = new SqlDataAdapter(cmdstr, cn); adp.Fill(ds); if (ds.Tables[0].Rows.Count > 0) { DropDownCheckBoxes1.DataSource = ds.Tables[0]; DropDownCheckBoxes1.DataTextField = "Email"; DropDownCheckBoxes1.DataValueField = "Email"; DropDownCheckBoxes1.DataBind(); //ddchkCountry.DataSource = ds.Tables[0]; //ddchkCountry.DataTextField = "Country"; //ddchkCountry.DataValueField = "CountryID"; //ddchkCountry.DataBind(); } }
protected void BindData() { DataSet ds = new DataSet(); DataSet GetNamesDS = new DataSet(); string ShakhaAbhyantaName = string.Empty; string UpabhyantaName = string.Empty; string ThekedaarName = string.Empty; string blank = " "; string UrlWorId = Request.QueryString["WorkID"].ToString(); string Value; txtdescription.Text = "WorkId:" + UrlWorId + " "; string Path = System.Web.HttpContext.Current.Request.UrlReferrer.AbsolutePath; System.IO.FileInfo Info = new System.IO.FileInfo(Path); string pageName = Info.Name; string QueryString = Request.Url.ToString(); string pathUrl = Session["pathUrl"].ToString(); if (pageName == "MasterBuildingReport.aspx" || pathUrl == "Building") { string GetNames = "select a.ShakhaAbhyantaName as ShakhaAbhyantaName,a.UpabhyantaName as UpabhyantaName,a.ThekedaarName as ThekedaarName from BudgetMasterBuilding as a join BuildingProvision as b on a.WorkId=b.WorkId where a.WorkId='" + UrlWorId + "'"; SqlDataAdapter GetNamesDA = new SqlDataAdapter(GetNames.ToString(), con); GetNamesDA.Fill(GetNamesDS); } else if (pageName == "MasterCRFReport.aspx" || pathUrl == "CRF") { string GetNames = "select a.ShakhaAbhyantaName as ShakhaAbhyantaName,a.UpabhyantaName as UpabhyantaName,a.ThekedaarName as ThekedaarName from BudgetMasterCRF as a join CRFProvision as b on a.WorkId=b.WorkId where a.WorkId='" + UrlWorId + "'"; SqlDataAdapter GetNamesDA = new SqlDataAdapter(GetNames, con); GetNamesDA.Fill(GetNamesDS); } else if (pageName == "MasterNabardReport.aspx" || pathUrl == "Nabard") { string GetNames = "select a.ShakhaAbhyantaName as ShakhaAbhyantaName,a.UpabhyantaName as UpabhyantaName,a.ThekedaarName as ThekedaarName from BudgetMasterNABARD as a join NABARDProvision as b on a.WorkId=b.WorkId where a.WorkId='" + UrlWorId + "'"; SqlDataAdapter GetNamesDA = new SqlDataAdapter(GetNames, con); GetNamesDA.Fill(GetNamesDS); } else if (pageName == "MasterRoadReport.aspx" || pathUrl == "Road") { string GetNames = "select a.ShakhaAbhyantaName as ShakhaAbhyantaName,a.UpabhyantaName as UpabhyantaName,a.ThekedaarName as ThekedaarName from BudgetMasterRoad as a join RoadProvision as b on a.WorkId=b.WorkId where a.WorkId='" + UrlWorId + "'"; SqlDataAdapter GetNamesDA = new SqlDataAdapter(GetNames, con); GetNamesDA.Fill(GetNamesDS); } else if (pageName == "MasterDPDCReport.aspx" || pathUrl == "DPDC") { string GetNames = "select a.ShakhaAbhyantaName as ShakhaAbhyantaName,a.UpabhyantaName as UpabhyantaName,a.ThekedaarName as ThekedaarName from BudgetMasterDPDC as a join DPDCProvision as b on a.WorkId=b.WorkId where a.WorkId='" + UrlWorId + "'"; SqlDataAdapter GetNamesDA = new SqlDataAdapter(GetNames, con); GetNamesDA.Fill(GetNamesDS); } else if (pageName == "MasterDepositeFundReport.aspx" || pathUrl == "Deposit Fund") { string GetNames = "select a.ShakhaAbhyantaName as ShakhaAbhyantaName,a.UpabhyantaName as UpabhyantaName,a.ThekedaarName as ThekedaarName from BudgetMasterDepositFund as a join DepositFundProvision as b on a.WorkId=b.WorkId where a.WorkId='" + UrlWorId + "'"; SqlDataAdapter GetNamesDA = new SqlDataAdapter(GetNames, con); GetNamesDA.Fill(GetNamesDS); } else if (pageName == "MasterMPReport.aspx" || pathUrl == "MP") { string GetNames = "select a.ShakhaAbhyantaName as ShakhaAbhyantaName,a.UpabhyantaName as UpabhyantaName,a.ThekedaarName as ThekedaarName from BudgetMasterMP as a join MPProvision as b on a.WorkId=b.WorkId where a.WorkId='" + UrlWorId + "'"; SqlDataAdapter GetNamesDA = new SqlDataAdapter(GetNames, con); GetNamesDA.Fill(GetNamesDS); } else if (pageName == "MasterMPReport.aspx" || pathUrl == "MP") { string GetNames = "select a.ShakhaAbhyantaName as ShakhaAbhyantaName,a.UpabhyantaName as UpabhyantaName,a.ThekedaarName as ThekedaarName from BudgetMasterMP as a join MPProvision as b on a.WorkId=b.WorkId where a.WorkId='" + UrlWorId + "'"; SqlDataAdapter GetNamesDA = new SqlDataAdapter(GetNames, con); GetNamesDA.Fill(GetNamesDS); } else if (pageName == "MasterMLAReport.aspx" || pathUrl == "MLA") { string GetNames = "select a.ShakhaAbhyantaName as ShakhaAbhyantaName,a.UpabhyantaName as UpabhyantaName,a.ThekedaarName as ThekedaarName from BudgetMasterMLA as a join MLAProvision as b on a.WorkId=b.WorkId where a.WorkId='" + UrlWorId + "'"; SqlDataAdapter GetNamesDA = new SqlDataAdapter(GetNames, con); GetNamesDA.Fill(GetNamesDS); } else if (pageName == "MasterGat_AReport.aspx" || pathUrl == "GAT_A") { string GetNames = "select a.ShakhaAbhyantaName as ShakhaAbhyantaName,a.UpabhyantaName as UpabhyantaName,a.ThekedaarName as ThekedaarName from BudgetMasterGAT_A as a join GAT_AProvision as b on a.WorkId=b.WorkId where a.WorkId='" + UrlWorId + "'"; SqlDataAdapter GetNamesDA = new SqlDataAdapter(GetNames, con); GetNamesDA.Fill(GetNamesDS); } //else if (pageName == "MasterGAT_BReport.aspx") //{ // string GetNames = "select a.ShakhaAbhyantaName as ShakhaAbhyantaName,a.UpabhyantaName as UpabhyantaName,a.ThekedaarName as ThekedaarName from BudgetMasterGAT_FBC as a join GAT_FBCProvision as b on a.WorkId=b.WorkId where a.WorkId='" + UrlWorId + "'"; // SqlDataAdapter GetNamesDA = new SqlDataAdapter(GetNames, con); // GetNamesDA.Fill(GetNamesDS); //} else if (pageName == "MasterGat_FReport.aspx" || pageName == "MasterGAT_BReport.aspx" || pageName == "MasterGAT_CReport.aspx" || pathUrl == "गट एफ" || pathUrl == "गट बी" || pathUrl == "गट सी") { string GetNames = "select a.ShakhaAbhyantaName as ShakhaAbhyantaName,a.UpabhyantaName as UpabhyantaName,a.ThekedaarName as ThekedaarName from BudgetMasterGAT_FBC as a join GAT_FBCProvision as b on a.WorkId=b.WorkId where a.WorkId='" + UrlWorId + "'"; SqlDataAdapter GetNamesDA = new SqlDataAdapter(GetNames, con); GetNamesDA.Fill(GetNamesDS); } else if (pageName == "MasterGat_DReport.aspx" || pathUrl == "GAT_D") { string GetNames = "select a.ShakhaAbhyantaName as ShakhaAbhyantaName,a.UpabhyantaName as UpabhyantaName,a.ThekedaarName as ThekedaarName from BudgetMasterGAT_D as a join GAT_DProvision as b on a.WorkId=b.WorkId where a.WorkId='" + UrlWorId + "'"; SqlDataAdapter GetNamesDA = new SqlDataAdapter(GetNames, con); GetNamesDA.Fill(GetNamesDS); } else if (pageName == "MasterAuntyReport.aspx" || pathUrl == "Annuty") { string GetNames = "select a.ShakhaAbhyantaName as ShakhaAbhyantaName,a.UpabhyantaName as UpabhyantaName,a.ThekedaarName as ThekedaarName from BudgetMasterAunty as a join AuntyProvision as b on a.WorkId=b.WorkId where a.WorkId='" + UrlWorId + "'"; SqlDataAdapter GetNamesDA = new SqlDataAdapter(GetNames, con); GetNamesDA.Fill(GetNamesDS); } else if (pageName == "SReport.aspx") { Value = Request.QueryString["Value"].ToString(); if (Value == "GridBuilding") { string GetNames = "select a.ShakhaAbhyantaName as ShakhaAbhyantaName,a.UpabhyantaName as UpabhyantaName,a.ThekedaarName as ThekedaarName from BudgetMasterBuilding as a join BuildingProvision as b on a.WorkId=b.WorkId where a.WorkId='" + UrlWorId + "'"; SqlDataAdapter GetNamesDA = new SqlDataAdapter(GetNames, con); GetNamesDA.Fill(GetNamesDS); } if (Value.ToString() == "GridCRF") { string GetNames = "select a.ShakhaAbhyantaName as ShakhaAbhyantaName,a.UpabhyantaName as UpabhyantaName,a.ThekedaarName as ThekedaarName from BudgetMasterCRF as a join CRFProvision as b on a.WorkId=b.WorkId where a.WorkId='" + UrlWorId + "'"; SqlDataAdapter GetNamesDA = new SqlDataAdapter(GetNames, con); GetNamesDA.Fill(GetNamesDS); } if (Value.ToString() == "GridNabard") { string GetNames = "select a.ShakhaAbhyantaName as ShakhaAbhyantaName,a.UpabhyantaName as UpabhyantaName,a.ThekedaarName as ThekedaarName from BudgetMasterNABARD as a join NABARDProvision as b on a.WorkId=b.WorkId where a.WorkId='" + UrlWorId + "'"; SqlDataAdapter GetNamesDA = new SqlDataAdapter(GetNames, con); GetNamesDA.Fill(GetNamesDS); } if (Value.ToString() == "GridRoad") { string GetNames = "select a.ShakhaAbhyantaName as ShakhaAbhyantaName,a.UpabhyantaName as UpabhyantaName,a.ThekedaarName as ThekedaarName from BudgetMasterRoad as a join RoadProvision as b on a.WorkId=b.WorkId where a.WorkId='" + UrlWorId + "'"; SqlDataAdapter GetNamesDA = new SqlDataAdapter(GetNames, con); GetNamesDA.Fill(GetNamesDS); } if (Value.ToString() == "GridDPDC") { string GetNames = "select a.ShakhaAbhyantaName as ShakhaAbhyantaName,a.UpabhyantaName as UpabhyantaName,a.ThekedaarName as ThekedaarName from BudgetMasterDPDC as a join DPDCProvision as b on a.WorkId=b.WorkId where a.WorkId='" + UrlWorId + "'"; SqlDataAdapter GetNamesDA = new SqlDataAdapter(GetNames, con); GetNamesDA.Fill(GetNamesDS); } if (Value.ToString() == "GridMLA") { string GetNames = "select a.ShakhaAbhyantaName as ShakhaAbhyantaName,a.UpabhyantaName as UpabhyantaName,a.ThekedaarName as ThekedaarName from BudgetMasterMLA as a join MLAProvision as b on a.WorkId=b.WorkId where a.WorkId='" + UrlWorId + "'"; SqlDataAdapter GetNamesDA = new SqlDataAdapter(GetNames, con); GetNamesDA.Fill(GetNamesDS); } if (Value.ToString() == "GridMP") { string GetNames = "select a.ShakhaAbhyantaName as ShakhaAbhyantaName,a.UpabhyantaName as UpabhyantaName,a.ThekedaarName as ThekedaarName from BudgetMasterMP as a join MPProvision as b on a.WorkId=b.WorkId where a.WorkId='" + UrlWorId + "'"; SqlDataAdapter GetNamesDA = new SqlDataAdapter(GetNames, con); GetNamesDA.Fill(GetNamesDS); } } if (GetNamesDS.Tables.Count > 0) { if (GetNamesDS.Tables[0].Rows.Count > 0) { ShakhaAbhyantaName = GetNamesDS.Tables[0].Rows[0]["ShakhaAbhyantaName"].ToString(); UpabhyantaName = GetNamesDS.Tables[0].Rows[0]["UpabhyantaName"].ToString(); ThekedaarName = GetNamesDS.Tables[0].Rows[0]["ThekedaarName"].ToString(); } string cmdstr = "select Name,MobileNo from SCreateAdmin where Name=N'" + ShakhaAbhyantaName.ToString() + "' OR Name=N'" + UpabhyantaName.ToString() + "' OR Name=N'" + ThekedaarName.ToString() + "'"; SqlDataAdapter adp = new SqlDataAdapter(cmdstr, con); adp.Fill(ds); if (ds.Tables[0].Rows.Count > 0) { DropDownCheckBoxes1.Items.Clear(); DropDownCheckBoxes1.DataSource = ds.Tables[0]; DropDownCheckBoxes1.DataTextField = "Name"; DropDownCheckBoxes1.DataValueField = "MobileNo"; DropDownCheckBoxes1.DataBind(); } } else { Response.Redirect(pageName, false); } }