Exemple #1
0
        //Used to save a batch that has been loaded
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (myScreen == null)
            {
                MessageBox.Show("You must load a shipper first!");
                return;
            }

            myScreen.mySOShipHeader.ShipDateAct = System.DateTime.Now;
            myScreen.mySOShipHeader.ShipViaID   = myMEService.getShipViaIDsByID("")[0].ShipViaID;//just pickin first entry for example purposes
            //myScreen.mySOShipHeader.FrtTermsID = myMEService.getFrtTermsByID("")[0].FrtTermsID;//just pickin first entry for example purposes

            myScreen = myMEService.editScreen("UPDATE", myScreen);
            if (myScreen.errorMessage != "")
            {
                MessageBox.Show("Error: " + myScreen.errorMessage);
            }
            else
            {
                btnUpdate.Enabled       = true;
                btnNew.Enabled          = true;
                tbScreen.Text           = ctStandardLib.ctHelper.serializeObject(myScreen).Replace("><", ">" + Environment.NewLine + "<");
                gvSOShipPack.DataSource = myScreen.mySOShipPack;
                MessageBox.Show("Save complete!");
            }
        }
Exemple #2
0
 private void btnLoad_Click(object sender, EventArgs e)
 {
     myScreen = myMEService.getScreenByShipperID(tbShipperID.Text);
     if (myScreen.errorMessage != "")
     {
         MessageBox.Show("Error: " + myScreen.errorMessage);
         return;
     }
     btnUpdate.Enabled       = true;
     btnNew.Enabled          = true;
     tbScreen.Text           = ctStandardLib.ctHelper.serializeObject(myScreen).Replace("><", ">" + Environment.NewLine + "<");
     gvSOShipPack.DataSource = myScreen.mySOShipPack;
     MessageBox.Show("Load complete!");
 }
Exemple #3
0
        //Creates an empty new generic batch
        private void btnNew_Click(object sender, EventArgs e)
        {
            if (myScreen == null)
            {
                MessageBox.Show("You must load a shipper first!");
                return;
            }

            System.Collections.Generic.List <ctDynamicsSL.orderManagement.input.manifestEntry.SOShipPack> myPacks = new List <ctDynamicsSL.orderManagement.input.manifestEntry.SOShipPack>();
            myPacks.AddRange(((ctDynamicsSL.orderManagement.input.manifestEntry.SOShipPack[])gvSOShipPack.DataSource));

            {
                ctDynamicsSL.orderManagement.input.manifestEntry.SOShipPack tmpItem = new ctDynamicsSL.orderManagement.input.manifestEntry.SOShipPack();
                tmpItem.CpnyID      = myScreen.mySOShipHeader.CpnyID;
                tmpItem.ShipperID   = myScreen.mySOShipHeader.ShipperID;
                tmpItem             = myMEService.getNewSOShipPack(tmpItem);
                tmpItem.Wght        = 1.5;
                tmpItem.TrackingNbr = "1235667890";
                tmpItem.CuryFrtInvc = 1;
                tmpItem.CuryFrtCost = 1;
                myPacks.Add(tmpItem);
            }

            myScreen.mySOShipPack = myPacks.ToArray();

            myScreen = myMEService.editScreen("UPDATE", myScreen);
            if (myScreen.errorMessage != "")
            {
                MessageBox.Show("Error: " + myScreen.errorMessage);
                return;
            }
            else
            {
                MessageBox.Show("Save complete!");
                tbShipperID.Text = myScreen.mySOShipHeader.ShipperID;
                btnLoad.PerformClick();
            }
        }