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(); }
internal void CreateMoveQueue(string CarrierID) { try { DatabaseConnection DbCon = new DatabaseConnection(); string conString; DataSet ds; DataRow dRow; int count = 0; int MaxRows; 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 }; do { DbCon = new DatabaseConnection(); conString = DbCon.GetPhillyConString(); DbCon.connection_String = conString; DbCon.Sql = "select _rid_ from Move_queue where _rid_='" + RID + "'"; ds = DbCon.GetConnection; MaxRows = ds.Tables[0].Rows.Count; if (MaxRows != 0) { MoveQ.C_RID_ = GetNextRID("MOVE_QUEUE"); RID = MoveQ.C_RID_; } count++; } while (MaxRows != 0 || count < 20); WMS.MOVE_QUEUE.Add(MoveQ); //Tim Uncomment WMS.SaveChanges(); // PrintMoveQueue(); } catch (Exception e) { } }