private void deleteInBunifuButton_Click(object sender, EventArgs e) { // Call inGateContainersInOutList1.CheckedContainers() int recordID = 0; int focusedRow = 0; for (int i = 0, loopTo = InGateDataGridView.Rows.Count - 1; i <= loopTo; i++) { if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(InGateDataGridView.Rows[i].Cells[1].Value, true, false))) { recordID = Conversions.ToInteger(InGateDataGridView.Rows[i].Cells[0].Value); break; } } var recordInfo = dbCeres.getTableInfo("[Containers In-Out]", "*", "where [Unique ID] = " + recordID.ToString()).Rows[0]; My.MyProject.Forms.FrmdeleteWarning.deleteRecord = "InGate"; MdlContainerManagement.deleteRecordType = "InGate"; My.MyProject.Forms.FrmdeleteWarning.confirmationKey = Strings.Trim(recordInfo["Container Number"].ToString()); My.MyProject.Forms.FrmdeleteWarning.mainMessageLabel.Text = "This can not be undone. This will permanently delete the record and " + " all the other informations associated with it (In/Out Gate info, Time/Date In and Out, etc)." + Constants.vbNewLine + "Container #: " + Strings.Trim(recordInfo["Container Number"].ToString()); My.MyProject.Forms.FrmdeleteWarning.confirmationPanel.Show(); My.MyProject.Forms.FrmdeleteWarning.ButtonPanel.Show(); My.MyProject.Forms.FrmdeleteWarning.yesBunifuButton.Enabled = false; MdlLoadingSetting.showDialogForm(My.MyProject.Forms.FrmdeleteWarning, this); numbOfSelecCans = 0; for (int i = 0, loopTo1 = InGateDataGridView.Rows.Count - 1; i <= loopTo1; i++) { InGateDataGridView.Rows[i].Cells[1].Value = false; } checkButtons(); }
private void FrmReceiptsReport_Load(object sender, EventArgs e) { companies = dbCeres.getTableInfo("VW_CompanyCompanyType", "*", ""); populateBookingCombobox(); // outGateButton.Checked = False // inGateButton.Checked = True populateContainers(); getReceipts(); // var doc CrystalDecisions.CrystalReports.Engine.ReportDocument = reportSource; //doc.ReportDefinition.Sections("Section3").SectionFormat.EnableSuppress = False //CrystalReportViewer1.ReportSource = reportSource if (My.MyProject.Forms.FrmInOutGate.tabinoutGate.SelectedIndex == 0) { doc.ReportDefinition.Sections["Section3"].SectionFormat.EnableSuppress = false; doc.ReportDefinition.Sections["DetailSection1"].SectionFormat.EnableSuppress = true; bkngReleaseField = "[RELEASE NUMBER]"; bkngLabel.Text = "Release #:"; } else { doc.ReportDefinition.Sections["Section3"].SectionFormat.EnableSuppress = true; doc.ReportDefinition.Sections["DetailSection1"].SectionFormat.EnableSuppress = false; bkngReleaseField = "[BOOKING NUMBER]"; bkngLabel.Text = "Booking #:"; } // CrystalReportViewer1.ReportSource = reportSource; }
public static void populateTemplates(string searchWord, string selectedItem, ListView templatesListView) { templatesListView.Items.Clear(); string condition = ""; if (!searchWord.Equals("Find...") && !searchWord.Equals("")) { condition = "where Title Like '%" + searchWord + "%' or [Company Type] Like '%" + searchWord + "%' or " + "Department Like '%" + searchWord + "%'"; if (!selectedItem.Equals("All")) { condition += " and [Company Type] = '" + selectedItem + "'"; } } else if (!string.IsNullOrEmpty(selectedItem)) { if (!selectedItem.Equals("All")) { condition = "where [Company Type] = '" + selectedItem + "'"; } } foreach (DataRow template in db.getTableInfo("[Message Templates]", "*", condition).Rows) { templatesListView.Items.Add(new ListViewItem(new[] { Conversions.ToString(template["Title"]), Conversions.ToString(template["Company Type"]), Conversions.ToString(template["Department"]), Conversions.ToString(template["ID"]) })); } }
private void FrmAddEditServices_Load(object sender, EventArgs e) { // Populate Trucking company DropDownBox var companiesDT = new DataTable(); companiesDT = dbCeres.getTableInfo("VW_CompanyCompanyType", "*", "order by CompanyName"); truckNameDropdown6.Items.Clear(); fromDropdown.Items.Clear(); toDropdown.Items.Clear(); portsRvDropdown.Items.Clear(); fromDropdown.Items.Add("All"); toDropdown.Items.Add("All"); foreach (DataRow company in companiesDT.Rows) { if (company["CompanyType"].Equals("Trucking Company")) { truckNameDropdown6.Items.Add("(" + Strings.Trim(Conversions.ToString(company["CompanyCode"])) + ") " + Strings.Trim(Conversions.ToString(company["CompanyName"])).ToUpper()); } else if (company["CompanyType"].Equals("Terminal")) { fromDropdown.Items.Add("(" + Strings.Trim(Conversions.ToString(company["CompanyCode"])) + ") " + Strings.Trim(Conversions.ToString(company["CompanyName"])).ToUpper()); toDropdown.Items.Add("(" + Strings.Trim(Conversions.ToString(company["CompanyCode"])) + ") " + Strings.Trim(Conversions.ToString(company["CompanyName"])).ToUpper()); portsRvDropdown.Items.Add("(" + Strings.Trim(Conversions.ToString(company["CompanyCode"])) + ") " + Strings.Trim(Conversions.ToString(company["CompanyName"])).ToUpper()); } } truckNameDropdown6.Items.Add("ALL"); truckNameDropdown6.SelectedIndex = 0; servTypeDropdown.SelectedIndex = 0; fromDropdown.SelectedIndex = 0; toDropdown.SelectedIndex = 0; sameRateRadioButton.Checked = true; diffRateRadioButton.Checked = false; rvRateTypeDropdown.SelectedIndex = 0; portsRvDropdown.SelectedIndex = 0; truckNameDropdown6.DropDownHeight = Height - 200; wkDayCutOfftimePicker.Value = DateAndTime.Now; endDateCheckbox.Checked = false; if (typeOfUpdate.Equals("update")) { int selectedRow = My.MyProject.Forms.FrmServices.servicesDataGridView.CurrentRow.Index; int id = Conversions.ToInteger(My.MyProject.Forms.FrmServices.servicesDataGridView.Rows[selectedRow].Cells[0].Value); if (My.MyProject.Forms.FrmServices.servTypeDropdown.SelectedItem.Equals("Drayage")) { string argtableName = "Drayage_Rate"; populateServiceInfo(ref argtableName, id); } else { string argtableName1 = "FSC_Rate"; populateServiceInfo(ref argtableName1, id); } } }
private void BunifuButton2_Click(object sender, EventArgs e) { string code = Conversions.ToString(cboTruckingCompany.SelectedValue); reportList.Clear(); VW_CompanyCompanyType c = (VW_CompanyCompanyType)cboTruckingCompany.SelectedItem; if (!SelectedCarrierCodeList.Contains(Strings.Trim(Conversions.ToString(c.CompanyCode)))) { SelectedCarrierCodeList.Add(Strings.Trim(Conversions.ToString(c.CompanyCode))); } if (!firstLoad) { MdlLoadingSetting.waitForm.Show(); if (!Information.IsNothing(cboTruckingCompany.SelectedValue) & goodToGo()) { if (!fromDatePicker.CustomFormat.Equals("")) { TEFDT = dbCeres.getTableInfo("TEF_Rate", "*", "where FromDate <= '" + Conversions.ToString(fromDatePicker.Value.Date) + "' and (ToDate is null or ToDate <='" + Conversions.ToString(toIDatePicker.Value.Date) + "')"); FSC_Rate = dbCeres.getTableInfo("FSC_Rate", "*", " where From_Date <= '" + Conversions.ToString(fromDatePicker.Value.Date) + "' And (To_Date >= '" + Conversions.ToString(toIDatePicker.Value.Date) + "' or To_Date is null) order by From_Date"); populateServices(); } drayageRates = dbCeres.getTableInfo("DrayageSchemeRate", "*", " where TruckingCompany = '" + Strings.Trim(Conversions.ToString(cboTruckingCompany.SelectedValue)) + "' order by FromDate"); var endDate = Convert.ToDateTime(toIDatePicker.Value.Date.ToShortDateString() + " 23:59:59".ToString()); var StartDate = Convert.ToDateTime(fromDatePicker.Value.Date.ToShortDateString() + " 00:00:00".ToString()); reportList = ContainersInOutDrayageService.GetByDrayageRates(Strings.Trim(Conversions.ToString(cboBookingNumber.SelectedItem)), Strings.Trim(cboPickUp.Text), Strings.Trim(cboDropOff.Text), Strings.Trim(cboDriverId.Text), StartDate, endDate, SelectedCarrierCodeList, streetTurnToggleSwitch.Value, btnRemoveDate.Visible); dgvTest.DataSource = reportList; } populateReport(); filterReportTable(); populateReport(); updateRatesReport(); } if (dgvTest.Rows.Count > 0) { printButton.Enabled = true; } else { printButton.Enabled = false; } foreach (DataGridViewColumn column in dgvTest.Columns) { column.SortMode = DataGridViewColumnSortMode.Automatic; } MdlLoadingSetting.waitForm.Close(); }
private void adNewContactToolStripMenuItem_Click(object sender, EventArgs e) { isNewContact = true; int selectedRow = companiesBunifuDataGridView.CurrentCell.RowIndex; var companyName = companiesBunifuDataGridView.Rows[selectedRow].Cells[1].Value; var mainCompanyAddress = db.getTableInfo("[Addresses]", "Address", "where [Main Address] = 1").Rows[0]; My.MyProject.Forms.FrmAddContact.WorkAddressRichTextBox.Text = Conversions.ToString(mainCompanyAddress["Address"]); My.MyProject.Forms.FrmAddContact.organizationTextBox.Text = Conversions.ToString(companyName); MdlLoadingSetting.showDialogForm(My.MyProject.Forms.FrmAddContact, My.MyProject.Forms.FrmParentScreen); // FrmAddContact.ShowDialog() }
private void FrmEDIManagement_Load(object sender, EventArgs e) { companies = dbCeres.getTableInfo("VW_CompanyCompanyType", "CompanyCode", "where [EDIRequired] = 1 order by CompanyCode"); // statusOutDropdown.SelectedIndex = 0 STATUSDropdown1.SelectedIndex = 0; var vwMB = new MinibookingService(); bookingComboBox.DataSource = MinibookingService.GetJointBooking(bookingActivBookingBunifuToggleSwitch2.Value); bookingComboBox.SelectedIndex = 0; bookingComboBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend; bookingComboBox.AutoCompleteSource = AutoCompleteSource.ListItems; cboSSLine.DataSource = CompanyService.GetAllByCompanyTypeId((int)MdlEnum.CompanyType.Steamship_Line, new WTCCeresEntities()); cboSSLine.AutoCompleteMode = AutoCompleteMode.SuggestAppend; cboSSLine.AutoCompleteSource = AutoCompleteSource.ListItems; firstLoad = false; }
private void populateBookings() { string sslineCode = ""; string condition = "where ([MinibookingNumber] Like '%" + searchBunifuTextBox1.Text + "%' or [CustomerName] Like '%" + searchBunifuTextBox1.Text + "%') and [BookingNumber] <> '' and [ActiveBooking] = " + bookingStatus + " order by [MinibookingNumber]"; bookingsBunifuDataGridView1.Rows.Clear(); foreach (DataRow booking in dbCeres.getTableInfo("[VW_BookingMinibooking]", "*", condition).Rows) { string custName = ""; if (Information.IsDBNull(booking["CustomerName"])) { custName = "N/A"; } else { custName = Strings.Trim(Conversions.ToString(booking["CustomerName"])); } if (!Information.IsDBNull(booking["SSLineCode"])) { sslineCode = Strings.Trim(Conversions.ToString(booking["SSLineCode"])); } else { sslineCode = ""; } bookingsBunifuDataGridView1.Rows.Add(Strings.Trim(Conversions.ToString(booking["BookingNumber"])), custName, sslineCode, booking["MinibookingId"]); } }
public void populateBlockedList() { blockContBunifuDataGridView.Rows.Clear(); string condition = "where [Blocked Date] >= '" + Conversions.ToString(fromInBunifuDatePicker.Value.Date) + "' and [Blocked Date] <= '" + Conversions.ToString(toInBunifuDatePicker.Value.Date) + "'"; DateTime blockedDate; var endBlock = default(DateTime); string endBlockStr; string status; foreach (DataRow cont in dbCeres.getTableInfo("[Blocked Containers]", "*", condition).Rows) { blockedDate = Conversions.ToDate(cont["Blocked Date"]); // endBlock = cont("Block End Date") if (!Information.IsDBNull(cont["Block End Date"])) { endBlock = Conversions.ToDate(cont["Block End Date"]); endBlockStr = endBlock.ToString("dd-MMM-yyyy"); } else { endBlockStr = ""; } if (endBlock.Date < DateAndTime.Now.Date) { status = "NOT BLOCKED"; } else { status = "BLOCKED"; } blockContBunifuDataGridView.Rows.Add(cont["ID"], (object)false, Strings.Trim(Conversions.ToString(cont["Container Number"])), "(" + Strings.Trim(Conversions.ToString(cont["SS Line Code"])) + ") " + Strings.Trim(Conversions.ToString(cont["SS Line Name"])), blockedDate.ToString("dd-MMM-yyyy"), endBlockStr, status); } }
private void FrmServices_Load(object sender, EventArgs e) { var companiesDT = new DataTable(); companiesDT = dbCeres.getTableInfo("VW_CompanyCompanyType", "*", "order by CompanyName"); firstLoad = true; truckNameDropdown.Items.Clear(); fromDropdown.Items.Clear(); toDropdown.Items.Clear(); fromDropdown.Items.Add("All"); toDropdown.Items.Add("All"); foreach (DataRow company in companiesDT.Rows) { if (company["DescCompanyType"].Equals("Trucking Company")) { truckNameDropdown.Items.Add("(" + Strings.Trim(Conversions.ToString(company["CompanyCode"])) + ") " + Strings.Trim(Conversions.ToString(company["CompanyName"])).ToUpper()); } else if (company["DescCompanyType"].Equals("Terminal")) { fromDropdown.Items.Add("(" + Strings.Trim(Conversions.ToString(company["CompanyCode"])) + ") " + Strings.Trim(Conversions.ToString(company["CompanyName"])).ToUpper()); toDropdown.Items.Add("(" + Strings.Trim(Conversions.ToString(company["CompanyCode"])) + ") " + Strings.Trim(Conversions.ToString(company["CompanyName"])).ToUpper()); } } truckNameDropdown.Items.Add("All"); truckNameDropdown.SelectedIndex = 0; servTypeDropdown.SelectedIndex = 0; fromDropdown.SelectedIndex = 0; toDropdown.SelectedIndex = 0; truckNameDropdown.DropDownHeight = Height - 200; firstLoad = false; }
private void LoadGrid() { string query; if (gboMain.Text == "Bulk") { query = "MiniUnitOrder as MiniUnit, Sum(TotalBilled) As [TotalBilled]"; } else { query = "MiniUnitOrder as MiniUnit, Sum(PCBilled) As [Total Pieces]"; } dgvMiniUnit.DataSource = dbCeres.getTableInfo("MiniUnit", query, "where UnitSourceId = " + UnitSourceId.ToString() + " and MiniUnitId <> " + MiniUnitId.ToString() + " Group By MiniUnitOrder"); dgvMiniUnit.Refresh(); }
private void FrmCreatePreScript_Load(object sender, EventArgs e) { foreach (DataRow department in db.getTableInfo("Contacts", "distinct(Department)", "order by department").Rows) { departmentComboBox.Items.Add(department["Department"]); } departmentComboBox.SelectedIndex = 0; typeComboBox.SelectedIndex = 0; }
private void FrmListTransfers_Load(object sender, EventArgs e) { transfersList = dbCeres.getTableInfo("[Allowed Transfers]", "*", "order by [Date of Creation]").Rows; // For Each transfer In transfersList // If Not IsDBNull(transfer("Arrive")) Then // completeTransferList.Add() // End If // Next populateTransfers(); }
private void getReport() { var outGateDT = new DataTable(); string condition; DateTime dateOut; string dateOutStr; outGateSummary.Rows.Clear(); condition = "where [Booking Number] <> '' and [Gate Date Out] >= '" + Conversions.ToString(fromInBunifuDatePicker.Value.Date) + "' and " + " [Gate Date Out] <= '" + Conversions.ToString(toInBunifuDatePicker.Value.Date) + "' and ([Container Rejected] is null or [Container Rejected] = 0) order by [Gate Date Out], [Gate Time Out]"; outGateDT = dbCeres.getTableInfo("[Containers In-Out]", "*", condition); foreach (DataRow row in outGateDT.Rows) { if (row["Gate Date Out"] != DBNull.Value) { dateOut = Conversions.ToDate(row["Gate Date Out"]); dateOutStr = dateOut.ToString("dd-MMM-yyyy @ hh:mm tt"); } else { dateOutStr = ""; } var newRow = outGateSummary.NewOutgatedContainersRow(); if (row["ContainerSize"] != DBNull.Value) { newRow.Size = Conversions.ToString(row["ContainerSize"]); } else { newRow.Size = ""; } newRow.Container_Number = Strings.Trim(Conversions.ToString(row["Container Number"])); newRow.Booking_Number = Strings.Trim(Conversions.ToString(row["Booking Number"])); newRow.Tare = MdlContainerManagement.DoFunctions.CVS(Conversions.ToString(row["TARE Weight Out"])); newRow._Date_Time = dateOutStr; newRow.Outgoing_Carrier = Strings.Trim(Conversions.ToString(row["carrier name out"])); newRow.ssLine = Strings.Trim(Conversions.ToString(row["SS Line Name Out"])); outGateSummary.AddOutgatedContainersRow(newRow); } try { var reportSource = new CrystalReportOuGate(); reportSource.Database.Tables[0].SetDataSource(outGateSummary.CopyToDataTable()); CrystalReportViewer1.ReportSource = reportSource; } catch { } }
// Public Function formatPhoneNumberContacts(ByVal strPhoneNumber As String) As String // If Not String.IsNullOrEmpty(strPhoneNumber) Then // 'If Regex.IsMatch(strPhoneNumber, "^[0-9 ]+$") Then // strPhoneNumber = Replace(strPhoneNumber, ")", "") // strPhoneNumber = Replace(strPhoneNumber, "(", "") // strPhoneNumber = Replace(strPhoneNumber, "-", "") // strPhoneNumber = Replace(strPhoneNumber, ".", "") // strPhoneNumber = Replace(strPhoneNumber, "+", "") // strPhoneNumber = Replace(strPhoneNumber, Space(1), "") // If Not strPhoneNumber.Equals("") Then // strPhoneNumber = CLng(strPhoneNumber).ToString("(###) ###-###") // End If // 'Else // 'strPhoneNumber = "Wrong format" // 'End If // End If // Return strPhoneNumber // End Function // Public Sub populateCountriesCombo(ByVal countries As ComboBox) // Dim count As Integer = 0 // For Each country In db.getTableInfo("Countries", "Name, code", "order by name").Rows // countries.Items.Add(country("name") + " - " + country("code")) // Next // countries.SelectedIndex = 0 // End Sub public static void populateProvincesCombo(ComboBox province, ComboBox countries, ComboBox city) { province.Items.Clear(); if (!countries.SelectedItem.Equals("")) { foreach (DataRow country in db.getTableInfo("Transport_Locations", "distinct(Sub_Division)", " where Country_Code = '" + Strings.Trim(countries.SelectedItem.ToString().Split('-')[1]) + "' and Sub_Division is not null order by Sub_Division").Rows) { province.Items.Add(country["Sub_Division"]); } } if (province.Items.Count > 1) { province.SelectedIndex = 0; } else { province.Items.Clear(); city.Items.Clear(); } }
private void FrmDisplayTemplates_Load(object sender, EventArgs e) { templatesListView.Columns.Add("Title", 400); templatesListView.Columns.Add("Type", 265); templatesListView.Columns.Add("Department", 300); templatesListView.Columns.Add("", 0); foreach (DataRow template in db.getTableInfo("[Message Templates]", "distinct([Company Type])", " order by [Company Type]").Rows) { typeToolStripComboBox.Items.Add(template["Company Type"]); } typeToolStripComboBox.SelectedIndex = 0; }
private DataTable GetDistAcceptedList() { var acptList = new DataTable(); var Db = new DatabaseHelperCeres(); string fields; fields = @"[ReleaseNumber] as [Release Number] ,[QtyRequested] as [Qty Requested] ,[FromDateReq] as [From Date Req] ,[ToDateReq] as [To Date Req] ,[QtyAccepted] as [Qty Acpt] ,[FromDateAcpt] as [From Date Acpt] ,[ToDateAcpt] as [To Date Acpt] ,[DateAccepted] as [Date Accepted] ,[StatusNameSch] [Status]"; acptList = Db.getTableInfo("VW_RelDistReqSchRelDistSchAccpt", fields, "where ReleaseDistributionRequestId = " + SelecDistReq.ReleaseDistributionRequestId.ToString(0.ToString())); return(acptList); }
private void populateReconciliation() { var recDT = new DataTable(); string query; decimal totalBilled = 0m; decimal totalLoaded = 0m; decimal totalReconciliation = 0m; dgvReconciliation.Rows.Clear(); query = "where UnitSource = '" + focusedUnitNumber + "'"; recDT = dbCeres.getTableInfo("VW_BookingUnitsReconciliation", "*", query); if (recDT.Rows.Count > 0) { foreach (DataRow row in recDT.Rows) { if (!Information.IsDBNull(row["Loaded"])) { totalLoaded = Conversions.ToDecimal(Operators.AddObject(totalLoaded, row["Loaded"])); } if (!Information.IsDBNull(row["TotalBilled"])) { totalBilled = Conversions.ToDecimal(Operators.AddObject(totalBilled, row["TotalBilled"])); } if (!Information.IsDBNull(row["Reconciliation"])) { totalReconciliation = Conversions.ToDecimal(Operators.AddObject(totalReconciliation, row["Reconciliation"])); } dgvReconciliation.Rows.Add("", row["UnitSource"], row["BookingNumber"], row["CustomerName"], row["TotalBilled"]); } } lblTotBillUnit.Text = totalBilled.ToString(); lbltotBillBk.Text = totalLoaded.ToString(); lblDisc.Text = totalReconciliation.ToString(); }
private void Button1_Click(object sender, EventArgs e) { int contactID = 0; if (My.MyProject.Forms.FrmDisplayContacts.isNewContact == false) { int selectedRowContact = My.MyProject.Forms.FrmDisplayContacts.contactsBunifuDataGridView.CurrentCell.RowIndex; contactID = Conversions.ToInteger(My.MyProject.Forms.FrmDisplayContacts.contactsBunifuDataGridView.Rows[selectedRowContact].Cells[5].Value); } string query = ""; var secondAddress = db.getTableInfo("Addresses A, Contacts C", "A.ID", "where A.ID = C.[Second Address ID] and C.ID = " + contactID.ToString()); if (secondAddress.Rows.Count != 0) { int secondAddressID = Conversions.ToInteger(secondAddress.Rows[0]["ID"]); // populateAddressInfo("where [ID] = " + secondAddressID.ToString) } My.MyProject.Forms.FrmEditAddress.Show(); // addAddresses(1) isContact = true; }
// 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; }
private void PopulateContainerList(string SSLineCode) { containersBunifuDataGridView1.Rows.Clear(); string Sql; int RecordCount = 0; float GrossWeight = 0f; string TareWeight; float WeightLimit = 30.48f; string HSState = ""; string TempLine = ""; DateTime dateIn; int age; string condition = "Where [SS Line Code In] = '" + SSLineCode + "' AND ([trouble in-gate] = 0 OR [trouble in-gate] IS NULL) Order By [Gate Date In] DESC"; if (SSLineCode.Equals("APL") | SSLineCode.Equals("CMA")) { condition = "Where [SS Line Code In] = 'CMA' or [SS Line Code In] = 'APL' and ([trouble in-gate] = 0 OR [trouble in-gate] IS NULL) Order By [Gate Date In] DESC"; } var bookingList = dbCeres.getTableInfo("[Containers to assign]", "*", condition).Rows; foreach (DataRow container in bookingList) { if (AddContainerToPool(container) == true) { GrossWeight = MdlContainerManagement.DoFunctions.CVS(Conversions.ToString(container["Gross Weight"])); if (!Information.IsDBNull(container["TAre Weight"])) { TareWeight = MdlContainerManagement.DoFunctions.CVS(Conversions.ToString(container["TAre Weight"])).ToString(); } else { TareWeight = ""; } dateIn = Conversions.ToDate(container["Gate Date In"]); age = (DateAndTime.Now.Date - dateIn).Days; if (GrossWeight < WeightLimit) { HSState = "S"; } else { HSState = "H"; } bool hold = false; if (Information.IsDBNull(container["Hold Out-Gate"])) { hold = false; } else if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(container["Hold Out-Gate"], false, false))) { hold = false; } else { hold = true; } string truckCode = ""; // Carrier Code Out") if (Information.IsDBNull(container["Carrier Code In"])) { truckCode = ""; } else if (Strings.Trim(Conversions.ToString(container["Carrier Code In"])).Equals("")) { truckCode = ""; } else { truckCode = Strings.Trim(Conversions.ToString(container["Carrier Code In"])); } string realNumber = ""; if (Information.IsDBNull(container["Release Number"])) { realNumber = ""; } else if (Strings.Trim(Conversions.ToString(container["Release Number"])).Equals("")) { realNumber = ""; } else { realNumber = Strings.Trim(Conversions.ToString(container["Release Number"])); } containersBunifuDataGridView1.Rows.Add(false, Strings.Trim(Conversions.ToString(container["Container Number"])), HSState, TareWeight, dateIn.ToString("dd-MMM-yyyy"), age.ToString(), container["Unique ID"], hold, truckCode, realNumber); RecordCount += 1; if (containersBunifuDataGridView1.Rows.Count > 0) { totalContainersLabel.Text = (containersBunifuDataGridView1.CurrentRow.Index + 1).ToString() + " of " + totalNumberOfCans.ToString(); } } } }
private void createTransfetTouchButton_Load(object sender, EventArgs e) { string companyCode; string fromTerminal; string toTerminal; string typeOfTransfer; if (statusComboBox.SelectedItem.Equals("Empty")) { weightTextBox.Text = 0.ToString(); } foreach (DataGridViewRow containerNumber in okToTransferDataGrid.Rows) { char[] c = new char[] { ')' }; char[] d = new char[] { '(' }; companyCode = Conversions.ToString(truckerComboBox.SelectedItem.ToString().Split(c)[0].Split(d)[1]).ToUpper(); fromTerminal = Conversions.ToString(fromComboBox.SelectedItem.ToString().Split(c)[0].Split(d)[1]).ToUpper(); toTerminal = Conversions.ToString(toComboBox.SelectedItem.ToString().Split(c)[0].Split(d)[1]).ToUpper(); if (dueTypeBunifuDropdown.SelectedItem.Equals("Days")) { due = DateAndTime.Now.AddDays((double)NumericUpDown.Value); } else if (dueTypeBunifuDropdown.SelectedItem.Equals("Weeks")) { due = DateAndTime.Now.AddDays((double)(NumericUpDown.Value * 7m)); } else if (dueTypeBunifuDropdown.SelectedItem.Equals("Months")) { due = DateAndTime.Now.AddMonths((int)Math.Round(NumericUpDown.Value)); } if ((fromTerminal.Equals("LINDSEY") | fromTerminal.Equals("EWEN")) & (toTerminal.Equals("LINDSEY") | toTerminal.Equals("EWEN"))) { typeOfTransfer = "INTERNAL"; } else if (!(fromTerminal.Equals("LINDSEY") | fromTerminal.Equals("EWEN")) & (toTerminal.Equals("LINDSEY") | toTerminal.Equals("EWEN"))) { typeOfTransfer = "INBOUND"; } else if ((fromTerminal.Equals("LINDSEY") | fromTerminal.Equals("EWEN")) & !(toTerminal.Equals("LINDSEY") | toTerminal.Equals("EWEN"))) { typeOfTransfer = "OUTBOUND"; } else { typeOfTransfer = "EXTERNAL"; } try { var dateOfCreation = DateAndTime.Now; db.saveAlowedTransfer(My.MyProject.Forms.FrmLoginWindow._userID, Conversions.ToString(containerNumber.Cells[0].Value), companyCode, Conversions.ToString(sizeComboBox.SelectedItem.ToString().Replace("'", "")), Conversions.ToString(statusComboBox.SelectedItem), weightTextBox.Text, fromTerminal, toTerminal, due.Date, typeOfTransfer, dateOfCreation); string condition = "where [Date of Creation] = '" + Conversions.ToString(dateOfCreation) + "' order by ID DESC"; string message = "New " + typeOfTransfer + " transfer has been created"; // dbCeresLogs.saveAlowedTransfer(FrmLoginWindow._userID, containerNumber.Cells(0).Value, companyCode, // sizeComboBox.SelectedItem.Replace("'", ""), statusComboBox.SelectedItem, // weightTextBox.Text, fromTerminal, toTerminal, due.Date, typeOfTransfer, dateOfCreation) int recordID = Conversions.ToInteger(dbCeres.getTableInfo("[Allowed Transfers]", "ID", condition).Rows[0]["ID"]); EmployeeActivityLogService.Insert(My.MyProject.Forms.FrmLoginWindow._userID, recordID.ToString(), "CREATE", "TRANSFER", message); } catch (Exception ex) { MessageBox.Show(Conversions.ToString(Operators.AddObject(Operators.AddObject(Operators.AddObject("There was an error saving transfer of Container #: ", containerNumber.Cells[0].Value), ". Error: "), ex.Message))); } } titlewarningLabel.Text = "The containers were added to the allowed transfer list successfuly!"; titlewarningLabel.ForeColor = Color.Green; cleanDataGrids(); explanationTableLayoutPanel.Hide(); }
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; }