Esempio n. 1
0
        private int GetThreads()
        {
            try
            {
                int threads = -1;
                using (WMSEntities wms = new WMSEntities())
                {
                    IQueryable <SYSTEM> Data = from s in wms.SYSTEMs where s.NAME == "Cartonize_threads" select s;

                    foreach (SYSTEM x in Data)
                    {
                        threads = Convert.ToInt32(x.VALUE);
                    }
                }
                return(threads);
            }
            catch (Exception e)
            {
                Log.Write("Error in :" + System.Reflection.MethodBase.GetCurrentMethod().Name);
                Log.Write("Error Message: " + e.Message);
                Log.Write("Stack Trace: " + e.StackTrace);
                Log.Write("Target Site: " + e.TargetSite);
                Log.Write("Exiting Program");
                return(-1);
            }
        }
Esempio n. 2
0
 public CarrierTable(string ID)
 {
     using (WMSEntities wms = new WMSEntities())
     {
         IQueryable <CARRIER> Data = from Cr in wms.CARRIERS where Cr.CARRIER_ID == ID select Cr;
         foreach (CARRIER Carr in Data)
         {
             CarrierID       = Carr.CARRIER_ID;
             PoolPoint       = Carr.POOL_POINT;
             Name            = Carr.NAME;
             Address1        = Carr.ADDRESS_1;
             Address2        = Carr.ADDRESS_2;
             City            = Carr.CITY;
             State           = Carr.STATE;
             ZIP             = Carr.ZIP;
             ContactName     = Carr.CONTACT_NAME;
             ContactPhone    = Carr.CONTACT_PHONE;
             Comments1       = Carr.COMMENTS_1;
             Comments2       = Carr.COMMENTS_2;
             Comments3       = Carr.COMMENTS_3;
             Comments4       = Carr.COMMENTS_4;
             AccountNumber   = Carr.ACCOUNT_NUMBER;
             ICCNumber       = Carr.ACCOUNT_NUMBER;
             LastUpdated     = Carr.C_LAST_UPDATED_;
             LastUser        = Carr.C_LAST_USER_;
             LastModule      = Carr.C_LAST_MODULE_;
             CompanyName     = Carr.COMPANY_NAME;
             Type            = Carr.TYPE;
             ShipModeDefault = Carr.SHIP_MODE_DEFAULT;
         }
     }
 }
Esempio n. 3
0
 public MoveQueue(int InRID)
 {
     using (WMSEntities wms = new WMSEntities())
     {
         IQueryable <MOVE_QUEUE> Item = from MQ in wms.MOVE_QUEUE where MQ.C_RID_ == InRID select MQ;
         foreach (MOVE_QUEUE Move in Item)
         {
             RID          = Move.C_RID_;
             InvRID       = Move.INV_RID;
             MQType       = Move.TYPE;
             Priority     = Move.PRIORITY;
             CreateTime   = Move.CREATE_TIME;
             Status       = Move.STATUS;
             LabelLevel   = Move.LABELLEVEL;
             ToZone       = Move.TO_ZONE;
             ToLocation   = Move.TO_LOCATION;
             FromLocation = Move.FROM_LOCATION;
             OrigionalQuantityRequired = Move.ORIG_QUANTITY_REQUIRED;
             QuantityRequired          = Move.QUANTITY_REQUIRED;
             QuantityInTransit         = Move.QUANTITY_INTRANSIT;
             UserIdInTransit           = Move.USER_ID_INTRANSIT;
             VehicleInTranset          = Move.VEHICLE_INTRANSIT;
             shipmentID  = Move.SHIPMENT_ID;
             OrderNumber = Move.ORDER_NUMBER;
             OrderLine   = Move.ORDER_LINE;
             LastUpdated = Move.C_LAST_UPDATED_;
             LastModule  = Move.C_LAST_MODULE_;
             LastUser    = Move.C_LAST_USER_;
         }
     }
 }
Esempio n. 4
0
 public Locations(string PiecePickLocation)
 {
     using (WMSEntities wms = new WMSEntities())
     {
         IQueryable <LOCATION> Data = from LO in wms.LOCATIONS where LO.LOCATION_ID == PiecePickLocation select LO;
         foreach (LOCATION Dloc in Data)
         {
             LocationID      = Dloc.LOCATION_ID;
             LocationGroup   = Dloc.LOCATION_GROUP;
             EisLocation     = Dloc.EIS_LOCATION;
             PickSequence    = Dloc.PICK_SEQUENCE;
             Aisle           = Dloc.AISLE;
             Slot            = Dloc.SLOT;
             VLevel          = Dloc.VLEVEL;
             Bin             = Dloc.BIN;
             Status          = Dloc.STATUS;
             SiteID          = Dloc.SITE_ID;
             PickingZone     = Dloc.PICKING_ZONE;
             AllowPiecePick  = Dloc.ALLOWPIECEPICKING;
             Type            = Dloc.TYPE;
             Usage           = Dloc.USAGE;
             LastUpdated     = Dloc.C_LAST_UPDATED_;
             LastUser        = Dloc.C_LAST_USER_;
             LastModule      = Dloc.C_LAST_MODULE_;
             PutawaySequence = Dloc.PUTAWAY_SEQUENCE;
             ReverseSlot     = Dloc.REVERSE_SLOT;
         }
     }
 }
Esempio n. 5
0
        /**************************************************************************************
         * Function name:                   CreatePicks
         *
         * What this Function Does:         once the order is broken down, this function will look for the inventory to try and fill the order
         *
         * update needed:                  error handeling
         *
         * Variables passed in:             order- the order object
         *                                 orderType- the type of order we are processing
         *
         * Variables Declared :             AllocationStatus: the status of the order being allocated(   C:compleate
         *                                                                                              E:Error
         *                                                                                              R:Error
         *                                                                                              S:short)
         *                                 OrderCancelRequest- bool value to see if the order was canceled;
         *
         * returns :                        Nothing
         * **************************************************************************************/
        internal void CreatePicks(Order Orders, string orderType)
        {
            string allocationstatus;
            bool   OrderCancelRequest = false;

            allocationstatus = Orders.PiecePickCreation();

            Log.Write("ALLOCATION STATUS: " + allocationstatus);

            if ((allocationstatus == "E" || allocationstatus == "R") || (allocationstatus == "S"))
            {
                Log.Write("*********************************************************************************");
                Log.Write("COULD NOT ALLOCATE INVENTORY FOR ORDER " + Orders.OrderID + ".....ROLLING BACK");
                Log.Write("*********************************************************************************");

                Orders.RemoveAllocation(allocationstatus, Orders.OrderID);
                Orders.UpdateHostOrderStatus(allocationstatus, OrderCancelRequest, orderType);
            }
            else
            {
                using (WMSEntities wms = new WMSEntities())
                {
                    Log.Write("Sucessful Allocation");
                    if ((allocationstatus == "C"))
                    {
                        Orders.UpdateStatuses("N");
                        Orders.UpdateHostOrderStatus(allocationstatus, OrderCancelRequest, orderType);
                    }
                }
            }
        }
        internal void AddToDatabase()
        {
            var WMS = new WMSEntities();

            var OBSD = new OUTBOUND_SHIPMENT_DETAILS()
            {
                SHIPMENT_ID       = ShipmentID,
                ORDER_NUMBER      = OrderNumber,
                ORDER_LINE        = OrderLine,
                TYPE              = Type,
                UOM               = UnitOfMesure,
                QC_CATEGORY       = QCCategory,
                SHIPPED_UNITS     = ShippedUnits,
                C_LAST_UPDATED_   = LastUpdated,
                NOTES             = Notes,
                C_LAST_USER_      = LastUser,
                C_LAST_MODULE_    = LastModule,
                PRODUCT_ID        = ProductID,
                UOM_WEIGHT        = UOMWeight,
                UNIT_PRICE_EA     = UnitPriceEach,
                ORDERED_UNITS     = OrderedUnits,
                STATUS            = Status,
                ALLOCATION_STATUS = AllocationStatus,
                STAGED_UNITS      = StagedUnits
            };

            WMS.OUTBOUND_SHIPMENT_DETAILS.Add(OBSD);
            //Tim Uncomment
            WMS.SaveChanges();
            PrintOutboundShipmentDetail();
        }
Esempio n. 7
0
 private void AddToDataBase()
 {
     using (WMSEntities wms = new WMSEntities())
     {
         var Outbound = new AUDIT_OUTBOUND
         {
             C_RID_               = RID,
             TRANTYPE             = TranType,
             SUBTYPE              = SubType,
             TRANSACTION_TIME     = TransactionTime,
             APPOINTMENT_TIME     = AppointmentTime,
             APPOINTMENT_TIME_OLD = AppointmentTimeOld,
             DOOR_ID              = DoorID,
             DOOR_ID_OLD          = DoorIDOld,
             MADE_TIME            = MadeTime,
             MADE_TIME_OLD        = MadeTimeOld,
             DURATION             = duration,
             DURATION_OLD         = durationOld,
             CARRIER_ID           = CarrierID,
             CARRIER_ID_OLD       = CarrierIdOld,
             SHIPMENT_ID          = ShipmentID,
             SHIPMENT_ID_OLD      = ShipmentIDOld,
             ARRIVAL_TIME         = ArrivalTime,
             PICK_ASSIGNED_TIME   = PickAssignedTime,
             PICK_COMPLETE_TIME   = PickCompleateTIme,
             PICK_START_TIME      = PickStartTIme,
             DEPARTURE_TIME       = DepartureTime,
             EXPORTTIME_SYS1      = ExportTimeSys1,
             EXPORTLOADNUM_SYS1   = ExportLoadNumSys1,
             EXPORTTIME_SYS2      = ExportTimeSys2,
             EXPORTLOADNUM_SYS2   = ExportLoadNumSys2,
             EXPORTTIME_SYS3      = ExportTimeSys3,
             EXPORTLOADNUM_SYS3   = ExportLoadNumSys3,
             C_LAST_UPDATED_      = LastUpdated,
             C_LAST_USER_         = LastUser,
             C_LAST_MODULE_       = LastModule,
             ADDRESS_1            = Address1,
             ADDRESS_1_OLD        = Address1Old,
             ADDRESS_2            = Address2,
             ADDRESS_2_OLD        = Address2Old,
             CITY                    = City,
             CITY_OLD                = CityOld,
             STATE                   = State,
             STATE_OLD               = StateOld,
             ZIP                     = Zip,
             ZIP_OLD                 = ZipOld,
             PURCHASE_ORDER          = PurchasOrder,
             PURCHASE_ORDER_OLD      = PurchasOrderOld,
             PURCHASE_ORDER_DATE     = PurchasOrderDate,
             PURCHASE_ORDER_DATE_OLD = PurchasOrderDateOld,
             STATUS                  = Status,
             STATUS_OLD              = StatusOld,
             COMMENTS_1              = Comments1,
             EXPORTFDM4BATCH_SYS1    = ExportFDM4Batch
         };
         wms.AUDIT_OUTBOUND.Add(Outbound);
         // wms.SaveChanges();
     }
 }
Esempio n. 8
0
        internal void CreateMoveQueue(string CarrierID)
        {
            if (MQType != "REPLEN")
            {
                CarrierTable Carrier = new CarrierTable(CarrierID);
                if (Carrier.Type == "Parcel")
                {
                    ToLocation = "CONVEYOR";
                }
                else
                {
                    ToLocation = "SHIPSTAGE";
                }
            }
            if (CreateTime == Convert.ToDateTime("1/1/0001"))
            {
                CreateTime = DateTime.Now;
            }
            if (Status == null || Status == "")
            {
                Status = "N";
            }

            LastUpdated = DateTime.Now;
            LastUser    = Environment.MachineName;
            LastModule  = "CARTONIZE";
            RID         = GetNextRID("MOVE_QUEUE");

            var WMS = new WMSEntities();

            var MoveQ = new MOVE_QUEUE
            {
                C_RID_                 = RID,
                INV_RID                = InvRID,
                TYPE                   = MQType,
                SHIPMENT_ID            = shipmentID,
                ORDER_NUMBER           = OrderNumber,
                ORDER_LINE             = (short?)OrderLine,
                PRIORITY               = (short)Priority,
                CREATE_TIME            = CreateTime,
                STATUS                 = Status,
                TO_LOCATION            = ToLocation,
                FROM_LOCATION          = FromLocation,
                TO_ZONE                = ToZone,
                FROM_ZONE              = FromZone,
                ORIG_QUANTITY_REQUIRED = OrigionalQuantityRequired,
                QUANTITY_INTRANSIT     = QuantityInTransit,
                LABELLEVEL             = LabelLevel,
                C_LAST_UPDATED_        = LastUpdated,
                C_LAST_MODULE_         = LastModule,
                C_LAST_USER_           = LastUser
            };

            WMS.MOVE_QUEUE.Add(MoveQ);
            //Tim Uncomment
            WMS.SaveChanges();
            // PrintMoveQueue();
        }
        public ProductMaster(string InProductID)
        {
            using (WMSEntities wms = new WMSEntities())
            {
                IQueryable <PRODUCT_MASTER> Item = from PM in wms.PRODUCT_MASTER where PM.PRODUCT_ID == InProductID select PM;

                foreach (PRODUCT_MASTER PM in Item)
                {
                    ProductID              = PM.PRODUCT_ID;
                    EisProductID           = PM.EIS_PRODUCT_ID;
                    UpcCode                = PM.UPC_CODE;
                    VendorID               = PM.VENDOR_ID;
                    Description            = PM.DESCRIPTION;
                    ShortDescription       = PM.SHORT_DESCRIPTION;
                    BaseUom                = PM.BASE_UOM;
                    ProductionUom          = PM.PRODUCTION_UOM;
                    StockUom               = PM.STOCK_UOM;
                    RecivingUom            = PM.RECEIVING_UOM;
                    BaseUomPerCaseLevel    = PM.BASE_UOM_PER_CASELEVEL;
                    CaseLevelPerPallettote = PM.CASELEVEL_PER_PALLETTOTE;
                    CaseLevelPerContainer  = PM.CASELEVEL_PER_CONTAINER;
                    Location_group         = PM.LOCATION_GROUP;
                    PutAwayZone1           = PM.PUTAWAY_ZONE_1;
                    PutAwayZone2           = PM.PUTAWAY_ZONE_2;
                    PutAwayZone3           = PM.PUTAWAY_ZONE_3;
                    PickZone1              = PM.PICK_ZONE_1;
                    PickZone2              = PM.PICK_ZONE_2;
                    PickZone3              = PM.PICK_ZONE_3;
                    PiecePickLocation      = PM.PIECE_PICK_LOCATION;
                    CaseLevelPickLocation  = PM.CASELEVEL_PICK_LOCATION;
                    PallotePickLocation    = PM.PALLETTOTE_PICK_LOCATION;
                    ContainerPickLocation  = PM.CONTAINER_PICK_LOCATION;
                    BolCLass               = PM.BOL_CLASS;
                    ProductType            = PM.PRODUCT_TYPE;
                    InitQcCategory         = PM.INIT_QC_CATEGORY;
                    ShelfLife              = PM.SHELF_LIFE;
                    ShipByWindow           = PM.SHIP_BY_WINDOW;
                    ConsolidationWindow    = PM.CONSOLIDATION_WINDOW;
                    CaseLevelWeight        = PM.CASELEVEL_WEIGHT;
                    CubePerUom             = PM.CUBEPERUOM;
                    AutoRelease            = PM.AUTO_RELEASE;
                    EisAvgUnitCost         = PM.EIS_AVG_UNIT_COST;
                    EisSize                = PM.EIS_SIZE;
                    EisMillStyleNumber     = PM.EIS_MILL_STYLE_NUMBER;
                    EisPackageQty          = PM.EIS_PACKAGE_QTY;
                    EisQtyOnOrder          = PM.EIS_QTY_ONORDER;
                    EisQtyOnHand           = PM.EIS_QTY_ONHAND;
                    EisMillPurchasePrice   = PM.EIS_MILL_PURCHASE_PRICE;
                    LastUpdated            = PM.C_LAST_UPDATED_;
                    LastModule             = PM.C_LAST_MODULE_;
                    EisPieceWeight         = PM.EIS_PIECE_WEIGHT;
                    EisColor               = PM.EIS_COLOR;
                }
            }
        }
Esempio n. 10
0
        public HostOrder(string InEISOrderID)
        {
            using (WMSEntities wms = new WMSEntities())
            {
                var data = from HO in wms.HOST_ORDERS where HO.EIS_ORDER_ID == InEISOrderID select HO;

                foreach (var Order in data)
                {
                    EisOrderId            = Order.EIS_ORDER_ID;
                    status                = Order.STATUS;
                    Type                  = Order.TYPE;
                    OrderDate             = Order.ORDER_DATE;
                    CustomerID            = Order.CUSTOMER_ID;
                    Name                  = Order.NAME;
                    Address1              = Order.ADDRESS_1;
                    Address2              = Order.ADDRESS_2;
                    Address3              = Order.ADDRESS_3;
                    City                  = Order.CITY;
                    State                 = Order.STATE;
                    Zip                   = Order.ZIP;
                    Phone                 = Order.PHONE;
                    PurchasOrder          = Order.PURCHASE_ORDER;
                    OrigionalShipMode     = Order.ORIGINAL_SHIP_MODE;
                    Terms                 = Order.TERMS;
                    CODIndicator          = Order.COD_INDICATOR;
                    EstNumBoxes           = Order.EST_NUM_BOXES;
                    CarrierID             = Order.CARRIER_ID;
                    Freight               = Order.FREIGHT;
                    DepositAMount         = Order.DEPOSIT_AMOUNT;
                    FreightBIllingOptions = Order.FREIGHT_BILLING_OPTION;
                    ExpediteIndicator     = Order.EXPEDITE_IND;
                    Notes                 = Order.NOTES;
                    ImportTime            = Order.IMPORT_TIME;
                    FreightBillToAccount  = Order.FREIGHT_BILL_TO_ACCOUNT;
                    FreightBillToAddress1 = Order.FREIGHT_BILL_TO_ADDRESS_1;
                    FreightBillToAddress2 = Order.FREIGHT_BILL_TO_ADDRESS_2;
                    FreightBillToAddress3 = Order.FREIGHT_BILL_TO_ADDRESS_3;
                    FreightBillToCity     = Order.FREIGHT_BILL_TO_CITY;
                    FreightBillToName     = Order.FREIGHT_BILL_TO_NAME;
                    FreightBillToState    = Order.FREIGHT_BILL_TO_STATE;
                    FreightBillToZip      = Order.FREIGHT_BILL_TO_ZIP;
                    LastUpdated           = Order.C_LAST_UPDATED_;
                    LastUser              = Order.C_LAST_USER_;
                    LastModule            = Order.C_LAST_MODULE_;
                    QcCodes               = Order.QC_CODES;
                    DeliverByDate         = Order.DELIVER_BY_DATE;
                    QcRequired            = Order.QC_REQUIRED;
                    ExternalCartonized    = Order.EXTERNAL_CARTONIZED;
                    FirstBoxShipped       = Order.FIRSTBOXSHIPPED;
                }
            }
        }
        public void updateReservationType(string Value)
        {
            using (WMSEntities wms = new WMSEntities())
            {
                IQueryable <INVENTORY> Data = from Inv in wms.INVENTORies where Inv.C_RID_ == RID select Inv;

                foreach (INVENTORY InventoryData in Data)
                {
                    InventoryData.RESERVATION_TYPE = Value;
                }
                wms.SaveChanges();
            }
        }
Esempio n. 12
0
        internal void DeleteMoveQueueEntry(int InRID)
        {
            using (WMSEntities wms = new WMSEntities())
            {
                IQueryable <MOVE_QUEUE> MoveQ = from MQ in wms.MOVE_QUEUE where MQ.C_RID_ == InRID select MQ;

                foreach (MOVE_QUEUE move in MoveQ)
                {
                    wms.MOVE_QUEUE.Remove(move);
                }
                wms.SaveChanges();
            }
        }
        public void UpdateLastModule(string Value)
        {
            using (WMSEntities wms = new WMSEntities())
            {
                IQueryable <Inventory> Data = from Inv in wms.Inventories  where Inv.C_RID_ == RID select Inv;

                foreach (Inventory InventoryData in Data)
                {
                    InventoryData.C_LAST_MODULE_ = Value;
                }
                wms.SaveChanges();
            }
        }
        public void UpdateLastUpdated()
        {
            using (WMSEntities wms = new WMSEntities())
            {
                IQueryable <INVENTORY> Data = from Inv in wms.INVENTORies where Inv.C_RID_ == RID select Inv;

                foreach (INVENTORY InventoryData in Data)
                {
                    InventoryData.C_LAST_UPDATED_ = DateTime.Now;
                }
                wms.SaveChanges();
            }
        }
Esempio n. 15
0
        internal void DeleteInventoryAllocation(int InRID)
        {
            using (WMSEntities wms = new WMSEntities())
            {
                IQueryable <INVENTORY_ALLOCATION> inv = from IA in wms.INVENTORY_ALLOCATION where IA.C_RID_ == InRID select IA;

                foreach (INVENTORY_ALLOCATION allocate in inv)
                {
                    wms.INVENTORY_ALLOCATION.Remove(allocate);
                }
                //  wms.SaveChanges();
            }
        }
        public void UpdateLastUser(string Value)
        {
            using (WMSEntities wms = new WMSEntities())
            {
                IQueryable <INVENTORY> Data = from Inv in wms.INVENTORies where Inv.C_RID_ == RID select Inv;

                foreach (INVENTORY InventoryData in Data)
                {
                    InventoryData.C_LAST_USER_ = Value;
                }
                wms.SaveChanges();
            }
        }
Esempio n. 17
0
        internal void UpdateTransactionTime(DateTime Value)
        {
            TransactionTime = Value;
            using (WMSEntities wms = new WMSEntities())
            {
                IQueryable <AUDIT_OUTBOUND> Data = from AO in wms.AUDIT_OUTBOUND where AO.C_RID_ == RID select AO;

                foreach (AUDIT_OUTBOUND AOData in Data)
                {
                    AOData.TRANSACTION_TIME = TransactionTime;
                }
                wms.SaveChanges();
            }
        }
Esempio n. 18
0
        private int?GetCaseQuantity(string ProductID)
        {
            int quantity = 0;

            using (WMSEntities wms = new WMSEntities())
            {
                var info = (from PM in wms.PRODUCT_MASTER where PM.PRODUCT_ID == ProductID select PM.BASE_UOM_PER_CASELEVEL);

                foreach (var data in info)
                {
                    quantity = (int)data.Value;
                }
            }
            return(quantity);
        }
Esempio n. 19
0
        private int GetThreads()
        {
            int threads = -1;

            using (WMSEntities wms = new WMSEntities())
            {
                IQueryable <SYSTEM> Data = from s in wms.SYSTEMs where s.NAME == "Cartonize_threads" select s;

                foreach (SYSTEM x in Data)
                {
                    threads = Convert.ToInt32(x.VALUE);
                }
            }
            return(threads);
        }
Esempio n. 20
0
        internal void UpdateMaxThreads()
        {
            //if max threads was not 1, set it to 1
            Log.Write("threads allowed: " + MaxThreads);
            if (MaxThreads > 0 && MaxThreads != 1)
            {
                using (WMSEntities wms = new WMSEntities())
                {
                    IQueryable <SYSTEM> Data = from S in wms.SYSTEMs
                                               where
                                               S.NAME == "Cartonize_threads_allowed"
                                               select S;

                    foreach (SYSTEM sysData in Data)
                    {
                        sysData.VALUE           = "1";
                        sysData.C_LAST_UPDATED_ = DateTime.Now;
                        sysData.C_LAST_USER_    = "ATS";
                        sysData.C_LAST_MODULE_  = "WHT";
                    }
                    wms.SaveChanges();
                    currentThreadCount = 1;
                }
            }



            if (currentThreadCount == 1 && currentThreadCount != MaxThreads)
            {
                using (WMSEntities wms = new WMSEntities())
                {
                    IQueryable <SYSTEM> Data = from S in wms.SYSTEMs
                                               where
                                               S.NAME == "Cartonize_threads_allowed"
                                               select S;

                    foreach (SYSTEM sysData in Data)
                    {
                        sysData.VALUE           = MaxThreads.ToString();
                        sysData.C_LAST_UPDATED_ = DateTime.Now;
                        sysData.C_LAST_USER_    = "ATS";
                        sysData.C_LAST_MODULE_  = "WHT";
                    }
                    wms.SaveChanges();
                    currentThreadCount = 0;
                }
            }
        }
Esempio n. 21
0
        internal void DeleteOBSEntry()
        {
            using (WMSEntities wms = new WMSEntities())
            {
                IQueryable <OUTBOUND_SHIPMENTS> obsd = from OD in wms.OUTBOUND_SHIPMENTS
                                                       where
                                                       OD.SHIPMENT_ID == ShipmentID && OD.ORDER_NUMBER == OrderNumber
                                                       select OD;

                foreach (OUTBOUND_SHIPMENTS allocate in obsd)
                {
                    wms.OUTBOUND_SHIPMENTS.Remove(allocate);
                }
                wms.SaveChanges();
            }
        }
        public void UpdateLastUpdated()
        {
            LastUpdated = DateTime.Now;
            using (WMSEntities wms = new WMSEntities())
            {
                IQueryable <OUTBOUND_SHIPMENT_DETAILS> Data = from OBSD in wms.OUTBOUND_SHIPMENT_DETAILS
                                                              where
                                                              OBSD.SHIPMENT_ID == ShipmentID && OBSD.ORDER_NUMBER == OrderNumber && OBSD.ORDER_LINE == OrderLine
                                                              select OBSD;

                foreach (OUTBOUND_SHIPMENT_DETAILS OBSDData in Data)
                {
                    OBSDData.C_LAST_UPDATED_ = LastUpdated;
                }
                wms.SaveChanges();
            }
        }
Esempio n. 23
0
        internal void UpdateLastModule(string Value)
        {
            if (LastModule != Value)
            {
                LastModule = Value;
                using (WMSEntities wms = new WMSEntities())
                {
                    IQueryable <AUDIT_OUTBOUND> Data = from AO in wms.AUDIT_OUTBOUND where AO.C_RID_ == RID select AO;

                    foreach (AUDIT_OUTBOUND AOData in Data)
                    {
                        AOData.C_LAST_MODULE_ = LastModule;
                    }
                    wms.SaveChanges();
                }
            }
        }
Esempio n. 24
0
        internal void UpdateStatus(string Value)
        {
            if (Status != Value)
            {
                Status = Value;
                using (WMSEntities wms = new WMSEntities())
                {
                    IQueryable <AUDIT_OUTBOUND> Data = from AO in wms.AUDIT_OUTBOUND where AO.C_RID_ == RID select AO;

                    foreach (AUDIT_OUTBOUND AOData in Data)
                    {
                        AOData.STATUS = Status;
                    }
                    wms.SaveChanges();
                }
            }
        }
Esempio n. 25
0
        internal void UpdateShipmentID(string Value)
        {
            if (ShipmentID != Value)
            {
                ShipmentID = Value;
                using (WMSEntities wms = new WMSEntities())
                {
                    IQueryable <AUDIT_OUTBOUND> Data = from AO in wms.AUDIT_OUTBOUND where AO.C_RID_ == RID select AO;

                    foreach (AUDIT_OUTBOUND AOData in Data)
                    {
                        AOData.SHIPMENT_ID = ShipmentID;
                    }
                    wms.SaveChanges();
                }
            }
        }
Esempio n. 26
0
        internal void UpdateLastUpdated()
        {
            _Last_Updated_ = DateTime.Now;
            using (WMSEntities wms = new WMSEntities())
            {
                IQueryable <OUTBOUND_SHIPMENTS> Data = from OBS in wms.OUTBOUND_SHIPMENTS
                                                       where
                                                       OBS.SHIPMENT_ID == ShipmentID && OBS.ORDER_NUMBER == OrderNumber
                                                       select OBS;

                foreach (OUTBOUND_SHIPMENTS OBSData in Data)
                {
                    OBSData.C_LAST_UPDATED_ = _Last_Updated_;
                }
                wms.SaveChanges();
            }
        }
Esempio n. 27
0
        private int GetNextRID(string Table)
        {
            int RID = 0;

            using (WMSEntities wms = new WMSEntities())
            {
                IQueryable <SYSTEMNEXTRID> Item = from NewRid in wms.SYSTEMNEXTRIDs where NewRid.GENERICNAME == Table select NewRid;
                foreach (SYSTEMNEXTRID New in Item)
                {
                    New.NEXTRID++;
                    RID = New.NEXTRID;
                    wms.SaveChanges();
                }
            }

            return(RID);
        }
Esempio n. 28
0
        /**************************************************************************************
         * Function name:                   CreatePicks
         *
         * What this Function Does:         once the order is broken down, this function will look for the inventory to try and fill the order
         *
         * update needed:                  error handeling
         *
         * Variables passed in:             order- the order object
         *                                 orderType- the type of order we are processing
         *
         * Variables Declared :             AllocationStatus: the status of the order being allocated(   C:compleate
         *                                                                                              E:Error
         *                                                                                              R:Error
         *                                                                                              S:short)
         *                                 OrderCancelRequest- bool value to see if the order was canceled;
         *
         * returns :                        Nothing
         * **************************************************************************************/
        internal void CreatePicks(Order Orders, string orderType)
        {
            string allocationstatus;
            bool   OrderCancelRequest = false;

            allocationstatus = Orders.PiecePickCreation();

            Log.Write("ALLOCATION STATUS: " + allocationstatus);

            if ((allocationstatus == "E" || allocationstatus == "R") || (allocationstatus == "S"))
            {
                Log.Write("*********************************************************************************");
                Log.Write("COULD NOT ALLOCATE INVENTORY FOR ORDER " + Orders.OrderID + ".....ROLLING BACK");
                Log.Write("*********************************************************************************");

                Orders.RemoveAllocation(allocationstatus, Orders.OrderID);
                Orders.UpdateHostOrderStatus(allocationstatus, OrderCancelRequest, orderType);
            }
            else
            {
                using (WMSEntities wms = new WMSEntities())
                {
                    var item = (from ORC in wms.ORDER_CANCEL_REQUESTS where ORC.EIS_ORDER_ID == Orders.OrderID select ORC.EIS_ORDER_ID).SingleOrDefault();

                    if (item != null)
                    {
                        Log.Write("**************************************************************************");
                        Log.Write("ORDER " + Orders.OrderID + " CANCELED THROUGH FDM4....ROLLING BACK");
                        Log.Write("**************************************************************************");

                        Orders.RemoveAllocation(allocationstatus, Orders.OrderID);
                        OrderCancelRequest = true;
                    }
                    else
                    {
                        Log.Write("Sucessful Allocation");
                        if ((allocationstatus == "C"))
                        {
                            Orders.UpdateStatuses("N");
                            Orders.UpdateHostOrderStatus(allocationstatus, OrderCancelRequest, orderType);
                        }
                    }
                }
            }
        }
Esempio n. 29
0
        public string getPiecePickLocation(string ProductID)
        {
            string location = "";



            using (WMSEntities wms = new WMSEntities())
            {
                var item = (from h in wms.PRODUCT_MASTER where h.PRODUCT_ID == ProductID select h.PIECE_PICK_LOCATION).SingleOrDefault();

                if (item != null)
                {
                    location = item;
                }
            }

            return(location);
        }
Esempio n. 30
0
        /**************************************************************************************
         * Function name:                   CheckTruck
         *
         * What this Function Does:         Checks to see if the order is ship mode 7(Truck) and of terms 1 or 2, if it is we change the order status to E
         *
         * update needed:                  none
         *
         * Variables passed in:             None
         *
         * Variables Declared :            None
         *
         * returns :                        Nothing
         * **************************************************************************************/
        public void CheckTruck()
        {
            using (WMSEntities wms = new WMSEntities())
            {
                IQueryable <HOST_ORDERS> items = from H in wms.HOST_ORDERS
                                                 where
                                                 ((H.TERMS == 1 && H.ORIGINAL_SHIP_MODE == "7") || (H.TERMS == 2 && H.ORIGINAL_SHIP_MODE == "7")) && H.STATUS == "N"
                                                 select H;

                foreach (HOST_ORDERS x in items)
                {
                    x.STATUS = "E";
                    Log.Write("Status Changed from N to E in CheckTruck()\n");
                }

                wms.SaveChanges();
            }
        }