コード例 #1
0
        /// <summary>
        /// Returns the GSD2 C3 record
        /// </summary>
        /// <exception cref="ConfigurationErrorsException">A configuration file could not be loaded.</exception>
        /// <exception cref="ArgumentNullException"><paramref>
        ///     <name>key</name>
        ///   </paramref>
        ///   is null. </exception>
        /// <exception cref="NotSupportedException">The property is set and the <see cref="T:System.Collections.Hashtable" />
        /// is read-only.-or- The property is set, <paramref>
        ///     <name>key</name>
        ///   </paramref>
        ///   does not exist in the collection, and the
        /// <see cref="T:System.Collections.Hashtable" /> has a fixed size. </exception>
        /// <exception cref="FormatException"><paramref>
        ///     <name>s</name>
        ///   </paramref>
        ///   is not in the correct format. </exception>
        /// <exception cref="OverflowException"><paramref>
        ///     <name>s</name>
        ///   </paramref>
        ///   represents a number less than <see cref="F:System.Int32.MinValue" /> or greater than <see cref="F:System.Int32.MaxValue" />. </exception>
        public static DataTable GSD2_DELIVERYPOINT(string tspNo, string startDte, string endDte, string ctr_no)
        {
            var procName = ConfigUtil.GetStoredProcedureName("GSD2_DELIVERYPOINT");

            var oracleParams = new OracleParameter[5];

            oracleParams[0] = new OracleParameter("i_tsp_no", OracleDbType.Int32, ParameterDirection.Input)
            {
                Value = int.Parse(tspNo)
            };
            oracleParams[1] = new OracleParameter("i_start_dte", OracleDbType.Date, ParameterDirection.Input)
            {
                Value = startDte
            };
            oracleParams[2] = new OracleParameter("i_end_dte", OracleDbType.Date, ParameterDirection.Input)
            {
                Value = endDte
            };
            oracleParams[3] = new OracleParameter("i_ctr_no", OracleDbType.Varchar2, ParameterDirection.Input)
            {
                Value = ctr_no
            };
            //oracleParams[3] = new OracleParameter("row_id", OracleDbType.Int32, ParameterDirection.Input) {
            //  Value = rowId
            //};
            oracleParams[4] = new OracleParameter("o_cursor", OracleDbType.RefCursor, ParameterDirection.Output);

            var dt = OracleUtil.ExecuteOracleReader(procName, oracleParams, CommandType.StoredProcedure);

            return(dt);
        }
コード例 #2
0
        /// <summary>
        /// This Method gets Operationally Available Capacity data in a Dataset.
        /// </summary>
        /// <param name="startDate">Starting Date</param>
        /// <param name="envAndPipe">TSP Number</param>
        /// <returns>DataSet</returns>
        /// <exception cref="OracleException">Condition.</exception>
        /// <exception cref="InvalidOperationException">Condition.</exception>
        /// <exception cref="ArgumentException">The value was not a valid <see cref="T:System.Data.CommandType" />. </exception>
        public static DataTable GetOperationallyAvailableData(string envAndPipe, DateTime startDateValue, DateTime endDateValue)
        {
            //  Check that the difference between start and end dates is less than 3 years (1096 days)
            //  The website restricts users' date selection.  But if a hacker finds a way to bypass the restriction,
            //  then return an empty table without throwing any exceptions.
            if (((endDateValue - startDateValue).Days > 1096) || (startDateValue > endDateValue))
            {
                return(new DataTable());
            }

            // append end of day hour, minute, and second to the end date value
            string modifiedEndDate = string.Format("{0:MM/dd/yyyy}", endDateValue) + " 23:59:59";

            endDateValue = Convert.ToDateTime(modifiedEndDate);

            string procName = "CNSS.WEBIP_CAPACITY.GET_OPERAVAIL_BYDATES";

            var oracleParams = new OracleParameter[3];

            oracleParams[0] = new OracleParameter("StartDate", OracleDbType.Date, ParameterDirection.Input)
            {
                Value = startDateValue
            };
            oracleParams[1] = new OracleParameter("EndDate", OracleDbType.Date, ParameterDirection.Input)
            {
                Value = endDateValue
            };

            oracleParams[2] = new OracleParameter("io_cursor", OracleDbType.RefCursor, ParameterDirection.Output);

            var dt = OracleUtil.ExecuteOracleReader(envAndPipe, procName, oracleParams, CommandType.StoredProcedure);

            return(dt);
        }
コード例 #3
0
        /// <summary>
        /// Returns the file terminator record common to each report data set
        /// </summary>
        /// <exception cref="ConfigurationErrorsException">A configuration file could not be loaded.</exception>
        /// <exception cref="ArgumentNullException"><paramref>
        ///     <name>key</name>
        ///   </paramref>
        ///   is null. </exception>
        /// <exception cref="NotSupportedException">The property is set and the <see cref="T:System.Collections.Hashtable" />
        /// is read-only.-or- The property is set, <paramref>
        ///     <name>key</name>
        ///   </paramref>
        ///   does not exist in the collection, and the
        /// <see cref="T:System.Collections.Hashtable" /> has a fixed size. </exception>
        public static DataTable FILE_TERMINATOR(int recordCount)
        {
            var procName = ConfigUtil.GetStoredProcedureName("FILE_TERMINATOR");

            var oracleParams = new OracleParameter[2];

            oracleParams[0] = new OracleParameter("i_record_count", OracleDbType.Int32, ParameterDirection.Input)
            {
                Value = recordCount
            };
            oracleParams[1] = new OracleParameter("o_cursor", OracleDbType.RefCursor, ParameterDirection.Output);

            var dt = OracleUtil.ExecuteOracleReader(procName, oracleParams, CommandType.StoredProcedure);

            return(dt);
        }
コード例 #4
0
        // public methods...
        /// <summary>
        /// Returns the Authorizing Agent record common to each report data set
        /// </summary>
        /// <exception cref="ConfigurationErrorsException">A configuration file could not be loaded.</exception>
        /// <exception cref="ArgumentNullException"><paramref>
        ///     <name>key</name>
        ///   </paramref>
        ///   is null. </exception>
        /// <exception cref="NotSupportedException">The property is set and the <see cref="T:System.Collections.Hashtable" />
        /// is read-only.-or- The property is set, <paramref>
        ///     <name>key</name>
        ///   </paramref>
        ///   does not exist in the collection, and the
        /// <see cref="T:System.Collections.Hashtable" /> has a fixed size. </exception>
        public static DataTable AUTHORIZING_AGENT(string fileType, string tspNo)
        {
            var procName = ConfigUtil.GetStoredProcedureName("AUTHORIZING_AGENT");

            var oracleParams = new OracleParameter[3];

            oracleParams[0] = new OracleParameter("i_file_type", OracleDbType.Varchar2, ParameterDirection.Input)
            {
                Value = fileType
            };
            oracleParams[1] = new OracleParameter("i_tsp_no", OracleDbType.Int32, ParameterDirection.Input)
            {
                Value = tspNo
            };
            oracleParams[2] = new OracleParameter("o_cursor", OracleDbType.RefCursor, ParameterDirection.Output);

            var dt = OracleUtil.ExecuteOracleReader(procName, oracleParams, CommandType.StoredProcedure);

            return(dt);
        }
コード例 #5
0
        /// <summary>
        /// Returns the TAR4 A1 record
        /// </summary>
        /// <exception cref="ConfigurationErrorsException">A configuration file could not be loaded.</exception>
        /// <exception cref="ArgumentNullException"><paramref>
        ///     <name>key</name>
        ///   </paramref>
        ///   is null. </exception>
        /// <exception cref="NotSupportedException">The property is set and the <see cref="T:System.Collections.Hashtable" />
        /// is read-only.-or- The property is set, <paramref>
        ///     <name>key</name>
        ///   </paramref>
        ///   does not exist in the collection, and the
        /// <see cref="T:System.Collections.Hashtable" /> has a fixed size. </exception>
        /// <exception cref="FormatException"><paramref>
        ///     <name>s</name>
        ///   </paramref>
        ///   is not in the correct format. </exception>
        /// <exception cref="OverflowException"><paramref>
        ///     <name>s</name>
        ///   </paramref>
        ///   represents a number less than <see cref="F:System.Int32.MinValue" /> or greater than <see cref="F:System.Int32.MaxValue" />. </exception>
        public static DataTable TAR4_DATAPOINT(string tspNo, string startDte, string endDte)
        {
            var procName = ConfigUtil.GetStoredProcedureName("TAR4_DATAPOINT");

            var oracleParams = new OracleParameter[4];

            oracleParams[0] = new OracleParameter("i_tsp_no", OracleDbType.Int32, ParameterDirection.Input)
            {
                Value = int.Parse(tspNo)
            };
            oracleParams[1] = new OracleParameter("i_start_dte", OracleDbType.Date, ParameterDirection.Input)
            {
                Value = startDte
            };
            oracleParams[2] = new OracleParameter("i_end_dte", OracleDbType.Date, ParameterDirection.Input)
            {
                Value = endDte
            };
            oracleParams[3] = new OracleParameter("o_cursor", OracleDbType.RefCursor, ParameterDirection.Output);

            var dt = OracleUtil.ExecuteOracleReader(procName, oracleParams, CommandType.StoredProcedure);

            return(dt);
        }