public List <APICallLogItem> GetByFK(int intOrderAdddressID, out string LastError)
        {
            List <APICallLogItem> lstOrderAddress = null;

            LastError = String.Empty;

            try
            {
                if (intOrderAdddressID == 0)
                {
                    LastError = "The value supplied for 'intOrderAdddressID' cannot be zero and must be a valid integer that corresponds to an existing record";
                    return(null);
                }

                SqlCommand objQuery = new SqlCommand();
                objQuery.CommandText = "tblAPICallLogItem_SelByFK_OrderAddressID_EQ";
                objQuery.CommandType = CommandType.StoredProcedure;

                // Add the parameter to the Parameters collection.
                objQuery.Parameters.Add(new SqlParameter("OrderAddressID", (object)intOrderAdddressID ?? String.Empty));


                lstOrderAddress = DBUtil.DataTableToList <APICallLogItem>(SqlServerDataAccess.Execute(objQuery));
            }
            catch (System.Data.SqlClient.SqlException exSql)
            {
                LastError = String.Concat("", exSql.Message, exSql.Number, null);
            }
            catch (Exception ex)
            {
                LastError = String.Concat("", ex.Message, null);
            }

            return(lstOrderAddress);
        }
        public List <APICallLogItem> Get(DateTime dteDateCreated_GToEQ, out string LastError)
        {
            List <APICallLogItem> lstAPICallLogItems = null;

            LastError = String.Empty;

            try
            {
                SqlCommand objQuery = new SqlCommand();
                objQuery.CommandText = "tblAPICallLogItem_SelBy_DateCreated_GToEQ";
                objQuery.CommandType = CommandType.StoredProcedure;

                // Add the parameter to the Parameters collection.
                objQuery.Parameters.Add(new SqlParameter("DateCreated", dteDateCreated_GToEQ));

                lstAPICallLogItems = DBUtil.DataTableToList <APICallLogItem>(SqlServerDataAccess.Execute(objQuery));
            }
            catch (System.Data.SqlClient.SqlException exSql)
            {
                LastError = String.Concat("", exSql.Message, exSql.Number, null);
            }
            catch (Exception ex)
            {
                LastError = String.Concat("", ex.Message, null);
            }

            return(lstAPICallLogItems);
        }
Exemple #3
0
        public List <SystemConfigItem> GetAllSystemConfigItems(out string LastError)
        {
            List <SystemConfigItem> lstSystemConfigItems = null;

            LastError = String.Empty;

            try
            {
                SqlCommand objQuery = new SqlCommand();
                objQuery.CommandText = "tblSystemConfigItem_SelAll";
                objQuery.CommandType = CommandType.StoredProcedure;

                lstSystemConfigItems = DBUtil.DataTableToList <SystemConfigItem>(SqlServerDataAccess.Execute(objQuery));
            }
            catch (System.Data.SqlClient.SqlException exSql)
            {
                LastError = String.Concat("", exSql.Message, exSql.Number, null);
            }
            catch (Exception ex)
            {
                LastError = String.Concat("", ex.Message, null);
            }

            return(lstSystemConfigItems);
        }
        public List <OrderSystemOfRecord> GetAllRecords(out string LastError)
        {
            List <OrderSystemOfRecord> lstMigrationStatuses = null;

            LastError = String.Empty;

            try
            {
                SqlCommand objQuery = new SqlCommand();
                objQuery.CommandText = "tblOrderSystemOfRecord_SelAll";

                objQuery.CommandType = CommandType.StoredProcedure;
                lstMigrationStatuses = DBUtil.DataTableToList <OrderSystemOfRecord>(SqlServerDataAccess.Execute(objQuery));
            }
            catch (System.Data.SqlClient.SqlException exSql)
            {
                LastError = String.Concat("", exSql.Message, exSql.Number, null);
            }
            catch (Exception ex)
            {
                LastError = String.Concat("", ex.Message, null);
            }

            return(lstMigrationStatuses);
        }
Exemple #5
0
        public SystemConfigItem Get(int intSystemConfigItemID, out string LastError)
        {
            SystemConfigItem objSystemConfigItems = null;

            LastError = String.Empty;

            try
            {
                SqlCommand objQuery = new SqlCommand();
                objQuery.CommandText = "tblSystemConfigItem_SelByIDENT_SystemConfigItemID_EQ";
                objQuery.CommandType = CommandType.StoredProcedure;

                // Add the parameter to the Parameters collection.
                objQuery.Parameters.Add(new SqlParameter("SystemConfigItemID", intSystemConfigItemID));

                objSystemConfigItems = DBUtil.DataTableToObject <SystemConfigItem>(SqlServerDataAccess.Execute(objQuery));
            }
            catch (System.Data.SqlClient.SqlException exSql)
            {
                LastError = String.Concat("", exSql.Message, exSql.Number, null);
            }
            catch (Exception ex)
            {
                LastError = String.Concat("", ex.Message, null);
            }

            return(objSystemConfigItems);
        }
        public MigrationStatus GetByPK(int intMigrationStatusID, out string LastError)
        {
            MigrationStatus objMigrationStatus = null;

            LastError = String.Empty;

            try
            {
                if (intMigrationStatusID == 0)
                {
                    LastError = "The identity value supplied for the records PK cannot be zero and must be a valid integer --> MigrationStatusID";
                    return(null);
                }

                SqlCommand objQuery = new SqlCommand();
                objQuery.CommandText = "tblMigrationStatus_SelByPK_MigrationStatusID_EQ";
                objQuery.CommandType = CommandType.StoredProcedure;

                // Add the parameter to the Parameters collection.
                objQuery.Parameters.Add(new SqlParameter("MigrationStatusID", intMigrationStatusID));

                objMigrationStatus = DBUtil.DataTableToObject <MigrationStatus>(SqlServerDataAccess.Execute(objQuery));
            }
            catch (System.Data.SqlClient.SqlException exSql)
            {
                LastError = String.Concat("", exSql.Message, exSql.Number, null);
            }
            catch (Exception ex)
            {
                LastError = String.Concat("", ex.Message, null);
            }

            return(objMigrationStatus);
        }
        public List <OrderAddress> Search(string strWhereClause, string strOrderByClause, out string LastError, int?intPageNumber = null, int?intPageSize = null)
        {
            List <OrderAddress> lstOrderAddress = new List <OrderAddress>();

            LastError = String.Empty;

            try
            {
                SqlCommand objQuery = new SqlCommand();
                objQuery.CommandText = "tblOrderAddress_SelByDyn_H1_Custom";

                objQuery.CommandType = CommandType.StoredProcedure;

                // Add the parameter to the Parameters collection.
                objQuery.Parameters.Add(new SqlParameter("DynamicWhereClause", strWhereClause));
                objQuery.Parameters.Add(new SqlParameter("DynamicOrderByClause", strOrderByClause));
                objQuery.Parameters.Add(new SqlParameter("RowsPerPage", intPageSize ?? 100000));
                objQuery.Parameters.Add(new SqlParameter("PageNumber", intPageNumber ?? 1));

                lstOrderAddress = DBUtil.DataTableToList <OrderAddress>(SqlServerDataAccess.Execute(objQuery));
            }
            catch (System.Data.SqlClient.SqlException exSql)
            {
                LastError = String.Concat("", exSql.Message, exSql.Number, null);
            }
            catch (Exception ex)
            {
                LastError = String.Concat("", ex.Message, null);
            }

            return(lstOrderAddress);
        }
Exemple #8
0
        private DataTable Get(string strTSQL)
        {
            try
            {
                _objLogger.Debug(String.Concat("About to execute query --> [", strTSQL, "]"));

                DataTable dt = SqlServerDataAccess.Execute
                                   (strTSQL
                                   , CommandType.Text
                                   );
                return(dt);
            }
            catch (Exception ex)
            {
                _objLogger.Warn(String.Concat("Query Execution Failed --> [", strTSQL, "]"));
                throw new ArgumentException(String.Format("DataAccess error: {0}", ex.Message));
            }
        }
        public OrderAddress Get(int intOrderSystemOfRecordID, string strCDWCustomerOrderNumber, string strCDWAddressOne, string strCDWCity, string strCDWState, string strCDWPostalCode, string strCDWCountry, string strCDWFloor, string strCDWRoom, string strCDWSuite, out string LastError)
        {
            OrderAddress objOrderAddress = null;

            LastError = String.Empty;

            try
            {
                if (intOrderSystemOfRecordID == 0)
                {
                    LastError = "The value supplied for 'intOrderSystemOfRecordID' cannot be zero and must be a valid integer that corresponds to an enum";
                    return(null);
                }

                SqlCommand objQuery = new SqlCommand();
                objQuery.CommandText = "tblOrderAddress_SelBy_OrderSystemOfRecordID_EQ_CDWCustomerOrderNumber_EQ_CDWAddressOne_EQ_CDWCity_EQ_CDWState_EQ_C_TRUNC";
                objQuery.CommandType = CommandType.StoredProcedure;

                // Add the parameter to the Parameters collection.
                objQuery.Parameters.Add(new SqlParameter("OrderSystemOfRecordID", (object)intOrderSystemOfRecordID ?? String.Empty));
                objQuery.Parameters.Add(new SqlParameter("CDWCustomerOrderNumber", (object)strCDWCustomerOrderNumber ?? String.Empty));
                objQuery.Parameters.Add(new SqlParameter("CDWAddressOne", (object)strCDWAddressOne ?? String.Empty));
                objQuery.Parameters.Add(new SqlParameter("CDWCity", (object)strCDWCity ?? String.Empty));
                objQuery.Parameters.Add(new SqlParameter("CDWState", (object)strCDWState ?? String.Empty));
                objQuery.Parameters.Add(new SqlParameter("CDWPostalCode", (object)strCDWPostalCode ?? String.Empty));
                objQuery.Parameters.Add(new SqlParameter("CDWCountry", (object)strCDWCountry ?? String.Empty));
                objQuery.Parameters.Add(new SqlParameter("CDWFloor", (object)strCDWFloor ?? String.Empty));
                objQuery.Parameters.Add(new SqlParameter("CDWRoom", (object)strCDWRoom ?? String.Empty));
                objQuery.Parameters.Add(new SqlParameter("CDWSuite", (object)strCDWSuite ?? String.Empty));

                objOrderAddress = DBUtil.DataTableToObject <OrderAddress>(SqlServerDataAccess.Execute(objQuery));
            }
            catch (System.Data.SqlClient.SqlException exSql)
            {
                LastError = String.Concat("", exSql.Message, exSql.Number, null);
            }
            catch (Exception ex)
            {
                LastError = String.Concat("", ex.Message, null);
            }

            return(objOrderAddress);
        }