public void AddToDatabase()
        {
            var wms = new WMSEntities();

            var HO = new HOST_ORDERS()
            {
                EIS_ORDER_ID              = EisOrderId,
                STATUS                    = status,
                TYPE                      = Type,
                ORDER_DATE                = OrderDate,
                CUSTOMER_ID               = CustomerID,
                NAME                      = Name,
                ADDRESS_1                 = Address1,
                ADDRESS_2                 = Address2,
                ADDRESS_3                 = Address3,
                CITY                      = City,
                STATE                     = State,
                ZIP                       = Zip,
                PHONE                     = Phone,
                PURCHASE_ORDER            = PurchasOrder,
                ORIGINAL_SHIP_MODE        = OrigionalShipMode,
                TERMS                     = Terms,
                COD_INDICATOR             = CODIndicator,
                EST_NUM_BOXES             = EstNumBoxes,
                CARRIER_ID                = CarrierID,
                FREIGHT                   = Freight,
                DEPOSIT_AMOUNT            = DepositAmount,
                FREIGHT_BILLING_OPTION    = FreightBIllingOptions,
                EXPEDITE_IND              = ExpediteIndicator,
                NOTES                     = Notes,
                IMPORT_TIME               = ImportTime,
                FREIGHT_BILL_TO_ACCOUNT   = FreightBillToAccount,
                FREIGHT_BILL_TO_NAME      = FreightBillToName,
                FREIGHT_BILL_TO_ADDRESS_1 = FreightBillToAddress1,
                FREIGHT_BILL_TO_ADDRESS_2 = FreightBillToAddress2,
                FREIGHT_BILL_TO_ADDRESS_3 = FreightBillToAddress3,
                FREIGHT_BILL_TO_CITY      = FreightBillToCity,
                FREIGHT_BILL_TO_STATE     = FreightBillToState,
                FREIGHT_BILL_TO_ZIP       = FreightBillToZip,
                C_LAST_UPDATED_           = LastUpdated,
                C_LAST_USER_              = LastUser,
                C_LAST_MODULE_            = LastModule,
                QC_CODES                  = QcCodes,
                DELIVER_BY_DATE           = DeliverByDate,
                QC_REQUIRED               = QcRequired,
                EXTERNAL_CARTONIZED       = ExternalCartonized,
                FIRSTBOXSHIPPED           = FirstBoxShipped
            };

            wms.HOST_ORDERS.Add(HO);
            wms.SaveChanges();
        }
        internal void UpdateLastUpdates()
        {
            {
                LastUpdated = DateTime.Now;
                using (WMSEntities wms = new WMSEntities())
                {
                    IQueryable <HOST_ORDERS> Data = from HO in wms.HOST_ORDERS
                                                    where
                                                    HO.EIS_ORDER_ID == EisOrderId
                                                    select HO;

                    foreach (HOST_ORDERS HOData in Data)
                    {
                        HOData.C_LAST_UPDATED_ = LastUpdated;
                    }
                    wms.SaveChanges();
                }
            }
        }
        internal void UpdateLastUser(string Value)
        {
            if (LastUser != Value)
            {
                LastUser = Value;
                using (WMSEntities wms = new WMSEntities())
                {
                    IQueryable <HOST_ORDERS> Data = from HO in wms.HOST_ORDERS
                                                    where
                                                    HO.EIS_ORDER_ID == EisOrderId
                                                    select HO;

                    foreach (HOST_ORDERS HOData in Data)
                    {
                        HOData.C_LAST_USER_ = Value;
                    }
                    wms.SaveChanges();
                }
            }
        }
        internal void UpdateStatus(string Value)
        {
            if (status != Value)
            {
                status = Value;
                using (WMSEntities wms = new WMSEntities())
                {
                    IQueryable <HOST_ORDERS> Data = from HO in wms.HOST_ORDERS
                                                    where
                                                    HO.EIS_ORDER_ID == EisOrderId
                                                    select HO;

                    foreach (HOST_ORDERS HOData in Data)
                    {
                        HOData.STATUS = Value;
                    }
                    wms.SaveChanges();
                }
            }
        }
示例#5
0
        public void AddToDatabase()
        {
            var wms = new WMSEntities();
            var HOD = new HOST_ORDER_DETAIL
            {
                EIS_ORDER_ID      = EISOrderID,
                EIS_ORDER_LINE    = EISOrderLine,
                TYPE              = Type,
                PRODUCT_ID        = ProductID,
                QC_CATEGORY       = QCCategory,
                ORDERED_UNITS     = OrderedUnits,
                UOM               = UnitOfMesure,
                SCHEDULED_DATE    = ScheduledDate,
                NOTES             = Notes,
                EIS_ORDLINE_PRICE = EISOrderLinePrice,
                EIS_UNIT_PRICE    = EISUnitPrice,
                C_LAST_UPDATED_   = LastUpdated,
                C_LAST_USER_      = LastUser,
                C_LAST_MODULE_    = LastModule
            };

            wms.HOST_ORDER_DETAIL.Add(HOD);
            wms.SaveChanges();
        }