public void CheckifPiecePickLocationIsNull()
 {
     if (PiecePickLocation == null)
     {
         log.Write("Piece Pick For Product " + ProductID + "in productMaster Table Is Null Please Fix this ASAP");
         Environment.Exit(1);
     }
 }
 public void PrintInventoryTable()
 {
     log.newLine();
     log.Write("INFORMANTION FOR BOX :" + RID);
     log.Write("RID: " + RID);
     log.Write("Case Label: " + CaseLabel);
     log.Write("Container Label: " + ContainerLabel);
     log.Write("Pallet Label: " + PalletToTeLabel);
     log.Write("Trailer Label: " + TrailerRailBoatLevel);
     log.Write("Product ID " + ProductID);
     log.Write("Trace ID: " + TraceID);
     log.Write("Owner ID: " + OwnerID);
     log.Write("Location ID: " + LocationID);
     log.Write("Quantity :" + Quantity);
     log.Write("QC Caragoty: " + QcCategory);
     log.Write("Expiration Date: " + ExpirationDate);
     log.Write("MFG DateTime: " + MfgDateTime);
     log.Write("Recipt Date: " + ReciptDate);
     log.Write("Reserved: " + Reserved);
     log.Write("Hold: " + Hold);
     log.Write("Reservation Type: " + ResvervationType);
     log.Write("shipment ID: " + ShipmentID);
     log.Write("Order Number: " + OrderNumber);
     log.Write("Order Line: " + OrderLine);
     log.Write("data1date: " + Data1Date);
     log.Write("data1Num: " + Data1Num);
     log.Write("data1str: " + Data1Str);
     log.Write("data2date: " + Data2Date);
     log.Write("data2Num: " + Data2Num);
     log.Write("data2str: " + Data2Str);
     log.Write("data3date: " + Data3Date);
     log.Write("data3Num: " + Data3Num);
     log.Write("data3str: " + Data3Str);
     log.Write("last Updated: " + LastUpdate);
     log.Write("Last User: "******"Last Module: " + LastModule);
     log.Write("****************************");
 }
        /**************************************************************************************
         * Function name:                   GetUnigureProcessID
         * What this Function Does:         This function will try and create a unigure process id by randomly generating it
         * Variables passed in:             None
         * Variables Declared :             PID- The Process ID
         * returns :                        PID
         * **************************************************************************************/
        public int GetUniqueProcessID()
        {
            try
            {
                int    PID = 0;
                Random rnd = new Random();
                PID = ((999999 - 999 + 1) * rnd.Next(0, 1000) + 999);


                Log.Write("Process ID: " + PID);
                Log.newLine();

                return(PID);
            }
            catch (Exception e)
            {
                if (e.Source != null)
                {
                    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");
                UpdateThreads(0);
                return(-1);
            }
        }
        static void Main(string[] args)
        {
            Cartonize cartonize = new Cartonize();

            Order[]  Orders = new Order[200];
            DebugLog log    = new DebugLog();


            int    PID, MaxCasePerLine;
            int    OrderCnt = 0;
            string Status;
            string OrderType = "WHT";

            if (cartonize.RunProgram() == true)
            {
                /*******************************************
                 * gets a unique process ID so if we get an error we know what order to look at in the log
                 * all finished with try/catch update
                 *****************************************/
                PID = cartonize.GetUniqueProcessID();
                if (PID == -1)
                {
                    System.Environment.Exit(0);
                }

                /*******************************************
                 * get the max amount of cases per order line( default is 100)(also not sure if we really need it)
                 *****************************************/
                //MaxCasePerLine = cartonize.GetMaxCasesPerLine();

                /*******************************************
                 * sets the Carton Info Object inside Cartononize( this can probably be moved into cartonize)
                 ********************************************/
                cartonize.SetBoxes();

                /*******************************************
                 * get the WHT orders from Host_Orders and store each order in an index in the Order Object
                 *****************************************/
                Orders = cartonize.GetOrders(OrderType);
                if (Orders == null)
                {
                    System.Environment.Exit(0);
                }

                /*******************************************
                 * get the total number of orders that were read in from the database that need to be cartonized
                 *****************************************/
                OrderCnt = Orders[0].OrderCount;

                /*******************************************
                 * begin looping through each order one at a time
                 *****************************************/
                for (int i = 0; i < OrderCnt; i++)
                {
                    // Orders[i].printOrderInfo();

                    /*******************************************
                     * Sets the order's status to I then updates the database
                     *****************************************/
                    cartonize.SetOrderToProcessing(Orders[i], PID);
                    int Stat = Orders[i].updateHostOrdersTable();
                    if (Stat == -1)
                    {
                        log.Write("Update Failed Exiting");
                        System.Environment.Exit(0);
                    }

                    /*******************************************
                     * call CartonizeOrder so we can break this order down into pieces and cases
                     *****************************************/
                    Status = cartonize.CartonizeOrder(Orders[i], OrderType);
                    if (Status == null)
                    {
                        System.Environment.Exit(0);
                    }

                    /*******************************************
                     * Now that the order is broken down we will
                     * look in our inventory and try to fill the order
                     *****************************************/
                    cartonize.CreatePicks(Orders[i], OrderType);
                    cartonize.ResetThread();
                    cartonize.UpdateMaxThreads();
                }
            }
            else
            {
                log.Write("Cartonize is currently running, exiting program to avoid errors");
            }

            // Console.ReadLine();
        }
Exemple #5
0
 public void printInventoryAllocationTable()
 {
     log.Write("RID: " + RID);
     log.Write("Product ID " + ProductID);
     log.Write("Location ID: " + LocationID);
     log.Write("QC Caragoty: " + QcCategory);
     log.Write("Trace ID: " + TraceID);
     log.Write("Quantity :" + Quantity);
     log.Write("Allocation Type: " + AllocationType);
     log.Write("shipment ID: " + ShipmentID);
     log.Write("Order Number: " + OrderNumber);
     log.Write("Order Line: " + OrderLine);
     log.Write("last Updated: " + LastUpdated);
     log.Write("Last User: "******"Last Module: " + LastModule);
     log.Write("****************************");
 }
        public void printOrderLineInfo()
        {
            Log.Write("Order ID: " + EISOrderID);
            Log.Write("Order Line: " + EISOrderLine);
            Log.Write("Type: " + Type);
            Log.Write("Product ID: " + ProductID);
            Log.Write("Ordered Units: " + OrderedUnits);
            Log.Write("Scheduled Date: " + ScheduledDate);
            Log.Write("Notes: " + Notes);
            Log.Write("Ordered Line Price: " + OrderedLinePrice);
            Log.Write("Unit Price: " + UnitPrice);
            Log.Write("Total Unit Price: " + TotalUnitPrice);
            Log.Write("Last Update: " + LastUpdated);
            Log.Write("Last User: "******"Order Line COunt : " + OrderLineCount);
            Log.Write("Piece Pick Location: " + PiecePickLocation);
            Log.Write("*******************************");
            Log.Write("\n");

            //  ProductInfo.PrintProductInfo();
        }
Exemple #7
0
 //prints the contents on this objct to the debug log
 public void PrintOutboundShipmentData()
 {
     Log.newLine();
     Log.Write("OUTBOUND SHIPMENT DATA TO BE INSERTED INTO THE DATABASE:");
     Log.Write("Shipment ID: " + ShipmentID);
     Log.Write("OrderNumber: " + OrderNumber);
     Log.Write("Type: " + Type);
     Log.Write("Stop: " + Stop);
     Log.Write("Stop Of: " + Stop_of);
     Log.Write("Sequence: " + Sequence);
     Log.Write("Customer_ID: " + Customer_ID);
     Log.Write("Name: " + Name);
     Log.Write("Address 1: " + Address1);
     Log.Write("Address 2: " + Address2);
     Log.Write("City: " + City);
     Log.Write("State: " + State);
     Log.Write("Zip: " + Zip);
     Log.Write("Phone " + Phone);
     Log.Write("Purchas Order Date: " + PurchasOrderDate);
     Log.Write("Scheduled Ship Date: " + ScheduledShipDate);
     Log.Write("Original Carrier: " + OrigionalCarrier);
     Log.Write("Origional Ship Mode: " + Original_ship_mode);
     Log.Write("Carrier ID: " + Carrier_id);
     Log.Write("Ship Mode: " + Ship_mode);
     Log.Write("Total CNS: " + Total_CSN);
     Log.Write("Total Weight" + Total_weight);
     Log.Write("Status: " + Status);
     Log.Write("PrePaid Collect: " + PrepaidCollect);
     Log.Write("Exceed Ship By: " + Exceed_ship_by);
     Log.Write("Substitution Override: " + Substitution_override);
     Log.Write("Special Handeling: " + Special_Handeling);
     Log.Write("Notes: " + Notes);
     Log.Write("Allow CopL: " + AllowCOPL);
     Log.Write("Payment_Terms: " + Payment_terms);
     Log.Write("Freight Charge: " + Freight_charge);
     Log.Write("Allocation status: " + AllocationStatus);
     Log.Write("COD Indicator: " + COD_Indicator);
     Log.Write("Carton Freight: " + Carton_Freight);
     Log.Write("COD Cost: " + COD_COST);
     Log.Write("Wave ID: " + Wave_id);
     Log.Write("Deposit Ammount: " + Deposit_amount);
     Log.Write("Freight Bill To Account: " + Freight_bill_to_account);
     Log.Write("Freight Bill To Name: " + Freight_bill_To_Name);
     Log.Write("Freight Bill to Address 1: " + Freight_bill_to_address_1);
     Log.Write("Freight BIll to Address 2: " + Freight_bill_to_address_2);
     Log.Write("Freight Bill to Address 3: " + Freight_bill_to_address_3);
     Log.Write("Freight Bill to City: " + Freight_bill_to_city);
     Log.Write("Freight Bill to Zip: " + freight_bill_to_Zip);
     Log.Write("Last Updated: " + _Last_Updated_);
     Log.Write("last User: "******"Last Module: " + _last_module_);
     Log.Write("QC Codes: " + QC_Codes);
     Log.Write("Deliver by Date: " + Deliver_By_Date);
     Log.Write("Address 3: " + Address_3);
     Log.Write("Carton Type: " + CartonType);
 }
Exemple #8
0
 public void PrintCarrierTable()
 {
     log.Write("Carrier ID: " + CarrierID);
     log.Write("Pool Point: " + PoolPoint);
     log.Write("Name: " + Name);
     log.Write("Address 1: " + Address1);
     log.Write("Address 2: " + Address2);
     log.Write("City: " + City);
     log.Write("State: " + State);
     log.Write("Zip: " + ZIP);
     log.Write("Contact Name: " + ContactName);
     log.Write("Contact Phone: " + ContactPhone);
     log.Write("Comments 1: " + Comments1);
     log.Write("Comments 2: " + Comments2);
     log.Write("comments 3: " + Comments3);
     log.Write("comments 4: " + Comments4);
     log.Write("Account Number: " + AccountNumber);
     log.Write("ICC Number: " + ICCNumber);
     log.Write("last Updated: " + LastUpdated);
     log.Write("last User: "******"Last Module: " + LastModule);
     log.Write("Company Name: " + CompanyName);
     log.Write("Type: " + Type);
     log.Write("ship Mode Default: " + ShipModeDefault);
 }
Exemple #9
0
        public void GetProductInfo()
        {
            float?CubePerUOM = 0;

            using (WMSEntities wms = new WMSEntities())
            {
                var Item = (from h in wms.UOM_CONVERSION where h.PRODUCT_ID == ProductID && h.FROM_UOM == "cse" select h.NUMERATOR).SingleOrDefault();
                UnitsPerCase = Item;
                if (UnitsPerCase != 0)
                {
                    CaseQuantity = (Convert.ToInt16(OrderedUnits) / Convert.ToInt16(UnitsPerCase));
                }
                else
                {
                    CaseQuantity = 0;
                }
                var Cube = from h in wms.PRODUCT_MASTER where h.PRODUCT_ID == ProductID select h;

                foreach (var item in Cube)
                {
                    CubePerUOM = item.CUBEPERUOM;
                    if (CubePerUOM == 0)
                    {
                        //Tim look at this later, this might have to change
                        Log.Write("Cube Per UOM is 0. cartonize wont work right, exiting program");
                        System.Environment.Exit(1);
                    }
                    CaseWeight  = item.CASELEVEL_WEIGHT;
                    PieceWeight = (float?)item.EIS_PIECE_WEIGHT;
                }
                PieceQuantity = (OrderedUnits % UnitsPerCase);
                if (PieceQuantity > 0)
                {
                    TotalPieceVolume = Convert.ToDecimal(CubePerUOM) * Convert.ToDecimal(PieceQuantity);
                }
                else
                {
                    TotalPieceVolume = 0;
                }
                // PrintProductInfo();
            }
        }
 public void PrintMoveQueue()
 {
     log.Write("RID :" + RID);
     log.Write("INVENTORY RID: " + InvRID);
     log.Write("priority: " + Priority);
     log.Write("Create Time: " + CreateTime);
     log.Write("Status: " + Status);
     log.Write("label Level: " + LabelLevel);
     log.Write("To Zone: " + ToZone);
     log.Write("To Location:" + ToLocation);
     log.Write("From Location: " + FromLocation);
     log.Write("Origional Quantity Required: " + OrigionalQuantityRequired);
     log.Write("Quantity Required: " + QuantityRequired);
     log.Write("Quantity In Transit: " + QuantityInTransit);
     log.Write("User ID In Transit: " + UserIdInTransit);
     log.Write("Vehicle In Transit: " + VehicleInTranset);
     log.Write("shipmentID: " + shipmentID);
     log.Write("OrderNumber: " + OrderNumber);
     log.Write("Order Line: " + OrderLine);
     log.Write("Last Updated: " + LastUpdated);
     log.Write("Last USer: "******"Last Module: " + LastModule);
 }
        public void PrintPieceInfo()
        {
            Log.Write("ProductID: " + ProductID);
            Log.Write("Shortened ProductID:  " + ShortProductID);
            Log.Write("Total Volume Of Pieces: " + TotalVolume);
            Log.Write("Pieces To Cartonize: " + PiecesToCartonize);
            Log.Write("Piece Pick Location: " + PiecePickLocation);
            Log.Write("Zone :" + zone);
            Log.Write("Aisle :" + Aisle);
            Log.Write("Level :" + Level);
            Log.Write("Bin :" + Bin);

            Log.Write("*********************************\n");
        }
        private int?GetCaseQuantity(string ProductID)
        {
            try
            {
                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);
            }
            catch
            {
                Log.Write("No Case Quantity for Product: " + ProductID);
                return(0);
            }
        }
Exemple #13
0
 private void PrintOutboundShipmentDetail()
 {
     Log.newLine();
     Log.Write("Information being inserted into outbound shipment details");
     Log.Write("Shipment ID: " + ShipmentID);
     Log.Write("ORDER_NUMBER: " + OrderNumber);
     Log.Write("ORDER_LINE: " + OrderLine);
     Log.Write("TYPE: " + Type);
     Log.Write("UOM: " + UnitOfMesure);
     Log.Write("QC_CATEGORY: " + QCCategory);
     Log.Write("SHIPPED_UNITS: " + ShippedUnits);
     Log.Write(" _LAST_UPDATED_: " + LastUpdated);
     Log.Write("_LAST_USER_: " + LastUser);
     Log.Write("_LAST_MODULE_: " + LastModule);
     Log.Write(" PRODUCT_ID: " + ProductID);
     Log.Write(" UOM_WEIGHT: " + UOMWeight);
     Log.Write("UNIT_PRICE_EA: " + UnitPriceEach);
     Log.Write("ORDERED_UNITS: " + OrderedUnits);
     Log.Write("STATUS: " + Status);
     Log.Write("ALLOCATION_STATUS: " + AllocationStatus);
     Log.Write("STAGED_UNITS: " + StagedUnits);
 }
Exemple #14
0
 public void PrintBoxInfo()
 {
     Log.Write("Box Name: " + Name);
     Log.Write("Box Description: " + Description);
     Log.Write("Box Length: " + Length);
     Log.Write("Box Width: " + Width);
     Log.Write("Box Height: " + Height);
     Log.Write("Box UCBPercent: " + UCBPercent);
     Log.Write("Box LCBPercent: " + LCBPercent);
     Log.Write("Box Max Weight: " + MaxWeight);
     Log.Write("Box DunnageWeight: " + DunnageWeight);
     Log.Write("Box Convayable: " + Convayable);
     Log.Write("Box min Volume: " + GetMinVolume());
     Log.Write("Box Max Volume: " + GetMaxVolume());
     Log.Write("********************************");
     Log.newLine();
 }