Ejemplo n.º 1
0
 private void RichTextBox1_TextChanged(object sender, EventArgs e)
 {
     string[] containerList;
     containerList = RichTextBox1.Text.Split(Conversions.ToChar(Constants.vbLf));
     cleanDataGrids();
     titleLabel.Text = "Block Container";
     foreach (var cont in containerList)
     {
         string condition = "where [Container Number] = '" + cont + "'";
         // if container number is valid, add it to the valid containers list
         if (MdlContainerManagement.ValidateContainer(cont) & db.isOnDatabase("[Blocked Containers]", condition) == false)
         {
             goodContDataGrid.Rows.Add(cont);
         }
         // if already on database, show ** and add to the not valid containers list
         else if (db.isOnDatabase("[Blocked Containers]", condition) == true)
         {
             badContDataGrid.Rows.Add("* " + cont + " *");
             warningLabel.Visible = true;
         }
         else
         {
             // otherwise just add to the not valid containers list with no **
             badContDataGrid.Rows.Add(cont);
         }
     }
 }
Ejemplo n.º 2
0
 private void containerBunifuTextBox_TextChanged(object sender, EventArgs e)
 {
     availablePictureBox.Visible = true;
     if (string.IsNullOrEmpty(containerBunifuTextBox.Text))
     {
         availablePictureBox.Visible = false;
     }
     else if (MdlContainerManagement.ValidateContainer(containerBunifuTextBox.Text))
     {
         availablePictureBox.Image = My.Resources.Resources.icon_available;
     }
     else
     {
         availablePictureBox.Image = My.Resources.Resources.icon_not_available;
     }
 }
Ejemplo n.º 3
0
 private void assignBunifuButton1_Click(object sender, EventArgs e)
 {
     cleanDataGrids();
     MdlContainerManagement.checkContainersAdded();
 }
Ejemplo n.º 4
0
        private void RailList1_ExportRailListCSVs(short RecLgt, string RailList)
        {
            int    x           = 0;
            string ETADays     = "";
            string CSVLine     = "";
            string ThisCSVFile = "";
            string TempLine    = "";
            var    NumCount    = new string[5];
            string LastTrace   = "";
            string BillDate    = "";
            string ETADate     = "";
            string UnitStatus  = "";
            float  WeightMT;

            System.IO.StreamWriter file;
            ThisCSVFile = System.IO.Path.GetTempPath() + "RailList-" + DateTime.Today.ToString("dd-MMM-yyyy") + "-" + Strings.Format(DateAndTime.TimeOfDay, "hhmmss") + ".CSV";
            if (System.IO.File.Exists(ThisCSVFile) == true)
            {
                System.IO.File.Delete(ThisCSVFile);
            }

            file = My.MyProject.Computer.FileSystem.OpenTextFileWriter(ThisCSVFile, true);
            file.WriteLine("Unit #" + Conversions.ToString(',') + "Customer" + Conversions.ToString(',') + "Status" + Conversions.ToString(',') + "Last Trace" + Conversions.ToString(',') + "Location" + Conversions.ToString(',') + "ETA Date" + Conversions.ToString(',') + "Days" + Conversions.ToString(',') + "Call Date" + Conversions.ToString(',') + "Arrival Date" + Conversions.ToString(',') + "Bill Date" + Conversions.ToString(',') + "Shipper" + Conversions.ToString(',') + "Origin" + Conversions.ToString(',') + "Carrier" + Conversions.ToString(',') + "Type" + Conversions.ToString(',') + "Wgt MT" + Conversions.ToString(',') + "Bags" + Conversions.ToString(',') + "Commodity" + Conversions.ToString(',') + "Track" + Conversions.ToString(',') + "Notes");
            var loopTo = Strings.Len(RailList);

            for (x = 1; RecLgt >= 0 ? x <= loopTo : x >= loopTo; x += RecLgt)
            {
                CSVLine    = Strings.Mid(RailList, x, RecLgt);
                UnitStatus = GiveUnitStatus(Conversions.ToChar(Strings.Mid(CSVLine, 62, 1)));
                if ((Strings.Mid(CSVLine, 63, 4) ?? "") == (MdlContainerManagement.DoFunctions.MKL(0) ?? ""))
                {
                    LastTrace = "";
                }
                else
                {
                    LastTrace = MdlContainerManagement.DoFunctions.NumToDate(Strings.Mid(CSVLine, 63, 4));
                }

                if ((Strings.Mid(CSVLine, 80, 4) ?? "") == (MdlContainerManagement.DoFunctions.MKL(0) ?? ""))
                {
                    ETADate = "";
                }
                else
                {
                    ETADate = MdlContainerManagement.DoFunctions.NumToDate(Strings.Mid(CSVLine, 80, 4));
                }

                if ((Strings.Mid(CSVLine, 84, 2) ?? "") == (MdlContainerManagement.DoFunctions.MKI(0) ?? ""))
                {
                    ETADays = "";
                }
                else
                {
                    ETADays = MdlContainerManagement.DoFunctions.CVI(Strings.Mid(CSVLine, 84, 2)).ToString();
                }

                if ((Strings.Mid(CSVLine, 94, 4) ?? "") == (MdlContainerManagement.DoFunctions.MKL(0) ?? ""))
                {
                    BillDate = "";
                }
                else
                {
                    BillDate = MdlContainerManagement.DoFunctions.NumToDate(Strings.Mid(CSVLine, 94, 4));
                }

                if ((Strings.Mid(CSVLine, 163, 4) ?? "") == (MdlContainerManagement.DoFunctions.MKL(0) ?? ""))
                {
                    WeightMT = 0f;
                }
                else
                {
                    WeightMT = MdlContainerManagement.DoFunctions.CVL(Strings.Mid(CSVLine, 163, 4));
                }

                TempLine = Strings.RTrim(Strings.Mid(CSVLine, 2, 10)) + Conversions.ToString(',') + Strings.RTrim(Strings.Mid(CSVLine, 12, 50)) + Conversions.ToString(',') + UnitStatus + Conversions.ToString(',') + LastTrace + Conversions.ToString(',') + MdlContainerManagement.StripCommas(Strings.RTrim(Strings.Mid(CSVLine, 67, 13))) + Conversions.ToString(',') + ETADate + Conversions.ToString(',') + ETADays + Conversions.ToString(',') + "" + Conversions.ToString(',') + "" + Conversions.ToString(',') + BillDate + Conversions.ToString(',') + Strings.RTrim(Strings.Mid(CSVLine, 98, 35)) + Conversions.ToString(',') + MdlContainerManagement.StripCommas(Strings.RTrim(Strings.Mid(CSVLine, 133, 35))) + Conversions.ToString(',') + Strings.RTrim(Strings.Mid(CSVLine, 168, 4)) + Conversions.ToString(',') + Strings.RTrim(Strings.Mid(CSVLine, 172, 6)) + Conversions.ToString(',') + MdlContainerManagement.DoFunctions.CVS(Strings.Mid(CSVLine, 178, 4)).ToString() + Conversions.ToString(',') + "" + Conversions.ToString(',') + MdlContainerManagement.StripCommas(Strings.RTrim(Strings.Mid(CSVLine, 186, 15))); // RTrim(Mid(CSVLine, 157, 6)) + Chr(44) + CStr(WeightMT) + Chr(44) + "" + Chr(44) + StripCommas(RTrim(Mid(CSVLine, 171, 13))) + Chr(44) + StripCommas(RTrim(Mid(CSVLine, 184, 15)))
                file.WriteLine(TempLine);
            }

            file.Close();
            Process.Start("EXCEL.EXE", ThisCSVFile);
        }
Ejemplo n.º 5
0
        private void FrmAddEditOutGate_Load(object sender, EventArgs e)
        {
            companies = db.getTableInfo("VW_CompanyCompanyType", "*", "order by CompanyName");
            var truckDrivers = db.getTableInfo("[Truck Drivers]", "*", "order by [Truck Number]");

            // Dim ssLineCeres As DataTable = db.getTableInfo("[Containers In-Out]", "*", "order by [Truck Number]")
            fromComboBox.Items.Clear();
            toBunifuDropdown.Items.Clear();
            carrierBunifuDropdown.Items.Clear();
            shippingLineBunifuDropdown.Items.Clear();
            truckNumberBunifuDropdown1.Items.Clear();
            fromComboBox.Items.Add("N/A");
            toBunifuDropdown.Items.Add("N/A");
            carrierBunifuDropdown.Items.Add("N/A");
            shippingLineBunifuDropdown.Items.Add("N/A");
            truckNumberBunifuDropdown1.Items.Add("N/A");
            foreach (DataRow company in companies.Rows)
            {
                if (company["DescCompanyType"].Equals("Container Terminal"))
                {
                    fromComboBox.Items.Add(Strings.Trim(Conversions.ToString(company["Companycode"])) + " (" + Strings.Trim(Conversions.ToString(company["CompanyName"])) + ")");
                    toBunifuDropdown.Items.Add(Strings.Trim(Conversions.ToString(company["Companycode"])) + " (" + Strings.Trim(Conversions.ToString(company["CompanyName"])) + ")");
                }
                else if (company["DescCompanyType"].Equals("Drayage Provider"))
                {
                    carrierBunifuDropdown.Items.Add((Strings.Trim(Conversions.ToString(company["Companycode"])) + " (" + Strings.Trim(Conversions.ToString(company["CompanyName"])) + ")").ToUpper());
                }
                else if (company["DescCompanyType"].Equals("Steamship Line"))
                {
                    shippingLineBunifuDropdown.Items.Add((Strings.Trim(Conversions.ToString(company["Companycode"])) + " (" + Strings.Trim(Conversions.ToString(company["CompanyName"])) + ")").ToUpper());
                }
            }

            foreach (DataRow truckDriver in truckDrivers.Rows)
            {
                truckNumberBunifuDropdown1.Items.Add(Strings.Trim(Conversions.ToString(truckDriver["Truck Number"])));
            }
            cleanFields();
            if (My.MyProject.Forms.FrmInOutGate.isNewRecord == false)
            {
                titleLabel.Text = "Edit Record - Out Gate";
                for (int i = 0, loopTo = My.MyProject.Forms.FrmInOutGate.OutGateDataGridView.Rows.Count - 1; i <= loopTo; i++)
                {
                    if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(My.MyProject.Forms.FrmInOutGate.OutGateDataGridView.Rows[i].Cells[1].Value, true, false)))
                    {
                        recordID = Conversions.ToInteger(My.MyProject.Forms.FrmInOutGate.OutGateDataGridView.Rows[i].Cells[0].Value);
                        break;
                    }
                }
            }
            // ediPanel.Hide()
            else
            {
                titleLabel.Text = "Create New Record - Out Gate";
                for (int i = 0, loopTo1 = My.MyProject.Forms.FrmInOutGate.InGateDataGridView.Rows.Count - 1; i <= loopTo1; i++)
                {
                    if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(My.MyProject.Forms.FrmInOutGate.InGateDataGridView.Rows[i].Cells[1].Value, true, false)))
                    {
                        recordID = Conversions.ToInteger(My.MyProject.Forms.FrmInOutGate.InGateDataGridView.Rows[i].Cells[0].Value);
                        break;
                    }
                }
                // ediPanel.Show()
            }

            MdlContainerManagement.populateOutGateInfo(this, recordID);
            fromComboBox.DropDownHeight               = Height - 100;
            toBunifuDropdown.DropDownHeight           = Height - 100;
            carrierBunifuDropdown.DropDownHeight      = Height - 100;
            shippingLineBunifuDropdown.DropDownHeight = Height - 100;
            truckNumberBunifuDropdown1.DropDownHeight = Height - 100;
        }
Ejemplo n.º 6
0
        private void saveBunifuButton_Click(object sender, EventArgs e)
        {
            string  actionTaken = "";
            int     lastEDIRecordAdded;
            DataRow dataRows;
            string  gateAction;

            // recordID = inGateUniqueIDList(0)

            if (My.MyProject.Forms.FrmInOutGate.isNewRecord)
            {
                actionTaken = "Create";
            }
            else
            {
                actionTaken = "Update";
            }

            gateAction = "OUT-GATE";
            // Save Outgate info
            MdlContainerManagement.saveOutGate(recordID, this);

            // Save Log
            EmployeeActivityLogService.Insert(My.MyProject.Forms.FrmLoginWindow._userID, recordID.ToString(), actionTaken, gateAction, "");
            string ssLineCode;

            ssLineCode = Strings.Trim(shippingLineBunifuDropdown.SelectedItem.ToString().Split('(')[0]);
            if (sendEDIBunifuToggleSwitch.Value == true)
            {
                EmployeeActivityLogService.Insert(My.MyProject.Forms.FrmLoginWindow._userID, recordID.ToString(), actionTaken, gateAction, "Requested EDI to be sent");
                db.AddEDILog(recordID, "OUT-GATE", gateAction);
                lastEDIRecordAdded = db.getLadstEDIadded();
                if (My.MyProject.Forms.FrmChangeEDI.changeEDIRadioButton.Checked)
                {
                    DateTime modDateTime;
                    DateTime modDateTimeSTR;
                    modDateTimeSTR = Conversions.ToDate(My.MyProject.Forms.FrmChangeEDI.EDIDateTimePicker.Value.ToShortDateString() + " " + My.MyProject.Forms.FrmChangeEDI.EdiTimePicker.Value.ToShortTimeString());
                    modDateTime    = Convert.ToDateTime(modDateTimeSTR);
                    db.saveEDIModifiedRecord(lastEDIRecordAdded, modDateTime);
                    // db.UpdatePreSendStatus(recordID, True)
                    db.pushEDIRequest(recordID, false, true, lastEDIRecordAdded, modDateTime);
                }
                else
                {
                    DateTime gateDateTime;
                    DateTime gateDateTimeTR;
                    gateDateTimeTR = Conversions.ToDate(dateDateTimePicker.Value.ToShortDateString() + " " + timeDateTimePicker.Value.ToShortTimeString());
                    gateDateTime   = Convert.ToDateTime(gateDateTimeTR);
                    // db.UpdatePreSendStatus(recordID, True)
                    db.pushEDIRequest(recordID, false, true, lastEDIRecordAdded, gateDateTime);
                }
            }

            cleanFields();
            for (int i = 0, loopTo = My.MyProject.Forms.FrmInOutGate.OutGateDataGridView.Rows.Count - 1; i <= loopTo; i++)
            {
                My.MyProject.Forms.FrmInOutGate.OutGateDataGridView.Rows[i].Cells[1].Value = false;
            }
            My.MyProject.Forms.FrmInOutGate.isRefresh = true;
            My.MyProject.Forms.FrmInOutGate.tabinoutGate.SelectedIndex = 1;
            My.MyProject.Forms.FrmInOutGate.getInOutContainers();
            My.MyProject.Forms.FrmInOutGate.checkButtons();
            Close();
        }
Ejemplo n.º 7
0
        // Dim inGateUniqueIDList() As Integer

        private void FrmAddEditInGate_Load(object sender, EventArgs e)
        {
            // inGateUniqueIDList = FrmInOutGate.containersIDIn

            companies = db.getTableInfo("VW_CompanyCompanyType", "*", "order by CompanyName");
            var truckDrivers = db.getTableInfo("[Truck Drivers]", "*", "order by [Truck Number]");

            // Dim ssLineCeres As DataTable = db.getTableInfo("[Containers In-Out]", "*", "order by [Truck Number]")
            fromComboBox.Items.Clear();
            toBunifuDropdown.Items.Clear();
            carrierBunifuDropdown.Items.Clear();
            shippingLineBunifuDropdown.Items.Clear();
            truckNumberBunifuDropdown1.Items.Clear();
            fromComboBox.Items.Add("N/A");
            toBunifuDropdown.Items.Add("N/A");
            carrierBunifuDropdown.Items.Add("N/A");
            shippingLineBunifuDropdown.Items.Add("N/A");
            truckNumberBunifuDropdown1.Items.Add("N/A");
            foreach (DataRow company in companies.Rows)
            {
                if (company["DescCompanyType"].Equals("Container Terminal"))
                {
                    fromComboBox.Items.Add(Strings.Trim(Conversions.ToString(company["Companycode"])) + " (" + Strings.Trim(Conversions.ToString(company["CompanyName"])) + ")");
                    toBunifuDropdown.Items.Add(Strings.Trim(Conversions.ToString(company["Companycode"])) + " (" + Strings.Trim(Conversions.ToString(company["CompanyName"])) + ")");
                }
                else if (company["DescCompanyType"].Equals("Drayage Provider"))
                {
                    carrierBunifuDropdown.Items.Add((Strings.Trim(Conversions.ToString(company["Companycode"])) + " (" + Strings.Trim(Conversions.ToString(company["CompanyName"])) + ")").ToUpper());
                }
                else if (company["DescCompanyType"].Equals("Steamship Line"))
                {
                    shippingLineBunifuDropdown.Items.Add((Strings.Trim(Conversions.ToString(company["Companycode"])) + " (" + Strings.Trim(Conversions.ToString(company["CompanyName"])) + ")").ToUpper());
                }
            }

            foreach (DataRow truckDriver in truckDrivers.Rows)
            {
                truckNumberBunifuDropdown1.Items.Add(Strings.Trim(Conversions.ToString(truckDriver["Truck Number"])));
            }
            cleanFields();
            if (My.MyProject.Forms.FrmInOutGate.isNewRecord == false)
            {
                int recordID   = 0;
                int focusedRow = 0;
                focusedRow            = My.MyProject.Forms.FrmInOutGate.InGateDataGridView.CurrentRow.Index;
                recordID              = Conversions.ToInteger(My.MyProject.Forms.FrmInOutGate.InGateDataGridView.Rows[focusedRow].Cells[0].Value);
                titleLabel.Text       = "Edit Record - In Gate";
                saveBunifuButton.Text = "UPDATE";
                MdlContainerManagement.populateInGateInfo(this, recordID);
            }
            // ediPanel.Hide()
            else
            {
                titleLabel.Text = "Create New Record - In Gate";
                // ediPanel.Show()

                saveBunifuButton.Text = "SAVE";
            }

            fromComboBox.DropDownHeight               = Height - 100;
            toBunifuDropdown.DropDownHeight           = Height - 100;
            carrierBunifuDropdown.DropDownHeight      = Height - 100;
            shippingLineBunifuDropdown.DropDownHeight = Height - 100;
            truckNumberBunifuDropdown1.DropDownHeight = Height - 100;
        }
Ejemplo n.º 8
0
        private void saveBunifuButton_Click(object sender, EventArgs e)
        {
            string  actionTaken = "";
            int     lastEDIRecordAdded;
            DataRow dataRows;
            string  gateAction;
            var     recordID = default(int);

            if (My.MyProject.Forms.FrmInOutGate.isNewRecord)
            {
                MdlContainerManagement.saveInGate(0, this);
                recordID    = MdlContainerManagement.lastrecordID;
                actionTaken = "CREATE";
                gateAction  = "IN-GATE";
            }
            else
            {
                for (int i = 0, loopTo = My.MyProject.Forms.FrmInOutGate.InGateDataGridView.Rows.Count - 1; i <= loopTo; i++)
                {
                    if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(My.MyProject.Forms.FrmInOutGate.InGateDataGridView.Rows[i].Cells[1].Value, true, false)))
                    {
                        recordID = Conversions.ToInteger(My.MyProject.Forms.FrmInOutGate.InGateDataGridView.Rows[i].Cells[0].Value);
                        break;
                    }
                }

                MdlContainerManagement.saveInGate(recordID, this);
                actionTaken = "UPDATE";
                gateAction  = "IN-GATE";
            }

            EmployeeActivityLogService.Insert(My.MyProject.Forms.FrmLoginWindow._userID, recordID.ToString(), actionTaken, gateAction, "");

            // ' To send EDI -- program only allow specific ss lines
            string ssLineCode;

            ssLineCode = Strings.Trim(shippingLineBunifuDropdown.SelectedItem.ToString().Split('(')[0]);
            if (sendEDIBunifuToggleSwitch.Value == true)
            {
                EmployeeActivityLogService.Insert(My.MyProject.Forms.FrmLoginWindow._userID, recordID.ToString(), actionTaken, gateAction, "Requested EDI to be sent");
                db.AddEDILog(recordID, "IN-GATE", gateAction);
                lastEDIRecordAdded = db.getLadstEDIadded();
                if (My.MyProject.Forms.FrmChangeEDI.changeEDIRadioButton.Checked)
                {
                    DateTime modDateTime;
                    DateTime modDateTimeSTR;
                    modDateTimeSTR = Conversions.ToDate(My.MyProject.Forms.FrmChangeEDI.EDIDateTimePicker.Value.ToShortDateString() + " " + My.MyProject.Forms.FrmChangeEDI.EdiTimePicker.Value.ToShortTimeString());
                    modDateTime    = Convert.ToDateTime(modDateTimeSTR);
                    db.saveEDIModifiedRecord(lastEDIRecordAdded, modDateTime);
                    db.pushEDIRequest(recordID, true, false, lastEDIRecordAdded, modDateTime);
                }
                else
                {
                    DateTime gateDateTime;
                    DateTime gateDateTimeTR;
                    gateDateTimeTR = Conversions.ToDate(dateDateTimePicker.Value.ToShortDateString() + " " + timeDateTimePicker.Value.ToShortTimeString());
                    gateDateTime   = Convert.ToDateTime(gateDateTimeTR);
                    db.pushEDIRequest(recordID, true, false, lastEDIRecordAdded, gateDateTime);
                }
            }

            My.MyProject.Forms.FrmInOutGate.isRefresh = true;
            My.MyProject.Forms.FrmInOutGate.getInOutContainers();
            cleanFields();
            for (int i = 0, loopTo1 = My.MyProject.Forms.FrmInOutGate.InGateDataGridView.Rows.Count - 1; i <= loopTo1; i++)
            {
                My.MyProject.Forms.FrmInOutGate.InGateDataGridView.Rows[i].Cells[1].Value = false;
            }
            My.MyProject.Forms.FrmInOutGate.checkButtons();
            Close();
        }