Example #1
0
        /// <summary>
        /// Call Respective methos to fill data
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ddlItem_SelectedIndexChanged(object sender, EventArgs e)
        {
            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;
                    }
                }
            }
        }
Example #2
0
        /// <summary>
        /// Bind Data to Drop Downs
        /// </summary>
        private void LoadRestoreItems()
        {
            LivelihoodBudgetItemsList lstLiveBudgItems  = new LivelihoodBudgetItemsList();
            LivelihoodBudgetItemsBLL  oLiveBudgItemsBLL = new LivelihoodBudgetItemsBLL();
            LivelihoodBudgetItemsBO   oLiveBudgItemsBO  = new LivelihoodBudgetItemsBO();

            if (ddlCategory.SelectedIndex > 0)
            {
                oLiveBudgItemsBO.Liv_Bud_CategID = Convert.ToInt32(ddlCategory.SelectedValue.ToString());

                if (ddlItem.SelectedIndex > 0)
                {
                    oLiveBudgItemsBO.Liv_Bud_ItemID = Convert.ToInt32(ddlItem.SelectedValue.ToString());
                }
                else
                {
                    oLiveBudgItemsBO.Liv_Bud_ItemID = 0;
                }
                ddlItem.Items.Clear();
                lstLiveBudgItems       = oLiveBudgItemsBLL.GetLivBudgetItems(oLiveBudgItemsBO);
                ddlItem.DataSource     = lstLiveBudgItems;
                ddlItem.DataTextField  = "Liv_Bud_ItemName";
                ddlItem.DataValueField = "Liv_Bud_ItemID";
                ddlItem.DataBind();
                ddlItem.Items.Insert(0, (new ListItem("--Select--", "0")));
                ddlItem.SelectedIndex = 0;
            }
        }
Example #3
0
        /// <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();
            }
        }