/// <summary> /// to get the data from the database and bind it to the DrpSubCounty dropdown /// </summary> /// <param name="countyID"></param> private void BindSubCounty(string countyID) { ListItem firstListItem = new ListItem(DrpSubCounty.Items[0].Text, DrpSubCounty.Items[0].Value); DrpSubCounty.Items.Clear(); if (countyID != "0") { DrpSubCounty.DataSource = (new MasterBLL()).LoadSubCountyData(countyID); DrpSubCounty.DataTextField = "SubCountyName"; DrpSubCounty.DataValueField = "SubCountyID"; DrpSubCounty.DataBind(); } DrpSubCounty.Items.Insert(0, firstListItem); DrpSubCounty.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; } } }