/// <summary> /// Load Villages /// </summary> private void LoadVillages() { LiveRestBudVillagesBLL oLiveRestBudVillagesBLL = new LiveRestBudVillagesBLL(); LiveRestBudVillagesList oLiveRestBudVillagesList = new LiveRestBudVillagesList(); if (ViewStateLivRestBudgetID > 0) { oLiveRestBudVillagesList = oLiveRestBudVillagesBLL.GetLiveRestBudVillagesById(ViewStateLivRestBudgetID); foreach (LiveRestBudVillagesBO oLiveRestBudVillagesBO in oLiveRestBudVillagesList) { lstbVillages.Items.Add(oLiveRestBudVillagesBO.Village); } } }
/// <summary> /// Get Data by ID /// </summary> private void getLiveRestBudgetById() { LivelihoodRestBudgetBO oLiveRestBudgetBO = new LivelihoodRestBudgetBO(); LivelihoodRestBudgetBLL oLiveRestBudgetBLL = new LivelihoodRestBudgetBLL(); if (ViewStateLivRestBudgetID > 0) { oLiveRestBudgetBO = oLiveRestBudgetBLL.GetLiveRestBudgetByID(ViewStateLivRestBudgetID); ddlCategory.SelectedValue = oLiveRestBudgetBO.Liv_Bud_CategID.ToString(); LoadRestoreItems(); ddlItem.ClearSelection(); if (ddlItem.Items.FindByValue(oLiveRestBudgetBO.Liv_Bud_ItemID.ToString()) != null) { ddlItem.Items.FindByValue(oLiveRestBudgetBO.Liv_Bud_ItemID.ToString()).Selected = true; } // ddlItem.SelectedValue = oLiveRestBudgetBO.Liv_Bud_ItemID.ToString(); //Item Change Event #region LivelihoodBudgetItemsList lstLiveBudgItems = new LivelihoodBudgetItemsList(); LivelihoodBudgetItemsBLL oLiveBudgItemsBLL = new LivelihoodBudgetItemsBLL(); LivelihoodBudgetItemsBO oLiveBudgItemsBO = new LivelihoodBudgetItemsBO(); oLiveBudgItemsBO.Liv_Bud_CategID = Convert.ToInt32(ddlCategory.SelectedValue.ToString()); if (ddlItem.SelectedIndex > 0) { oLiveBudgItemsBO.Liv_Bud_ItemID = Convert.ToInt32(ddlItem.SelectedValue.ToString()); lstLiveBudgItems = oLiveBudgItemsBLL.GetLivBudgetItems(oLiveBudgItemsBO); if (lstLiveBudgItems.Count > 0) { if (lstLiveBudgItems[0].Liv_Bud_ItemDesc != null) { txtItemDescription.Text = lstLiveBudgItems[0].Liv_Bud_ItemDesc.ToString(); } else { txtItemDescription.Text = string.Empty; } } } #endregion #region CheckBox Section if (oLiveRestBudgetBO.ImplCost == "Yes") { chklst.Items[0].Selected = true; } else { chklst.Items[0].Selected = false; } if (oLiveRestBudgetBO.OperCost == "Yes") { chklst.Items[1].Selected = true; } else { chklst.Items[1].Selected = false; } if (oLiveRestBudgetBO.ExternalMonitory == "Yes") { chklst.Items[2].Selected = true; } else { chklst.Items[2].Selected = false; } #endregion txtNoOfBeneficial.Text = oLiveRestBudgetBO.NoOfBeneficial.ToString(); txtItemQuantity.Text = oLiveRestBudgetBO.ItemQuantity.ToString(); txtCostPerUnit.Text = UtilBO.CurrencyFormat(oLiveRestBudgetBO.CostPerUnit); txtTotal.Text = UtilBO.CurrencyFormat(oLiveRestBudgetBO.TotalAmount); txtComments.Text = oLiveRestBudgetBO.Comments; ddlDistrict.ClearSelection(); if (ddlDistrict.Items.FindByText(oLiveRestBudgetBO.District) != null) { ddlDistrict.Items.FindByText(oLiveRestBudgetBO.District).Selected = true; } BindCounties(); ddlCounty.ClearSelection(); if (ddlCounty.Items.FindByText(oLiveRestBudgetBO.County) != null) { ddlCounty.Items.FindByText(oLiveRestBudgetBO.County).Selected = true; } //ddlCounty.SelectedItem.Text = oLiveRestBudgetBO.County; BindSubCounties(); ddlSubCounty.ClearSelection(); if (ddlSubCounty.Items.FindByText(oLiveRestBudgetBO.SubCounty) != null) { ddlSubCounty.Items.FindByText(oLiveRestBudgetBO.SubCounty).Selected = true; } // ddlSubCounty.SelectedItem.Text = oLiveRestBudgetBO.SubCounty; BindParish(); ddlParish.ClearSelection(); if (ddlParish.Items.FindByText(oLiveRestBudgetBO.Parish) != null) { ddlParish.Items.FindByText(oLiveRestBudgetBO.Parish).Selected = true; } //ddlParish.SelectedItem.Text = oLiveRestBudgetBO.Parish; BindVillages(); lstbVillages.ClearSelection(); LiveRestBudVillagesBLL oLiveRestBudVillagesBLL = new LiveRestBudVillagesBLL(); LiveRestBudVillagesList oLiveRestBudVillagesList = new LiveRestBudVillagesList(); if (ViewStateLivRestBudgetID > 0) { oLiveRestBudVillagesList = oLiveRestBudVillagesBLL.GetLiveRestBudVillagesById(ViewStateLivRestBudgetID); foreach (LiveRestBudVillagesBO objLiveRestBudVillagesBO in oLiveRestBudVillagesList) { if (lstbVillages.Items.FindByText(objLiveRestBudVillagesBO.Village) != null) { lstbVillages.Items.FindByText(objLiveRestBudVillagesBO.Village).Selected = true; } // lstbVillages.Items.Add(objLiveRestBudVillagesBO.Village); } } // LoadVillages(); } }