コード例 #1
0
        /// <summary>
        /// to get the data from the database and bind it to the DrpVillage dropdown
        /// </summary>
        /// <param name="subCounty"></param>
        private void BindVillages(string subCounty)
        {
            ListItem firstListItem = new ListItem(DrpVillage.Items[0].Text, DrpVillage.Items[0].Value);

            DrpVillage.Items.Clear();

            if (subCounty != "0")
            {
                DrpVillage.DataSource     = (new MasterBLL()).LoadVillageData(subCounty);
                DrpVillage.DataTextField  = "VillageName";
                DrpVillage.DataValueField = "VillageID";
                DrpVillage.DataBind();
            }

            DrpVillage.Items.Insert(0, firstListItem);
            DrpVillage.SelectedIndex = 0;
        }
コード例 #2
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;
                }
            }
        }