예제 #1
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);
        }
예제 #3
0
        public ChangesetDateGroup GetRecords()
        {
            string strTSQL = "SELECT MAX(OPE_LAST_MODIFY_DATE) AS MAX_OPE_LAST_MODIFY_DATE, MAX(PL_LAST_MODIFY_DATE) AS MAX_PL_LAST_MODIFY_DATE, MAX(PS_LAST_MODIFY_DATE) as MAX_PS_LAST_MODIFY_DATE FROM tblOrderAddress";


            DataTable objDataTable = Get(strTSQL);

            return(DBUtil.DataTableToObject <ChangesetDateGroup>(objDataTable));
        }
        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);
        }