public static List <USER_ARGUMENTS> SelectUserArgs(string packname, string procname) { OracleParameter param; OracleConnection conn = DBConnection.Instance.GetConnection(); OracleCommand command = conn.CreateCommand(); command.CommandText = ORALCE_PACKAGE_SYSTEM + "." + ORALCE_PRS_USERARGS; command.CommandType = CommandType.StoredProcedure; //Log.Instance.writeLog("Line 178-Connection State:" + command.Connection.State.ToString()); param = new OracleParameter(); param.ParameterName = ORALCE_PRS_USERARGS_ARG1; param.OracleDbType = OracleDbType.NVarchar2; param.Value = packname; param.Direction = ParameterDirection.Input; command.Parameters.Add(param); param = new OracleParameter(); param.ParameterName = ORALCE_PRS_USERARGS_ARG2; param.OracleDbType = OracleDbType.NVarchar2; param.Value = procname; param.Direction = ParameterDirection.Input; command.Parameters.Add(param); param = new OracleParameter(); param.ParameterName = ORALCE_PRS_USERARGS_ARG3; param.OracleDbType = OracleDbType.RefCursor; param.Direction = ParameterDirection.Output; command.Parameters.Add(param); return(DalUtility.LoadObjectListFromDatabase <USER_ARGUMENTS>(command)); }
public static List <T> ExcuteSelectMultiObject <T>(string packname, string procname, Object parameter) where T : new() { try { List <USER_ARGUMENTS> lstUserArg = DalUtility.SelectUserArgs(packname, procname); OracleConnection conn = DBConnection.Instance.GetConnection(); OracleCommand command = conn.CreateCommand(); if (!string.IsNullOrEmpty(packname)) { command.CommandText = packname + "." + procname; } else { command.CommandText = procname; } command.CommandType = CommandType.StoredProcedure; command.BindByName = true; DalUtility.LoadParametersFromObject(command, parameter, lstUserArg); return(DalUtility.LoadObjectListFromDatabase <T>(command)); } catch (Exception ex) { DBConnection.Instance.Close(); Util.Log.Instance.WriteExceptionLog(ex, "ExcuteSelectMultiObject"); return(new List <T>()); } }