/// <summary> /// to get the data from the database and bind it to the DrpCounty dropdown /// </summary> /// <param name="districtID"></param> private void BindCounties(string districtID) { ListItem firstListItem = new ListItem(DrpCounty.Items[0].Text, DrpCounty.Items[0].Value); DrpCounty.Items.Clear(); if (districtID != "0") { DrpCounty.DataSource = (new MasterBLL()).LoadCountyData(districtID); DrpCounty.DataTextField = "CountyName"; DrpCounty.DataValueField = "CountyID"; DrpCounty.DataBind(); } DrpCounty.Items.Insert(0, firstListItem); DrpCounty.SelectedIndex = 0; }
/// <summary> /// to get the Land info Respondant /// </summary> private void getLandInfoRespondant() { LandInfoRespondentsBO LIR = new LandInfoRespondentsBO(); LandInfoRespondentsBLL objLIRBLL = new LandInfoRespondentsBLL(); LIR = objLIRBLL.GetLandInfoRespondentsByID(Convert.ToInt32(ViewState["LND_HOLDINGID"])); if (LIR != null) { DrpType.ClearSelection(); if (LIR.LND_TYPEID > 0) { DrpType.SelectedValue = LIR.LND_TYPEID.ToString(); } DrpUse.ClearSelection(); if (LIR.LND_USEID > 0) { DrpUse.SelectedValue = LIR.LND_USEID.ToString(); } DrpDistrict.ClearSelection(); if (DrpDistrict.Items.FindByText(LIR.DISTRICT) != null) { DrpDistrict.Items.FindByText(LIR.DISTRICT).Selected = true; } BindCounties(DrpDistrict.SelectedItem.Value); DrpCounty.ClearSelection(); if (DrpCounty.Items.FindByText(LIR.COUNTY) != null) { DrpCounty.Items.FindByText(LIR.COUNTY).Selected = true; } BindSubCounty(DrpCounty.SelectedItem.Value); DrpSubCounty.ClearSelection(); if (DrpSubCounty.Items.FindByText(LIR.SUBCOUNTY) != null) { DrpSubCounty.Items.FindByText(LIR.SUBCOUNTY).Selected = true; } BindVillages(DrpSubCounty.SelectedItem.Value); DrpVillage.ClearSelection(); if (DrpVillage.Items.FindByText(LIR.VILLAGE) != null) { DrpVillage.Items.FindByText(LIR.VILLAGE).Selected = true; } //DrpType.SelectedItem.Value = Convert.ToString(LIR.LND_TYPEID); //DrpUse.SelectedItem.Value = Convert.ToString(LIR.LND_USEID); //DrpDistrict.SelectedItem.Value = Convert.ToString(LIR.DISTRICT); //DrpCounty.SelectedItem.Value = Convert.ToString(LIR.COUNTY); //DrpSubCounty.SelectedItem.Value = Convert.ToString(LIR.SUBCOUNTY); //DrpVillage.SelectedItem.Value = Convert.ToString(LIR.VILLAGE); ddlTenureType.ClearSelection(); if (ddlTenureType.Items.FindByValue(LIR.TenureId.ToString()) != null) { ddlTenureType.SelectedValue = LIR.TenureId.ToString(); } if (LIR.ISPRIMARYRESIDENCE.ToLower() == "Yes".ToLower()) { ChkPrimary.Checked = true; } else { ChkPrimary.Checked = false; } if (LIR.ISAFFECTED.ToLower() == "Yes".ToLower()) { ChkAffected.Checked = true; } else { ChkAffected.Checked = false; } if (LIR.TOTALSIZE != -1) { txttotal.Text = Convert.ToString(LIR.TOTALSIZE); } else { txttotal.Text = string.Empty; } if (LIR.TENURE != null) { txttenure.Text = LIR.TENURE; } else { txttenure.Text = string.Empty; } } }