/// <summary> /// get all data by ID /// </summary> /// <param name="LivRestBudgID"></param> /// <returns></returns> public LivelihoodRestBudgetBO GetLiveRestBudgetById(int LivRestBudgID) { OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString); OracleCommand cmd; string proc = "USP_TRN_GET_LIV_RES_BUDG_BYID"; cmd = new OracleCommand(proc, cnn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("liv_res_budgid_", LivRestBudgID); cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output; cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); LivelihoodRestBudgetBO objLivelihoodRestBudgetBO = null; LivelihoodRestBudgetList oLivelihoodRestBudgetList = new LivelihoodRestBudgetList(); objLivelihoodRestBudgetBO = new LivelihoodRestBudgetBO(); while (dr.Read()) { objLivelihoodRestBudgetBO = MapData(dr); } dr.Close(); return(objLivelihoodRestBudgetBO); }
/// <summary> /// get all data /// </summary> /// <param name="projectID"></param> /// <returns></returns> public LivelihoodRestBudgetList GetLiveRestBudget(int projectID) { OracleConnection cnn = new OracleConnection(con); OracleCommand cmd; string proc = "USP_TRN_GET_LIV_RES_BUDG"; cmd = new OracleCommand(proc, cnn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("projectid_", projectID); cmd.Parameters.Add("Sp_recordset", Oracle.DataAccess.Client.OracleDbType.RefCursor).Direction = ParameterDirection.Output; cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); LivelihoodRestBudgetBO objLivelihoodRestBudgetBO = null; LivelihoodRestBudgetList oLivelihoodRestBudgetList = new LivelihoodRestBudgetList(); while (dr.Read()) { objLivelihoodRestBudgetBO = new LivelihoodRestBudgetBO(); objLivelihoodRestBudgetBO = MapData(dr); oLivelihoodRestBudgetList.Add(objLivelihoodRestBudgetBO); } dr.Close(); return(oLivelihoodRestBudgetList); }
/// <summary> /// To Delete /// </summary> private void DeleteLivRestBudget() { LivelihoodRestBudgetBO oLiveRestBudgetBO = new LivelihoodRestBudgetBO(); LivelihoodRestBudgetBLL oLiveRestBudgetBLL = new LivelihoodRestBudgetBLL(); if (ViewStateLivRestBudgetID > 0) { oLiveRestBudgetBLL.DeleteLiveRestBudget(ViewStateLivRestBudgetID); } }
/// <summary> /// To Update Live Rest Budget /// </summary> /// <param name="oLivelihoodRestBudgetBO"></param> /// <returns></returns> public string UpdateLiveRestBudget(LivelihoodRestBudgetBO oLivelihoodRestBudgetBO) { oLiveRestBudgetDAL = new LivelihoodRestBudgetDAL(); return(oLiveRestBudgetDAL.UpdateLiveRestBudget(oLivelihoodRestBudgetBO)); }
/// <summary> /// TO Add Live Rest Budget /// </summary> /// <param name="oLivelihoodRestBudgetBO"></param> /// <returns></returns> public string[] AddLiveRestBudget(LivelihoodRestBudgetBO oLivelihoodRestBudgetBO) { oLiveRestBudgetDAL = new LivelihoodRestBudgetDAL(); return(oLiveRestBudgetDAL.AddLiveRestBudget(oLivelihoodRestBudgetBO)); }
/// <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(); } }
/// <summary> /// To Save And update Data /// </summary> private void AddLiveRestBudget() { LivelihoodRestBudgetBO oLiveRestBudgetBO = new LivelihoodRestBudgetBO(); LivelihoodRestBudgetBLL oLiveRestBudgetBLL = new LivelihoodRestBudgetBLL(); oLiveRestBudgetBO.IsDeleted = "False"; oLiveRestBudgetBO.CreatedBy = SessionUserId; oLiveRestBudgetBO.Liv_Bud_ItemID = Convert.ToInt32(ddlItem.SelectedValue.ToString()); oLiveRestBudgetBO.Liv_Bud_CategID = Convert.ToInt32(ddlCategory.SelectedValue.ToString()); //foreach( if (chklst.Items[0].Selected == true) { oLiveRestBudgetBO.ImplCost = "Yes"; } else { oLiveRestBudgetBO.ImplCost = "No"; } if (chklst.Items[1].Selected == true) { oLiveRestBudgetBO.OperCost = "Yes"; } else { oLiveRestBudgetBO.OperCost = "No"; } if (chklst.Items[2].Selected == true) { oLiveRestBudgetBO.ExternalMonitory = "Yes"; } else { oLiveRestBudgetBO.ExternalMonitory = "No"; } oLiveRestBudgetBO.NoOfBeneficial = Convert.ToDecimal(txtNoOfBeneficial.Text); oLiveRestBudgetBO.ItemQuantity = Convert.ToDecimal(txtItemQuantity.Text); oLiveRestBudgetBO.CostPerUnit = Convert.ToDecimal(txtCostPerUnit.Text); oLiveRestBudgetBO.TotalAmount = Convert.ToDecimal(txtTotal.Text); oLiveRestBudgetBO.Comments = txtComments.Text; oLiveRestBudgetBO.District = ddlDistrict.SelectedItem.Text; oLiveRestBudgetBO.County = ddlCounty.SelectedItem.Text; oLiveRestBudgetBO.SubCounty = ddlSubCounty.SelectedItem.Text; oLiveRestBudgetBO.Parish = ddlParish.SelectedItem.Text; oLiveRestBudgetBO.ProjectID = Convert.ToInt32(Session["PROJECT_ID"]); string AlertMessage = string.Empty; string retMessage = string.Empty; if (ViewStateLivRestBudgetID == 0) { //ADD SECTION string[] message = oLiveRestBudgetBLL.AddLiveRestBudget(oLiveRestBudgetBO); if (string.IsNullOrEmpty(message[0]) || message[0] == "" || message[0] == "null") { // message[0] = "Insertion Successfull"; if (!string.IsNullOrEmpty(message[1])) { LiveRestBudVillagesBLL oLiveRestBudVillagesBLL = new LiveRestBudVillagesBLL(); LiveRestBudVillagesBO oLiveRestBudVillagesBO = new LiveRestBudVillagesBO(); oLiveRestBudVillagesBO.IsDeleted = "False"; oLiveRestBudVillagesBO.CreatedBy = SessionUserId; oLiveRestBudVillagesBO.Liv_Res_BudgId = Convert.ToInt32(message[1]); for (int i = 0; i < lstbVillages.Items.Count; i++) { if (lstbVillages.Items[i].Selected) { oLiveRestBudVillagesBO.Village = lstbVillages.Items[i].Text; retMessage = oLiveRestBudVillagesBLL.AddLiveRestBudVillages(oLiveRestBudVillagesBO); } } if (string.IsNullOrEmpty(retMessage) || retMessage == "" || retMessage == "null") { retMessage = "Data saved successfully"; message[0] = "Data saved successfully"; } } } } else { //UPDATE SECTION if (ViewStateLivRestBudgetID > 0) { oLiveRestBudgetBO.Liv_Res_BudgID = ViewStateLivRestBudgetID; oLiveRestBudgetBO.UpdatedBy = SessionUserId; oLiveRestBudgetBO.CreatedBy = SessionUserId; retMessage = oLiveRestBudgetBLL.UpdateLiveRestBudget(oLiveRestBudgetBO); if (string.IsNullOrEmpty(retMessage) || retMessage == "" || retMessage == "null") { LiveRestBudVillagesBLL oLiveRestBudVillagesBLL = new LiveRestBudVillagesBLL(); LiveRestBudVillagesBO oLiveRestBudVillagesBO = new LiveRestBudVillagesBO(); oLiveRestBudVillagesBO.IsDeleted = "False"; oLiveRestBudVillagesBO.CreatedBy = SessionUserId; oLiveRestBudVillagesBO.Liv_Res_BudgId = ViewStateLivRestBudgetID; //DELETE & INSERT CONCEPT oLiveRestBudVillagesBLL.DeleteLiveRestBudVillages(ViewStateLivRestBudgetID); //DELETE for (int i = 0; i < lstbVillages.Items.Count; i++) { if (lstbVillages.Items[i].Selected) { oLiveRestBudVillagesBO.Village = lstbVillages.Items[i].Text; retMessage = oLiveRestBudVillagesBLL.UpdateLiveRestBudVillages(oLiveRestBudVillagesBO); //INSERT } } retMessage = "Data updated successfully"; } } } ClearFields(); BindGrid(); AlertMessage = "alert('" + retMessage + "');"; ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", AlertMessage, true); }
/// <summary> /// to update data /// </summary> /// <param name="oLivelihoodRestBudgetBO"></param> /// <returns></returns> public string UpdateLiveRestBudget(LivelihoodRestBudgetBO oLivelihoodRestBudgetBO) { //string returnResult = string.Empty; string[] resultArray = new string[2]; cnn = new OracleConnection(con); proc = "USP_TRN_UPD_LIV_RES_BUDG"; cmd = new OracleCommand(proc, cnn); cmd.CommandType = CommandType.StoredProcedure; cmd.Connection.Open(); cmd.Parameters.Add("Liv_Res_BudgID_", oLivelihoodRestBudgetBO.Liv_Res_BudgID); cmd.Parameters.Add("Liv_Bud_CategID_", oLivelihoodRestBudgetBO.Liv_Bud_CategID); cmd.Parameters.Add("Liv_Bud_ItemID_", oLivelihoodRestBudgetBO.Liv_Bud_ItemID); cmd.Parameters.Add("ImplCost_", oLivelihoodRestBudgetBO.ImplCost); cmd.Parameters.Add("OperCost_", oLivelihoodRestBudgetBO.OperCost); cmd.Parameters.Add("ExternalMonitory_", oLivelihoodRestBudgetBO.ExternalMonitory); cmd.Parameters.Add("NoOfBeneficial_", oLivelihoodRestBudgetBO.NoOfBeneficial); cmd.Parameters.Add("ItemQuantity_", oLivelihoodRestBudgetBO.ItemQuantity); cmd.Parameters.Add("CostPerUnit_", oLivelihoodRestBudgetBO.CostPerUnit); cmd.Parameters.Add("TotalAmount_", oLivelihoodRestBudgetBO.TotalAmount); cmd.Parameters.Add("Comments_", oLivelihoodRestBudgetBO.Comments); cmd.Parameters.Add("District_", oLivelihoodRestBudgetBO.District); cmd.Parameters.Add("County_", oLivelihoodRestBudgetBO.County); cmd.Parameters.Add("SubCounty_", oLivelihoodRestBudgetBO.SubCounty); cmd.Parameters.Add("Parish_", oLivelihoodRestBudgetBO.Parish); cmd.Parameters.Add("IsDeleted_", oLivelihoodRestBudgetBO.IsDeleted); cmd.Parameters.Add("UpdatedBy_", oLivelihoodRestBudgetBO.UpdatedBy); cmd.Parameters.Add("liv_res_budgIDD_", OracleDbType.Long, 50).Direction = ParameterDirection.Output; cmd.Parameters.Add("errorMessage_", OracleDbType.Varchar2, 500).Direction = ParameterDirection.Output; // cmd.Parameters.Add("Sp_recordset", Oracle.DataAccess.Client.OracleDbType.RefCursor).Direction = ParameterDirection.Output; //cmd.ExecuteNonQuery(); ////OracleDataReader oDataReader = cmd.ExecuteReader(); //if (cmd.Parameters["liv_res_budgIDD_"].Value != null) // resultArray[0] = cmd.Parameters["liv_res_budgIDD_"].Value.ToString(); //else // resultArray[0] = string.Empty; //if (cmd.Parameters["errorMessage_"].Value != null) // resultArray[1] = cmd.Parameters["errorMessage_"].Value.ToString(); //else // resultArray[1] = string.Empty; //cmd.Parameters.Add("errorMessage_", OracleDbType.Varchar2, 100).Direction = ParameterDirection.Output; try { cmd.ExecuteNonQuery(); if (cmd.Parameters["liv_res_budgIDD_"].Value != null) { resultArray[0] = cmd.Parameters["liv_res_budgIDD_"].Value.ToString(); } else { resultArray[0] = string.Empty; } if (cmd.Parameters["errorMessage_"].Value != null) { resultArray[1] = cmd.Parameters["errorMessage_"].Value.ToString(); } else { resultArray[1] = string.Empty; } } catch (Exception ex) { throw ex; } return(resultArray[1]); }
/// <summary> /// to save data /// </summary> /// <param name="oLivelihoodRestBudgetBO"></param> /// <returns></returns> public string[] AddLiveRestBudget(LivelihoodRestBudgetBO oLivelihoodRestBudgetBO) { //string returnResult = string.Empty; string[] resultArray = new string[2]; LivelihoodRestBudgetBO ooLivelihoodRestBudgetBO = new LivelihoodRestBudgetBO();//For Storing & Returning Result as Object OracleConnection OCon = new OracleConnection(con); OCon.Open(); OracleCommand oCmd = new OracleCommand("USP_TRN_INS_LIV_RES_BUDG", OCon); oCmd.CommandType = CommandType.StoredProcedure; int count = Convert.ToInt32(oCmd.CommandType); try { oCmd.Parameters.Add("Liv_Bud_CategID_", oLivelihoodRestBudgetBO.Liv_Bud_CategID); oCmd.Parameters.Add("Liv_Bud_ItemID_", oLivelihoodRestBudgetBO.Liv_Bud_ItemID); oCmd.Parameters.Add("ImplCost_", oLivelihoodRestBudgetBO.ImplCost); oCmd.Parameters.Add("OperCost_", oLivelihoodRestBudgetBO.OperCost); oCmd.Parameters.Add("ExternalMonitory_", oLivelihoodRestBudgetBO.ExternalMonitory); oCmd.Parameters.Add("NoOfBeneficial_", oLivelihoodRestBudgetBO.NoOfBeneficial); oCmd.Parameters.Add("ItemQuantity_", oLivelihoodRestBudgetBO.ItemQuantity); oCmd.Parameters.Add("CostPerUnit_", oLivelihoodRestBudgetBO.CostPerUnit); oCmd.Parameters.Add("TotalAmount_", oLivelihoodRestBudgetBO.TotalAmount); oCmd.Parameters.Add("Comments_", oLivelihoodRestBudgetBO.Comments); oCmd.Parameters.Add("District_", oLivelihoodRestBudgetBO.District); oCmd.Parameters.Add("County_", oLivelihoodRestBudgetBO.County); oCmd.Parameters.Add("SubCounty_", oLivelihoodRestBudgetBO.SubCounty); oCmd.Parameters.Add("Parish_", oLivelihoodRestBudgetBO.Parish); oCmd.Parameters.Add("projectid_", oLivelihoodRestBudgetBO.ProjectID); oCmd.Parameters.Add("isdeleted_", oLivelihoodRestBudgetBO.IsDeleted); oCmd.Parameters.Add("createdby_", oLivelihoodRestBudgetBO.CreatedBy); oCmd.Parameters.Add("liv_res_budgIDD_", OracleDbType.Long, 50).Direction = ParameterDirection.Output; oCmd.Parameters.Add("errorMessage_", OracleDbType.Varchar2, 500).Direction = ParameterDirection.Output; //oCmd.Parameters.Add("Sp_recordset", Oracle.DataAccess.Client.OracleDbType.RefCursor).Direction = ParameterDirection.Output; oCmd.ExecuteNonQuery(); //OracleDataReader oDataReader = oCmd.ExecuteReader(); if (oCmd.Parameters["liv_res_budgIDD_"].Value != null) { resultArray[0] = oCmd.Parameters["liv_res_budgIDD_"].Value.ToString(); } else { resultArray[0] = string.Empty; } if (oCmd.Parameters["errorMessage_"].Value != null) { resultArray[1] = oCmd.Parameters["errorMessage_"].Value.ToString(); } else { resultArray[1] = string.Empty; } } catch { throw; } finally { oCmd.Dispose(); OCon.Close(); OCon.Dispose(); } return(resultArray); }
/// <summary> /// MapData /// </summary> /// <param name="reader"></param> /// <returns></returns> private LivelihoodRestBudgetBO MapData(IDataReader reader) { LivelihoodRestBudgetBO oLivelihoodRestBudgetBO = new LivelihoodRestBudgetBO(); if (ColumnExists(reader, "Liv_Res_BudgID") && !reader.IsDBNull(reader.GetOrdinal("Liv_Res_BudgID"))) { oLivelihoodRestBudgetBO.Liv_Res_BudgID = Convert.ToInt32(reader.GetValue(reader.GetOrdinal("Liv_Res_BudgID"))); } if (ColumnExists(reader, "Liv_Bud_CategID") && !reader.IsDBNull(reader.GetOrdinal("Liv_Bud_CategID"))) { oLivelihoodRestBudgetBO.Liv_Bud_CategID = Convert.ToInt32(reader.GetValue(reader.GetOrdinal("Liv_Bud_CategID"))); } if (ColumnExists(reader, "Liv_Bud_ItemID") && !reader.IsDBNull(reader.GetOrdinal("Liv_Bud_ItemID"))) { oLivelihoodRestBudgetBO.Liv_Bud_ItemID = Convert.ToInt32(reader.GetValue(reader.GetOrdinal("Liv_Bud_ItemID"))); } if (ColumnExists(reader, "Liv_Bud_CategoryName") && !reader.IsDBNull(reader.GetOrdinal("Liv_Bud_CategoryName"))) { oLivelihoodRestBudgetBO.Liv_Bud_CategoryName = reader.GetString(reader.GetOrdinal("Liv_Bud_CategoryName")); } if (ColumnExists(reader, "Liv_Bud_ItemName") && !reader.IsDBNull(reader.GetOrdinal("Liv_Bud_ItemName"))) { oLivelihoodRestBudgetBO.Liv_Bud_ItemName = reader.GetString(reader.GetOrdinal("Liv_Bud_ItemName")); } if (ColumnExists(reader, "NoOfBeneficial") && !reader.IsDBNull(reader.GetOrdinal("NoOfBeneficial"))) { oLivelihoodRestBudgetBO.NoOfBeneficial = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("NoOfBeneficial"))); } if (ColumnExists(reader, "Comments") && !reader.IsDBNull(reader.GetOrdinal("Comments"))) { oLivelihoodRestBudgetBO.Comments = reader.GetString(reader.GetOrdinal("Comments")); } if (ColumnExists(reader, "ItemQuantity") && !reader.IsDBNull(reader.GetOrdinal("ItemQuantity"))) { oLivelihoodRestBudgetBO.ItemQuantity = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("ItemQuantity"))); } if (ColumnExists(reader, "TotalAmount") && !reader.IsDBNull(reader.GetOrdinal("TotalAmount"))) { oLivelihoodRestBudgetBO.TotalAmount = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("TotalAmount"))); } if (ColumnExists(reader, "CostPerUnit") && !reader.IsDBNull(reader.GetOrdinal("CostPerUnit"))) { oLivelihoodRestBudgetBO.CostPerUnit = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("CostPerUnit"))); } if (ColumnExists(reader, "ImplCost") && !reader.IsDBNull(reader.GetOrdinal("ImplCost"))) { oLivelihoodRestBudgetBO.ImplCost = reader.GetString(reader.GetOrdinal("ImplCost")); } if (ColumnExists(reader, "OperCost") && !reader.IsDBNull(reader.GetOrdinal("OperCost"))) { oLivelihoodRestBudgetBO.OperCost = reader.GetString(reader.GetOrdinal("OperCost")); } if (ColumnExists(reader, "ExternalMonitory") && !reader.IsDBNull(reader.GetOrdinal("ExternalMonitory"))) { oLivelihoodRestBudgetBO.ExternalMonitory = reader.GetString(reader.GetOrdinal("ExternalMonitory")); } if (ColumnExists(reader, "County") && !reader.IsDBNull(reader.GetOrdinal("County"))) { oLivelihoodRestBudgetBO.County = reader.GetString(reader.GetOrdinal("County")); } if (ColumnExists(reader, "SubCounty") && !reader.IsDBNull(reader.GetOrdinal("SubCounty"))) { oLivelihoodRestBudgetBO.SubCounty = reader.GetString(reader.GetOrdinal("SubCounty")); } if (ColumnExists(reader, "District") && !reader.IsDBNull(reader.GetOrdinal("District"))) { oLivelihoodRestBudgetBO.District = reader.GetString(reader.GetOrdinal("District")); } if (ColumnExists(reader, "Parish") && !reader.IsDBNull(reader.GetOrdinal("Parish"))) { oLivelihoodRestBudgetBO.Parish = reader.GetString(reader.GetOrdinal("Parish")); } return(oLivelihoodRestBudgetBO); }