/// <summary> /// To Get Nature Finance ID /// </summary> /// <param name="NatureFinanceID"></param> /// <returns></returns> public NatureofFinancingBO GetNatureFinanceID(int NatureFinanceID) { OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString); OracleCommand cmd; string proc = "USP_MST_GET_NATUR_FIN"; cmd = new OracleCommand(proc, cnn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("F_FINANCENATUREID", NatureFinanceID); cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output; cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); NatureofFinancingBO Boobj = null; NatureofFinancingList Listobj = new NatureofFinancingList(); Boobj = new NatureofFinancingBO(); while (dr.Read()) { if (!dr.IsDBNull(dr.GetOrdinal("FINANCENATURE"))) { Boobj.FINANCENATURE = dr.GetString(dr.GetOrdinal("FINANCENATURE")); } if (!dr.IsDBNull(dr.GetOrdinal("FINANCENATUREID"))) { Boobj.FINANCENATUREID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("FINANCENATUREID"))); } } dr.Close(); return(Boobj); }
/// <summary> /// To Get All Nature Finance /// </summary> /// <param name="financeNature"></param> /// <returns></returns> public NatureofFinancingList GetnatureAllfinance(string financeNature) { OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString); OracleCommand cmd; string proc = "USP_MST_GETALL_FIN_NATURE"; cmd = new OracleCommand(proc, cnn); cmd.CommandType = CommandType.StoredProcedure; if (financeNature.ToString() == "") { cmd.Parameters.Add("@FINANCENATURE_", DBNull.Value); } else { cmd.Parameters.Add("@FINANCENATURE_", financeNature.ToString()); } cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output; cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); NatureofFinancingBO Boobj = null; NatureofFinancingList Listobj = new NatureofFinancingList(); while (dr.Read()) { Boobj = new NatureofFinancingBO(); if (!dr.IsDBNull(dr.GetOrdinal("FINANCENATUREID"))) { Boobj.FINANCENATUREID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("FINANCENATUREID"))); } if (!dr.IsDBNull(dr.GetOrdinal("FINANCENATURE"))) { Boobj.FINANCENATURE = dr.GetString(dr.GetOrdinal("FINANCENATURE")); } if (!dr.IsDBNull(dr.GetOrdinal("ISDELETED"))) { Boobj.ISDELETED = dr.GetString(dr.GetOrdinal("ISDELETED")); } Listobj.Add(Boobj); } dr.Close(); return(Listobj); }