/// <summary> /// To Get Reason For Finance ID /// </summary> /// <param name="ReasonForFinanceID"></param> /// <returns></returns> public ReasonforFinancingBO GetReasonForFinanceID(int ReasonForFinanceID) { OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString); OracleCommand cmd; string proc = "USP_MST_GETDETAIL_REASN_FIN"; cmd = new OracleCommand(proc, cnn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("F_FINANCEREASONID", ReasonForFinanceID); cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output; cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); ReasonforFinancingBO Boobj = null; ReasonforFinancingList Listobj = new ReasonforFinancingList(); Boobj = new ReasonforFinancingBO(); while (dr.Read()) { if (!dr.IsDBNull(dr.GetOrdinal("FINANCEREASON"))) { Boobj.FINANCEREASON = dr.GetString(dr.GetOrdinal("FINANCEREASON")); } if (!dr.IsDBNull(dr.GetOrdinal("FINANCEREASONID"))) { Boobj.FINANCEREASONID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("FINANCEREASONID"))); } } dr.Close(); return(Boobj); }
/// <summary> /// To Get All Reason For Finance /// </summary> /// <param name="financereason"></param> /// <returns></returns> public ReasonforFinancingList GetAllReasonForFinance(string financereason) { OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString); OracleCommand cmd; string proc = " USP_MST_GET_ALL_FIN_REASON "; cmd = new OracleCommand(proc, cnn); cmd.CommandType = CommandType.StoredProcedure; if (financereason.ToString() == "") { cmd.Parameters.Add("@FINANCEREASON_", DBNull.Value); } else { cmd.Parameters.Add("@FINANCEREASON_", financereason.ToString()); } cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output; cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); ReasonforFinancingBO Boobj = null; ReasonforFinancingList Listobj = new ReasonforFinancingList(); while (dr.Read()) { Boobj = new ReasonforFinancingBO(); if (!dr.IsDBNull(dr.GetOrdinal("FINANCEREASONID"))) { Boobj.FINANCEREASONID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("FINANCEREASONID"))); } if (!dr.IsDBNull(dr.GetOrdinal("FINANCEREASON"))) { Boobj.FINANCEREASON = dr.GetString(dr.GetOrdinal("FINANCEREASON")); } if (!dr.IsDBNull(dr.GetOrdinal("ISDELETED"))) { Boobj.ISDELETED = dr.GetString(dr.GetOrdinal("ISDELETED")); } Listobj.Add(Boobj); } dr.Close(); return(Listobj); }