//private const string REQUEST_STATUS_SUBMITTED = "Submitted"; //private const string REQUEST_STATUS_PENDING = "Request Pending"; //public static string RequestStatus_Submitted //{ // get { return REQUEST_STATUS_SUBMITTED; } //} //public static string RequestStatus_Pending //{ // get { return REQUEST_STATUS_PENDING; } //} #endregion #region Get Record(s) /// <summary> /// To Get Livelihood Budget Items /// </summary> /// <param name="prmLiveBudgItemsBO"></param> /// <returns></returns> public LivelihoodBudgetItemsList GetLivBudgetItems(LivelihoodBudgetItemsBO prmLiveBudgItemsBO) { oLiveBudgItemsDAL = new LivelihoodBudgetItemsDAL(); return(oLiveBudgItemsDAL.GetLivBudgetItems_ById(prmLiveBudgItemsBO)); // return null; }
/// <summary> /// MapData /// </summary> /// <param name="reader"></param> /// <returns></returns> private LivelihoodBudgetItemsBO MapData(IDataReader reader) { LivelihoodBudgetItemsBO oLiveBudgItemsBO = new LivelihoodBudgetItemsBO(); if (ColumnExists(reader, "Liv_Bud_ItemID") && !reader.IsDBNull(reader.GetOrdinal("Liv_Bud_ItemID"))) { oLiveBudgItemsBO.Liv_Bud_ItemID = Convert.ToInt32(reader.GetValue(reader.GetOrdinal("Liv_Bud_ItemID"))); } if (ColumnExists(reader, "Liv_Bud_CategID") && !reader.IsDBNull(reader.GetOrdinal("Liv_Bud_CategID"))) { oLiveBudgItemsBO.Liv_Bud_CategID = Convert.ToInt32(reader.GetValue(reader.GetOrdinal("Liv_Bud_CategID"))); } if (ColumnExists(reader, "Liv_Bud_ItemName") && !reader.IsDBNull(reader.GetOrdinal("Liv_Bud_ItemName"))) { oLiveBudgItemsBO.Liv_Bud_ItemName = reader.GetString(reader.GetOrdinal("Liv_Bud_ItemName")); } if (ColumnExists(reader, "Liv_Bud_ItemDesc") && !reader.IsDBNull(reader.GetOrdinal("Liv_Bud_ItemDesc"))) { oLiveBudgItemsBO.Liv_Bud_ItemDesc = reader.GetString(reader.GetOrdinal("Liv_Bud_ItemDesc")); } //if (ColumnExists(reader, "papname") && !reader.IsDBNull(reader.GetOrdinal("papname"))) // oLiveBudgItemsBO.PAPName = reader.GetString(reader.GetOrdinal("papname")); return(oLiveBudgItemsBO); }
/// <summary> /// get all data /// </summary> /// <param name="prmLiveBudgItemsBO"></param> /// <returns></returns> public LivelihoodBudgetItemsList GetLivBudgetItems_ById(LivelihoodBudgetItemsBO prmLiveBudgItemsBO) { OracleConnection cnn = new OracleConnection(con); OracleCommand cmd; string proc = "USP_MST_GET_BDG_ITEM_BYID"; cmd = new OracleCommand(proc, cnn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("liv_bud_categid_", prmLiveBudgItemsBO.Liv_Bud_CategID); cmd.Parameters.Add("liv_bud_itemid_", prmLiveBudgItemsBO.Liv_Bud_ItemID); cmd.Parameters.Add("Sp_recordset", Oracle.DataAccess.Client.OracleDbType.RefCursor).Direction = ParameterDirection.Output; cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); LivelihoodBudgetItemsBO oLivBudgItemsBO = null; LivelihoodBudgetItemsList lstLivBudgItem = new LivelihoodBudgetItemsList(); while (dr.Read()) { oLivBudgItemsBO = new LivelihoodBudgetItemsBO(); //objConcern.ConcernID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("CONCERNID"))); //objConcern.ConcernName = dr.GetString(dr.GetOrdinal("CONCERN")); //objConcern.ConcernIsDeleted = dr.GetString(dr.GetOrdinal("ISDELETED")); oLivBudgItemsBO = MapData(dr); lstLivBudgItem.Add(oLivBudgItemsBO); } dr.Close(); return(lstLivBudgItem); }
/// <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; } } } }
/// <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; } }
/// <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(); } }