Esempio n. 1
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            //Event handler for form load event
            this.Cursor = Cursors.WaitCursor;
            try {
                //Initialize controls
                #region Grid customizations from normal layout
                this.grdShipments.DisplayLayout.Bands[0].Columns["ShipDate"].SortIndicator = SortIndicator.Descending;
                #endregion
                this.ColumnHeaders = global::Argix.Properties.Settings.Default.ShipmentsColumns;
                Application.DoEvents();

                this.mClients.Merge(FreightGateway.ReadLTLClientList(true));
                if (this.cboClient.Items.Count > 0)
                {
                    this.cboClient.SelectedIndex = 0;
                }
                OnClientChanged(null, EventArgs.Empty); this.mAutoRefreshSvc.Start();

                this.dtpShipDateStart.MinDate = DateTime.Today.AddDays(-365);
                this.dtpShipDateStart.MaxDate = DateTime.Today.AddDays(30);
                this.dtpShipDateStart.Value   = DateTime.Today.AddDays(-30);
                this.dtpShipDateEnd.MinDate   = DateTime.Today.AddDays(-365);
                this.dtpShipDateEnd.MaxDate   = DateTime.Today.AddDays(30);
                this.dtpShipDateEnd.Value     = DateTime.Today;
                this.mClients2.Merge(FreightGateway.ReadLTLClientList());
                if (this.cboClient2.Items.Count > 0)
                {
                    this.cboClient2.SelectedIndex = 0;
                }
                OnClient2Changed(null, EventArgs.Empty);
            }
            catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); }
            finally { setUserServices(); this.Cursor = Cursors.Default; }
        }
Esempio n. 2
0
        private void OnDragDrop(object sender, System.Windows.Forms.DragEventArgs e)
        {
            //Event handler for dropping onto the grid
            try {
                DataObject oData = (DataObject)e.Data;
                if (oData.GetDataPresent(DataFormats.StringFormat, true))
                {
                    for (int i = 0; i < this.mTemplates.ClientInboundScheduleTable.Rows.Count; i++)
                    {
                        if (this.mTemplates.ClientInboundScheduleTable[i].Selected == true)
                        {
                            DispatchDataset.ClientInboundScheduleTableRow appointment = new DispatchDataset().ClientInboundScheduleTable.NewClientInboundScheduleTableRow();
                            appointment.ItemArray    = this.mTemplates.ClientInboundScheduleTable[i].ItemArray;
                            appointment.CreateUserID = Environment.UserName;
                            appointment.Created      = DateTime.Now;
                            switch (this.cboSchedule.SelectedItem.ToString())
                            {
                            case "Today": appointment.ScheduleDate = DateTime.Today; break;

                            case "Advanced": appointment.ScheduleDate = DateTime.Today.AddDays(1); break;
                            }
                            appointment.ScheduledArrival = appointment.ScheduleDate.Date + appointment.ScheduledArrival.TimeOfDay;
                            appointment.IsTemplate       = false;
                            FreightGateway.AddClientInboundFreight(appointment);
                        }
                    }
                    Refresh();
                }
            }
            catch (Exception ex) { App.ReportError(ex, true, LogLevel.Warning); }
        }
Esempio n. 3
0
        private void OnCommandClick(object sender, System.EventArgs e)
        {
            //Event handler for button selection
            this.Cursor = Cursors.WaitCursor;
            try {
                Button btn = (Button)sender;
                switch (btn.Name)
                {
                case "btnQuote":
                    this.Cursor = Cursors.WaitCursor;
                    showQuote(null);
                    LTLQuote2 quote = new LTLQuote2();
                    #region Create Quote
                    quote.ID                     = 0;
                    quote.Created                = DateTime.Now;
                    quote.ShipDate               = this.dtpShipDate.Value;
                    quote.ClientID               = int.Parse(this.cboClient.SelectedValue.ToString());
                    quote.OriginZip              = this.txtShipperZip.Text;
                    quote.DestinationZip         = this.txtConsigneeZip.Text;
                    quote.Pallet1Class           = quote.Pallet2Class = quote.Pallet3Class = quote.Pallet4Class = quote.Pallet5Class = "FAK";
                    quote.Pallet1Weight          = int.Parse(this.grdPallets.Rows[0].Cells["Weight"].Value.ToString(), System.Globalization.NumberStyles.AllowDecimalPoint);
                    quote.Pallet1InsuranceValue  = decimal.Parse(this.grdPallets.Rows[0].Cells["InsuranceValue"].Value.ToString());
                    quote.Pallet2Weight          = this.grdPallets.Rows.Count > 1 ? int.Parse(this.grdPallets.Rows[1].Cells["Weight"].Value.ToString(), System.Globalization.NumberStyles.AllowDecimalPoint) : 0;
                    quote.Pallet2InsuranceValue  = this.grdPallets.Rows.Count > 1 ? decimal.Parse(this.grdPallets.Rows[1].Cells["InsuranceValue"].Value.ToString()) : 0;
                    quote.Pallet3Weight          = this.grdPallets.Rows.Count > 2 ? int.Parse(this.grdPallets.Rows[2].Cells["Weight"].Value.ToString(), System.Globalization.NumberStyles.AllowDecimalPoint) : 0;
                    quote.Pallet3InsuranceValue  = this.grdPallets.Rows.Count > 2 ? decimal.Parse(this.grdPallets.Rows[2].Cells["InsuranceValue"].Value.ToString()) : 0;
                    quote.Pallet4Weight          = this.grdPallets.Rows.Count > 3 ? int.Parse(this.grdPallets.Rows[3].Cells["Weight"].Value.ToString(), System.Globalization.NumberStyles.AllowDecimalPoint) : 0;
                    quote.Pallet4InsuranceValue  = this.grdPallets.Rows.Count > 3 ? decimal.Parse(this.grdPallets.Rows[3].Cells["InsuranceValue"].Value.ToString()) : 0;
                    quote.Pallet5Weight          = this.grdPallets.Rows.Count > 4 ? int.Parse(this.grdPallets.Rows[4].Cells["Weight"].Value.ToString(), System.Globalization.NumberStyles.AllowDecimalPoint) : 0;
                    quote.Pallet5InsuranceValue  = this.grdPallets.Rows.Count > 4 ? decimal.Parse(this.grdPallets.Rows[4].Cells["InsuranceValue"].Value.ToString()) : 0;
                    quote.InsidePickup           = this.chkShipperInsidePickup.Checked;
                    quote.LiftGateOrigin         = this.chkShipperLiftGate.Checked;
                    quote.AppointmentOrigin      = this.chkShipperAppt.Checked;
                    quote.SameDayPickup          = this.chkShipperSameDay.Checked;
                    quote.InsideDelivery         = this.chkConsigneeInsideDelivery.Checked;
                    quote.LiftGateDestination    = this.chkConsigneeLiftGate.Checked;
                    quote.AppointmentDestination = this.chkConsigneeAppt.Checked;
                    quote.Pallets                = 0;
                    quote.Weight                 = quote.PalletRate = quote.FuelSurcharge = quote.AccessorialCharge = quote.InsuranceCharge = quote.TollCharge = quote.TotalCharge = 0.0M;
                    #endregion
                    quote = FreightGateway.CreateQuote(quote);
                    this.mQuotes.Add(quote);
                    this.grdQuotes.Refresh();
                    showQuote(quote);
                    break;

                case "btnClear":
                    this.txtShipperZip.Text       = this.txtConsigneeZip.Text = "";
                    this.chkShipperAppt.Checked   = this.chkShipperInsidePickup.Checked = this.chkShipperLiftGate.Checked = this.chkShipperSameDay.Checked = false;
                    this.chkConsigneeAppt.Checked = this.chkConsigneeInsideDelivery.Checked = this.chkConsigneeLiftGate.Checked = false;
                    this.mPallets.Clear();
                    this.lblEstimatedDeliveryDate.Text = "";
                    //this.txtPallets.Text = this.txtWeight.Text = "";
                    this.txtRate.Text = this.txtFSC.Text = this.txtAccessorials.Text = this.txtInsurance.Text = this.txtTSC.Text = this.txtTotal.Text = "";
                    break;
                }
            }
            catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); }
            finally { this.Cursor = Cursors.Default; }
        }
Esempio n. 4
0
 private void OnFormLoad(object sender, EventArgs e)
 {
     //Event handler for form load event
     this.Cursor = Cursors.WaitCursor;
     try {
         //Initialize controls
         #region Grid customizations from normal layout (to support cell editing)
         this.grdSchedule.DisplayLayout.Override.RowSelectors                     = DefaultableBoolean.False;
         this.grdSchedule.DisplayLayout.Override.SelectTypeRow                    = SelectType.None;
         this.grdSchedule.DisplayLayout.Override.SelectTypeCell                   = SelectType.Single;
         this.grdSchedule.DisplayLayout.TabNavigation                             = TabNavigation.NextCell;
         this.grdSchedule.DisplayLayout.Override.AllowAddNew                      = AllowAddNew.No;
         this.grdSchedule.DisplayLayout.Override.AllowDelete                      = DefaultableBoolean.False;
         this.grdSchedule.DisplayLayout.Override.AllowUpdate                      = DefaultableBoolean.True;
         this.grdSchedule.DisplayLayout.Override.CellClickAction                  = CellClickAction.EditAndSelectText;
         this.grdSchedule.DisplayLayout.Override.MaxSelectedCells                 = 1;
         this.grdSchedule.DisplayLayout.Override.RowFilterMode                    = RowFilterMode.AllRowsInBand;
         this.grdSchedule.DisplayLayout.Override.RowFilterAction                  = RowFilterAction.HideFilteredOutRows;
         this.grdSchedule.DisplayLayout.Bands[0].Columns["ID"].CellActivation     = Activation.NoEdit;
         this.grdSchedule.DisplayLayout.Bands[0].Columns["Created"].SortIndicator = SortIndicator.Descending;
         #endregion
         this.ColumnHeaders = global::Argix.Properties.Settings.Default.LoadTenderColumnHeaders;
         this.mOrigins.Merge(FreightGateway.GetLocations());
         this.mDestinations.Merge(FreightGateway.GetLocations());
         this.mCarriers.Merge(FreightGateway.GetCarriers());
         this.mDrivers.Merge(FreightGateway.GetDrivers());
         this.cboSchedule.SelectedIndex = 1;
         Application.DoEvents();
         OnScheduleChanged(null, EventArgs.Empty);
     }
     catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); }
     finally { setUserServices(); this.Cursor = Cursors.Default; }
 }
Esempio n. 5
0
 private void OnConsigneeZipChanged(object sender, EventArgs e)
 {
     //Event handler for change in consignee zip text
     this.Cursor = Cursors.WaitCursor;
     try {
         //Validate zip entry
         if (this.txtConsigneeZip.Text.Trim().Length == 5)
         {
             //Validate this is a servicable location
             string          zip      = this.txtConsigneeZip.Text;
             ServiceLocation location = FreightGateway.ReadServiceLocation(zip);
             if (location == null)
             {
                 this.txtConsigneeZip.Text = "";
                 this.txtConsigneeZip.Focus();
                 MessageBox.Show(zip + " is currently not supported for delivery.", App.Product, MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             else
             {
                 this.lblZone.Text = location.ZoneCode.Trim();
             }
             showQuote(null);
         }
     }
     catch (Exception ex) { App.ReportError(ex, false, LogLevel.Warning); }
     finally { OnValidateForm(null, EventArgs.Empty); this.Cursor = Cursors.Default; }
 }
Esempio n. 6
0
 private void OnZipChanged(object sender, EventArgs e)
 {
     //Validate consignee zip as deliverable (new shippers only)
     try {
         string zipCode = this.txtZip5.Text;
         if (this.mShipper.Number.Trim().Length == 0 && zipCode.Trim().Length == 5)
         {
             ServiceLocation location = FreightGateway.ReadPickupLocation(zipCode);
             if (location == null)
             {
                 this.txtCity.Text = this.txtState.Text = this.txtZip5.Text = "";
                 this.txtZip5.Focus();
                 MessageBox.Show(zipCode + " is currently not supported for pickup.", App.Product, MessageBoxButtons.OK, MessageBoxIcon.Warning);
             }
             else
             {
                 this.txtCity.Text  = location.City.Trim();
                 this.txtState.Text = location.State.Trim();
                 this.txtName.Focus();
             }
         }
     }
     catch (Exception ex) { App.ReportError(ex, true, LogLevel.Information); }
     finally { OnAddressChanged(null, EventArgs.Empty); }
 }
Esempio n. 7
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            //Event handler for form load event
            this.Cursor = Cursors.WaitCursor;
            try {
                //Get lists
                this.mClients.Merge(FreightGateway.GetClients());
                this.mVendors.Merge(FreightGateway.GetVendors());

                //Load controls
                this.Text                  = "Load Tender" + "(" + (!this.mEntry.IsIDNull() ? this.mEntry.ID.ToString() : "New") + ")";
                this.lblID.Text            = !this.mEntry.IsIDNull() ? this.mEntry.ID.ToString("00000000") : "";
                this.dtpScheduleDate.Value = !this.mEntry.IsScheduleDateNull() ? this.mEntry.ScheduleDate : DateTime.Today;

                this.cboClient.SelectedValue = !this.mEntry.IsClientNumberNull() ? this.mEntry.ClientNumber : "141";
                OnClientSelectedIndexChanged(null, EventArgs.Empty);

                if (!this.mEntry.IsVendorNumberNull() && this.mEntry.VendorNumber.Trim().Length > 0)
                {
                    this.cboShipper.SelectedValue = this.mEntry.VendorNumber;
                }
                else
                {
                    this.cboShipper.SelectedIndex = -1;
                    this.cboShipper.Text          = !this.mEntry.IsVendorNameNull() ? this.mEntry.VendorName : "";
                    this.txtAddressLine1.Text     = !this.mEntry.IsVendorAddressLine1Null() ? this.mEntry.VendorAddressLine1 : "";
                    this.txtAddressLine2.Text     = !this.mEntry.IsVendorAddressLine2Null() ? this.mEntry.VendorAddressLine2 : "";
                    this.txtCity.Text             = !this.mEntry.IsVendorCityNull() ? this.mEntry.VendorCity : "";
                    this.txtState.Text            = !this.mEntry.IsVendorStateNull() ? this.mEntry.VendorState : "";
                    this.txtZip.Text  = !this.mEntry.IsVendorZipNull() ? this.mEntry.VendorZip : "";
                    this.txtZip4.Text = !this.mEntry.IsVendorZip4Null() ? this.mEntry.VendorZip4 : "";
                }
                OnShipperAddressChanged(null, EventArgs.Empty);

                this.txtContactName.Text  = !this.mEntry.IsContactNameNull() ? this.mEntry.ContactName : "";
                this.txtContactPhone.Text = !this.mEntry.IsContactPhoneNull() ? this.mEntry.ContactPhone : "";
                this.txtContactEmail.Text = !this.mEntry.IsContactEmailNull() ? this.mEntry.ContactEmail : "";
                this.mtbOpen.Text         = !this.mEntry.IsWindowOpenNull() ? this.mEntry.WindowOpen.ToString().PadLeft(4, '0') : "";
                this.mtbClose.Text        = !this.mEntry.IsWindowCloseNull() ? this.mEntry.WindowClose.ToString().PadLeft(4, '0') : "";

                this.txtDescription.Text = !this.mEntry.IsDescriptionNull() ? this.mEntry.Description : "";

                this.txtQuantity.Text = !this.mEntry.IsAmountNull() ? this.mEntry.Amount.ToString() : "0";
                if (!this.mEntry.IsAmountTypeNull())
                {
                    this.cboContainer.Text = this.mEntry.AmountType;
                }
                else
                {
                    this.cboContainer.SelectedIndex = 0;
                }
                this.txtWeight.Text         = !this.mEntry.IsWeightNull() ? this.mEntry.Weight.ToString() : "0";
                this.chkFullTrailer.Checked = !this.mEntry.IsIsFullTrailerNull() ? this.mEntry.IsFullTrailer : false;
                this.txtComments.Text       = !this.mEntry.IsCommentsNull() ? this.mEntry.Comments : "";

                this.cboClient.Focus();
            }
            catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); }
            finally { OnValidateForm(null, null); this.Cursor = Cursors.Default; }
        }
Esempio n. 8
0
        public override void Refresh()
        {
            try {
                this.Cursor = Cursors.WaitCursor;
                reportStatus(new StatusEventArgs("Refreshing Client Inbound Schedule..."));
                this.mGridSvc.CaptureState();
                this.mSchedule.Clear();
                switch (this.cboSchedule.SelectedItem.ToString())
                {
                case "Today": this.mSchedule.Merge(FreightGateway.ViewClientInboundSchedule()); break;

                case "Yesterday": this.mSchedule.Merge(FreightGateway.ViewClientInboundScheduleYesterday()); break;

                case "Advanced": this.mSchedule.Merge(FreightGateway.ViewClientInboundScheduleAdvanced()); break;

                case "Archive": this.mSchedule.Merge(FreightGateway.ViewClientInboundScheduleArchive()); break;
                }
                this.mGridSvc.RestoreState();

                this.mGridTSvc.CaptureState();
                this.mTemplates.Clear();
                this.mTemplates.Merge(FreightGateway.ViewClientInboundScheduleTemplates());
                this.mGridTSvc.RestoreState();
                base.Refresh();
            }
            catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); }
            finally { setUserServices(); this.Cursor = Cursors.Default; }
        }
Esempio n. 9
0
 private void overrideQuote()
 {
     //
     try {
         if (this.mQuote != null)
         {
             //Validate total charge does not go below the total charge minimum
             decimal totalCharge = decimal.Parse(this.txtTotal.Text);
             if (totalCharge >= this.mQuote.TotalChargeMin)
             {
                 //Update the quote
                 this.mQuote.LTLQuote.TotalCharge = totalCharge;
                 LTLQuote2 quote = FreightGateway.CreateQuoteForSalesRep(this.mQuote.LTLQuote);
                 this.txtRate.Text = quote.PalletRate.ToString();
                 this.txtFSC.Text  = quote.FuelSurcharge.ToString();
             }
             else
             {
                 //Restore the quote
                 this.txtTotal.Text = this.mQuote.LTLQuote.TotalCharge.ToString();
                 this.txtTotal.Focus();
                 MessageBox.Show("The total charge cannot be less than " + this.mQuote.TotalChargeMin.ToString(), App.Product, MessageBoxButtons.OK, MessageBoxIcon.Warning);
             }
         }
     }
     catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); }
 }
Esempio n. 10
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            //Event handler for form load event
            this.Cursor = Cursors.WaitCursor;
            try {
                //Initialize controls
                Splash.Close();
                this.Visible = true;
                Application.DoEvents();
                #region Set user preferences
                try {
                    this.WindowState = global::Argix.Properties.Settings.Default.WindowState;
                    switch (this.WindowState)
                    {
                    case FormWindowState.Maximized: break;

                    case FormWindowState.Minimized: break;

                    case FormWindowState.Normal:
                        this.Location = global::Argix.Properties.Settings.Default.Location;
                        this.Size     = global::Argix.Properties.Settings.Default.Size;
                        break;
                    }
                    this.Font = this.msMain.Font = this.tsMain.Font = this.tsNav.Font = this.ssMain.Font = global::Argix.Properties.Settings.Default.Font;
                    this.msViewToolbar.Checked   = this.tsMain.Visible = global::Argix.Properties.Settings.Default.Toolbar;
                    this.msViewStatusBar.Checked = this.ssMain.Visible = global::Argix.Properties.Settings.Default.StatusBar;
                    this.msViewTemplates.Checked = global::Argix.Properties.Settings.Default.Templates;
                    App.CheckVersion();
                }
                catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); }
                #endregion
                #region Set tooltips
                this.mToolTip.InitialDelay = 500;
                this.mToolTip.AutoPopDelay = 3000;
                this.mToolTip.ReshowDelay  = 1000;
                this.mToolTip.ShowAlways   = true;              //Even when form is inactve
                #endregion

                //Navigation services
                this.tsClientInbound.Enabled = this.tsInbound.Enabled = this.tsOutbound.Enabled = this.tsPickupLog.Enabled = this.tsTrailerTracking.Enabled = true;

                //Set control defaults
                string      terminal = Program.TerminalCode;
                ServiceInfo si       = FreightGateway.GetServiceInfo();
                this.ssMain.SetTerminalPanel(si.TerminalID.ToString(), si.Description);
                this.ssMain.User1Panel.Width       = 144;
                this.ssMain.User1Panel.Text        = RoleServiceGateway.GetRoleForCurrentUser();
                this.ssMain.User1Panel.ToolTipText = "User role";
                this.ssMain.User2Panel.Width       = 48;
                this.ssMain.User2Panel.Text        = Program.TerminalCode.Trim().Length > 0 ? Program.TerminalCode : "All";
                this.ssMain.User2Panel.ToolTipText = "Operating terminal";

                //Toolbox
                OnLeaveToolbox(null, EventArgs.Empty);
                this.mAutoRefreshSvc.Start();
            }
            catch (Exception ex) { App.ReportError(ex); }
            finally { setUserServices(); this.Cursor = Cursors.Default; }
        }
Esempio n. 11
0
        private void OnItemClick(object sender, System.EventArgs e)
        {
            //Menu services
            int          id     = 0;
            LTLClient2   client = null;
            dlgLTLClient dlg    = null;

            try {
                ToolStripItem menu = (ToolStripItem)sender;
                switch (menu.Name)
                {
                case "csNew":
                    client   = new LTLClient2();
                    dlg      = new dlgLTLClient(client);
                    dlg.Font = this.Font;
                    if (dlg.ShowDialog(this) == DialogResult.OK)
                    {
                        this.Cursor = Cursors.WaitCursor;
                        id          = FreightGateway.CreateLTLClient(client);
                        MessageBox.Show(this, "New client created.", App.Product, MessageBoxButtons.OK);
                        Refresh();
                    }
                    break;

                case "csOpen":
                    id       = (int)this.grdClients.Selected.Rows[0].Cells["ID"].Value;
                    client   = FreightGateway.ReadLTLClient(id);
                    dlg      = new dlgLTLClient(client);
                    dlg.Font = this.Font;
                    if (dlg.ShowDialog(this) == DialogResult.OK)
                    {
                        this.Cursor = Cursors.WaitCursor;
                        FreightGateway.UpdateLTLClient(client);
                        MessageBox.Show(this, "Client updated.", App.Product, MessageBoxButtons.OK);
                        Refresh();
                    }
                    break;

                case "csRefresh":
                    this.Cursor = Cursors.WaitCursor;
                    Refresh();
                    break;

                case "csApprove":
                    id = (int)this.grdClients.Selected.Rows[0].Cells["ID"].Value;
                    FreightGateway.ApproveLTLClient(id, true);
                    Refresh();
                    break;

                case "csDeny":
                    id = (int)this.grdClients.Selected.Rows[0].Cells["ID"].Value;
                    FreightGateway.ApproveLTLClient(id, false);
                    Refresh();
                    break;
                }
            }
            catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); }
            finally { setUserServices(); this.Cursor = Cursors.Default; }
        }
Esempio n. 12
0
        private void OnScheduleAfterRowUpdate(object sender, Infragistics.Win.UltraWinGrid.RowEventArgs e)
        {
            //
            this.grdSchedule.Update();
            int id = Convert.ToInt32(this.grdSchedule.ActiveRow.Cells["ID"].Value);

            DispatchDataset.TrailerLogTableRow entry = (DispatchDataset.TrailerLogTableRow) this.mSchedule.TrailerLogTable.Select("ID=" + id)[0];
            FreightGateway.ChangeTrailerEntry(entry);
            Refresh();
        }
Esempio n. 13
0
 private void OnSearchKeyUp(object sender, KeyEventArgs e)
 {
     //Event handler for keyup event
     if (e.KeyCode == Keys.Enter)
     {
         this.mSchedule.Clear();
         this.mSchedule.Merge(FreightGateway.SearchTrailerLog(this.txtSearch.Text));
         e.Handled = true;
     }
 }
Esempio n. 14
0
        private void OnScheduleKeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            try {
                if (e.KeyCode == Keys.Enter && this.grdSchedule.ActiveRow != null)
                {
                    this.grdSchedule.ActiveRow.Update(); e.Handled = true;
                }
                else if (e.Control && e.KeyCode == Keys.C)
                {
                    Cursor.Current = Cursors.WaitCursor;
                    if (this.grdSchedule.ActiveRow != null)
                    {
                        int       id           = int.Parse(this.grdSchedule.ActiveRow.Cells["ID"].Value.ToString());
                        DataRow[] appointments = this.mSchedule.ClientInboundScheduleTable.Select("ID=" + id);
                        Clipboard.SetData(DataFormats.Serializable, appointments[0].ItemArray);
                    }
                }
                else if (e.Control && e.KeyCode == Keys.V)
                {
                    if (this.cboSchedule.SelectedItem.ToString() == "Today" || this.cboSchedule.SelectedItem.ToString() == "Advanced")
                    {
                        Cursor.Current = Cursors.WaitCursor;
                        object o = Clipboard.GetData(DataFormats.Serializable);
                        if (o != null)
                        {
                            Cursor.Current = Cursors.WaitCursor;
                            object[] os = (object[])o;
                            DispatchDataset.ClientInboundScheduleTableRow appointment = new DispatchDataset().ClientInboundScheduleTable.NewClientInboundScheduleTableRow();
                            appointment.ItemArray    = os;
                            appointment.CreateUserID = Environment.UserName;
                            appointment.Created      = DateTime.Now;
                            switch (this.cboSchedule.SelectedItem.ToString())
                            {
                            case "Today": appointment.ScheduleDate = DateTime.Today; break;

                            case "Advanced": appointment.ScheduleDate = DateTime.Today.AddDays(1); break;
                            }
                            appointment.ScheduledArrival = appointment.ScheduleDate.Date + appointment.ScheduledArrival.TimeOfDay;
                            FreightGateway.AddClientInboundFreight(appointment);
                            Refresh();
                        }
                    }
                }
                else if (e.KeyCode == Keys.Delete)
                {
                    if (this.csCancel.Enabled)
                    {
                        Cancel();
                    }
                }
            }
            catch (ArgumentException aex) { App.ReportError(new ApplicationException("Not a valid appointment.", aex), true); }
            catch (Exception ex) { App.ReportError(ex, false, LogLevel.Warning); }
            finally { Cursor.Current = Cursors.Default; }
        }
Esempio n. 15
0
        private void OnControlLoad(object sender, EventArgs e)
        {
            //Event handler for control load event
            this.Cursor = Cursors.WaitCursor;
            try {
                if (!this.DesignMode)
                {
                    #region Grid customizations from normal layout (to support cell editing)
                    this.grdPallets.DisplayLayout.Override.RowSelectors             = DefaultableBoolean.True;
                    this.grdPallets.DisplayLayout.Override.SelectTypeRow            = SelectType.Single;
                    this.grdPallets.DisplayLayout.Override.SelectTypeCell           = SelectType.Single;
                    this.grdPallets.DisplayLayout.TabNavigation                     = TabNavigation.NextCell;
                    this.grdPallets.DisplayLayout.Override.AllowAddNew              = AllowAddNew.TemplateOnBottom;
                    this.grdPallets.DisplayLayout.Override.AllowDelete              = DefaultableBoolean.True;
                    this.grdPallets.DisplayLayout.Override.AllowUpdate              = DefaultableBoolean.True;
                    this.grdPallets.DisplayLayout.Override.MaxSelectedCells         = 1;
                    this.grdPallets.DisplayLayout.Override.CellClickAction          = CellClickAction.EditAndSelectText;
                    this.grdPallets.DisplayLayout.Bands[0].Override.CellClickAction = CellClickAction.EditAndSelectText;
                    this.grdPallets.DisplayLayout.Bands[0].Columns["TrackingNumber"].CellActivation = Activation.NoEdit;
                    this.grdPallets.DisplayLayout.Bands[0].Columns["Weight"].CellActivation         = Activation.AllowEdit;
                    this.grdPallets.DisplayLayout.Bands[0].Columns["NMFCClass"].CellActivation      = Activation.NoEdit;
                    this.grdPallets.DisplayLayout.Bands[0].Columns["InsuranceValue"].CellActivation = Activation.AllowEdit;
                    this.grdPallets.DisplayLayout.Bands[0].Override.RowFilterMode = RowFilterMode.AllRowsInBand;
                    this.grdPallets.DisplayLayout.Bands[0].Columns["TrackingNumber"].SortIndicator = SortIndicator.Ascending;

                    this.grdQuotes.DisplayLayout.Override.RowSelectors                     = DefaultableBoolean.True;
                    this.grdQuotes.DisplayLayout.Override.SelectTypeRow                    = SelectType.Single;
                    this.grdQuotes.DisplayLayout.Override.SelectTypeCell                   = SelectType.Single;
                    this.grdQuotes.DisplayLayout.TabNavigation                             = TabNavigation.NextCell;
                    this.grdQuotes.DisplayLayout.Override.AllowAddNew                      = AllowAddNew.No;
                    this.grdQuotes.DisplayLayout.Override.AllowDelete                      = DefaultableBoolean.True;
                    this.grdQuotes.DisplayLayout.Override.AllowUpdate                      = DefaultableBoolean.False;
                    this.grdQuotes.DisplayLayout.Override.MaxSelectedCells                 = 1;
                    this.grdQuotes.DisplayLayout.Override.CellClickAction                  = CellClickAction.CellSelect;
                    this.grdQuotes.DisplayLayout.Bands[0].Override.CellClickAction         = CellClickAction.CellSelect;
                    this.grdQuotes.DisplayLayout.Bands[0].Override.RowFilterMode           = RowFilterMode.AllRowsInBand;
                    this.grdQuotes.DisplayLayout.Bands[0].Columns["Created"].SortIndicator = SortIndicator.Ascending;
                    #endregion

                    this.dtpShipDate.MinDate = DateTime.Today;
                    this.dtpShipDate.MaxDate = DateTime.Today.AddDays(30);
                    this.dtpShipDate.Value   = getNextValidShipDate();

                    this.mClients.LTLClientTable.AddLTLClientTableRow(0, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", DateTime.MinValue, "", DateTime.MinValue, "", 0, DateTime.MinValue, "", "");
                    this.mClients.Merge(FreightGateway.ReadLTLClientList());
                    if (this.cboClient.Items.Count > 0)
                    {
                        this.cboClient.SelectedIndex = 0;
                    }
                    OnClientChanged(null, EventArgs.Empty);
                }
            }
            catch (Exception ex) { App.ReportError(new ApplicationException(ex.Message)); }
            finally { this.Cursor = Cursors.Default; }
        }
Esempio n. 16
0
 public void Cancel()
 {
     if (this.csCancel.Enabled)
     {
         int id = int.Parse(this.grdSchedule.ActiveRow.Cells["ID"].Value.ToString());
         if (MessageBox.Show(this, "Are you sure you want to cancel appointment " + id.ToString() + "?", App.Product, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
         {
             FreightGateway.CancelClientInboundFreight(id, DateTime.Now, Environment.UserName);
             Refresh();
         }
     }
 }
Esempio n. 17
0
 private void OnScheduleAfterRowUpdate(object sender, Infragistics.Win.UltraWinGrid.RowEventArgs e)
 {
     //
     try {
         this.grdSchedule.Update();
         int id = Convert.ToInt32(this.grdSchedule.ActiveRow.Cells["ID"].Value);
         DispatchDataset.LoadTenderLogTableRow loadtender = (DispatchDataset.LoadTenderLogTableRow) this.mSchedule.LoadTenderLogTable.Select("ID=" + id)[0];
         FreightGateway.UpdateLoadTenderEntry(loadtender);
         Refresh();
     }
     catch (Exception ex) { App.ReportError(ex, true, LogLevel.Warning); }
 }
Esempio n. 18
0
 private void OnScheduleAfterRowUpdate(object sender, Infragistics.Win.UltraWinGrid.RowEventArgs e)
 {
     //
     try {
         this.grdSchedule.Update();
         int id = Convert.ToInt32(this.grdSchedule.ActiveRow.Cells["ID"].Value);
         DispatchDataset.ClientInboundScheduleTableRow appointment = (DispatchDataset.ClientInboundScheduleTableRow) this.mSchedule.ClientInboundScheduleTable.Select("ID=" + id)[0];
         FreightGateway.ChangeClientInboundFreight(appointment);
         Refresh();
     }
     catch (Exception ex) { App.ReportError(ex, true, LogLevel.Warning); }
 }
Esempio n. 19
0
 public override void Refresh()
 {
     try {
         this.Cursor = Cursors.WaitCursor;
         reportStatus(new StatusEventArgs("Refreshing clients..."));
         this.mClients.Clear();
         this.mClients.Merge(FreightGateway.ViewLTLClients());
         this.grdClients.Focus();
         base.Refresh();
     }
     catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); }
     finally { setUserServices(); this.Cursor = Cursors.Default; }
 }
Esempio n. 20
0
        private void OnFormLoad(object sender, System.EventArgs e)
        {
            //Load conditions
            this.Cursor = Cursors.WaitCursor;
            try {
                //Initialize controls
                Splash.Close();
                this.Visible = true;
                Application.DoEvents();
                #region Set user preferences
                try {
                    this.WindowState = global::Argix.Properties.Settings.Default.WindowState;
                    switch (this.WindowState)
                    {
                    case FormWindowState.Maximized: break;

                    case FormWindowState.Minimized: break;

                    case FormWindowState.Normal:
                        this.Location = global::Argix.Properties.Settings.Default.Location;
                        this.Size     = global::Argix.Properties.Settings.Default.Size;
                        break;
                    }
                    this.Font = this.msMain.Font = this.tsMain.Font = this.ssMain.Font = global::Argix.Properties.Settings.Default.Font;
                    this.msViewToolbar.Checked   = this.tsMain.Visible = global::Argix.Properties.Settings.Default.Toolbar;
                    this.msViewStatusBar.Checked = this.ssMain.Visible = global::Argix.Properties.Settings.Default.StatusBar;
                    App.CheckVersion();
                }
                catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); }
                #endregion
                #region Set tooltips
                this.mToolTip.InitialDelay = 500;
                this.mToolTip.AutoPopDelay = 3000;
                this.mToolTip.ReshowDelay  = 1000;
                this.mToolTip.ShowAlways   = true;              //Even when form is inactve
                #endregion

                //Navigation services
                this.tsClients.Enabled = this.tsShippers.Enabled = this.tsConsignees.Enabled = this.tsShipments.Enabled = this.tsQuickQuote.Enabled = this.tsReports.Enabled = true;

                //Set control defaults
                ServiceInfo si = FreightGateway.GetServiceInfo();
                this.ssMain.SetTerminalPanel(si.TerminalID.ToString(), si.Description);
                this.ssMain.User1Panel.Width       = 144;
                this.ssMain.User1Panel.Text        = RoleServiceGateway.GetRoleForCurrentUser();
                this.ssMain.User1Panel.ToolTipText = "User role";
            }
            catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); }
            finally { setUserServices(); this.Cursor = Cursors.Default; }
        }
Esempio n. 21
0
 public override void Refresh()
 {
     try {
         this.Cursor = Cursors.WaitCursor;
         reportStatus(new StatusEventArgs("Refreshing shippers..."));
         string clientNumber = this.cboClient.SelectedValue.ToString();
         this.mShippers.Clear();
         this.mShippers.Merge(FreightGateway.ViewLTLShippers(clientNumber));
         this.grdShippers.Focus();
         base.Refresh();
     }
     catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); }
     finally { setUserServices(); this.Cursor = Cursors.Default; }
 }
Esempio n. 22
0
        private void OnItemClick(object sender, System.EventArgs e)
        {
            //Menu services
            string        number  = "";
            LTLShipper2   shipper = null;
            dlgLTLShipper dlg     = null;

            try {
                ToolStripItem menu = (ToolStripItem)sender;
                switch (menu.Name)
                {
                case "csNew":
                    shipper = new LTLShipper2();
                    shipper.ClientNumber = this.cboClient.SelectedValue.ToString();
                    shipper.Number       = "";
                    dlg      = new dlgLTLShipper(shipper);
                    dlg.Font = this.Font;
                    if (dlg.ShowDialog(this) == DialogResult.OK)
                    {
                        this.Cursor = Cursors.WaitCursor;
                        number      = FreightGateway.CreateLTLShipper(shipper);
                        MessageBox.Show(this, "New shipper created.", App.Product, MessageBoxButtons.OK);
                        Refresh();
                    }
                    break;

                case "csOpen":
                    number   = this.grdShippers.Selected.Rows[0].Cells["ShipperNumber"].Value.ToString();
                    shipper  = FreightGateway.ReadLTLShipper(number);
                    dlg      = new dlgLTLShipper(shipper);
                    dlg.Font = this.Font;
                    if (dlg.ShowDialog(this) == DialogResult.OK)
                    {
                        this.Cursor = Cursors.WaitCursor;
                        FreightGateway.UpdateLTLShipper(shipper);
                        MessageBox.Show(this, "Shipper updated.", App.Product, MessageBoxButtons.OK);
                        Refresh();
                    }
                    break;

                case "csRefresh":
                    this.Cursor = Cursors.WaitCursor;
                    Refresh();
                    break;
                }
            }
            catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); }
            finally { setUserServices(); this.Cursor = Cursors.Default; }
        }
Esempio n. 23
0
        public override void Refresh()
        {
            try {
                this.Cursor = Cursors.WaitCursor;
                reportStatus(new StatusEventArgs("Refreshing Trailer Log..."));
                this.mGridSvc.CaptureState();
                this.mSchedule.Clear();
                switch (this.cboSchedule.SelectedItem.ToString())
                {
                case "Yard Check": this.mSchedule.Merge(FreightGateway.ViewTrailerLog()); break;

                case "Archive": this.mSchedule.Merge(FreightGateway.ViewTrailerLogArchive()); break;
                }
                this.mGridSvc.RestoreState();
                base.Refresh();
            }
            catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); }
            finally { setUserServices(); this.Cursor = Cursors.Default; }
        }
Esempio n. 24
0
        private void OnSearchClick(object sender, EventArgs e)
        {
            //
            this.Cursor = Cursors.WaitCursor;
            try {
                this.grdSearch.Text = "Search Results for " + this.cboClient2.Text;
                this.mSearch.Clear();

                LTLSearch2 criteria = new LTLSearch2();
                criteria.ShipDateStart   = this.dtpShipDateStart.Value;
                criteria.ShipDateEnd     = this.dtpShipDateEnd.Value;
                criteria.ClientNumber    = this.cboClient2.SelectedValue.ToString();
                criteria.ShipperNumber   = this.cboShipper.SelectedValue.ToString();
                criteria.ConsigneeNumber = (int)this.cboConsignee.SelectedValue;
                this.mSearch.Merge(FreightGateway.SearchLTLShipments(criteria));
            }
            catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); }
            finally { setUserServices(); this.Cursor = Cursors.Default; }
        }
Esempio n. 25
0
 private void OnClient2Changed(object sender, EventArgs e)
 {
     try {
         //Load shippers and consignees for the selected client
         this.mShippers.Clear();
         this.mShippers.LTLShipperTable.AddLTLShipperTableRow("", "", "", "", "", "", "", "", "", "", "", "", "", DateTime.MinValue, DateTime.MinValue, 1, "", "", DateTime.MinValue, "", null);
         this.mShippers.Merge(FreightGateway.ReadLTLShippersList(this.cboClient2.SelectedValue.ToString()));
         if (this.cboShipper.Items.Count > 0)
         {
             this.cboShipper.SelectedIndex = 0;
         }
         this.mConsignees.Clear();
         this.mConsignees.LTLConsigneeTable.AddLTLConsigneeTableRow(0, "", "", "", "", "", "", "", "", "", "", "", "", DateTime.MinValue, DateTime.MinValue, 1, DateTime.MinValue, "", null);
         this.mConsignees.Merge(FreightGateway.ReadLTLConsigneesList(this.cboClient2.SelectedValue.ToString()));
         if (this.cboConsignee.Items.Count > 0)
         {
             this.cboConsignee.SelectedIndex = 0;
         }
     }
     catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); }
 }
Esempio n. 26
0
        private void OnFormLoad(object sender, System.EventArgs e)
        {
            //Form load event handler
            this.Cursor = Cursors.WaitCursor;
            try {
                //Show early
                this.Visible = true;
                Application.DoEvents();

                //Load agent summarymEntTerminal
                this.grdAgentSummary.Text = "Agent Summary for " + this.mTerminalName;
                this.grdAgentSummary.DisplayLayout.Bands[0].Override.RowFilterMode = RowFilterMode.AllRowsInBand;
                this.grdAgentSummary.DisplayLayout.Bands[0].Columns["AgentNumber"].SortIndicator = SortIndicator.Ascending;
                this.mTLs.Merge(FreightGateway.GetAgentSummary(this.mTerminalID));
                if (this.grdAgentSummary.Rows.Count > 0)
                {
                    this.grdAgentSummary.Rows[0].Selected = this.grdAgentSummary.Rows[0].Activate();
                }
                this.cmdPrint.Enabled = (this.grdAgentSummary.Rows.Count > 0);
            }
            catch (Exception ex) { throw ex; }
            finally { this.Cursor = Cursors.Default; }
        }
Esempio n. 27
0
        private void OnControlLoad(object sender, EventArgs e)
        {
            //Event handler for control load event
            this.Cursor = Cursors.WaitCursor;
            try {
                if (!this.DesignMode)
                {
                    #region Grid customizations from normal layout (to support cell editing)
                    this.grdTDSInfo.DisplayLayout.Override.RowSelectors             = DefaultableBoolean.False;
                    this.grdTDSInfo.DisplayLayout.Override.SelectTypeRow            = SelectType.Single;
                    this.grdTDSInfo.DisplayLayout.Override.SelectTypeCell           = SelectType.Single;
                    this.grdTDSInfo.DisplayLayout.TabNavigation                     = TabNavigation.NextCell;
                    this.grdTDSInfo.DisplayLayout.Override.AllowAddNew              = AllowAddNew.No;
                    this.grdTDSInfo.DisplayLayout.Override.AllowDelete              = DefaultableBoolean.False;
                    this.grdTDSInfo.DisplayLayout.Override.AllowUpdate              = DefaultableBoolean.False;
                    this.grdTDSInfo.DisplayLayout.Override.MaxSelectedCells         = 1;
                    this.grdTDSInfo.DisplayLayout.Override.CellClickAction          = CellClickAction.RowSelect;
                    this.grdTDSInfo.DisplayLayout.Bands[0].Override.CellClickAction = CellClickAction.RowSelect;
                    this.grdTDSInfo.DisplayLayout.Bands[0].Override.RowFilterMode   = RowFilterMode.AllRowsInBand;
                    #endregion

                    this.dtpStartDate.MinDate = this.dtpEndDate.MinDate = DateTime.Today.AddDays(-90);
                    this.dtpStartDate.MaxDate = this.dtpEndDate.MaxDate = DateTime.Today;
                    this.dtpStartDate.Value   = this.dtpEndDate.MinDate = DateTime.Today;

                    this.mClients.Merge(FreightGateway.GetClients());
                    if (this.cboClient.Items.Count > 0)
                    {
                        this.cboClient.SelectedIndex = 0;
                    }
                    OnClientChanged(null, EventArgs.Empty);
                }
            }
            catch (Exception ex) { App.ReportError(new ApplicationException(ex.Message)); }
            finally { this.Cursor = Cursors.Default; }
        }
Esempio n. 28
0
        private void OnCommandClick(object sender, System.EventArgs e)
        {
            //Event handler for button selection
            this.Cursor = Cursors.WaitCursor;
            try {
                Button btn = (Button)sender;
                switch (btn.Name)
                {
                case "btnFind":
                    this.Cursor = Cursors.WaitCursor;
                    this.mTDSInfo.Clear();
                    this.mTDSInfo.Merge(FreightGateway.GetTDSInfo(this.cboClient.SelectedValue.ToString(), this.dtpStartDate.Value, this.dtpEndDate.Value, this.txtVendorName.Text.Trim()));
                    this.grdTDSInfo.DataBind();
                    break;

                case "btnClear":
                    this.mTDSInfo.Clear();
                    this.grdTDSInfo.DataBind();
                    break;
                }
            }
            catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); }
            finally { this.Cursor = Cursors.Default; }
        }
Esempio n. 29
0
 private void OnBlogKeyUp(object sender, KeyEventArgs e)
 {
     //Event handler for new blog entry
     Cursor.Current = Cursors.WaitCursor;
     try {
         if (e.KeyCode == Keys.Enter)
         {
             BlogEntry entry = new BlogEntry();
             entry.Date    = DateTime.Now;
             entry.Comment = this.txtComment.Text;
             entry.UserID  = Environment.UserName;
             if (FreightGateway.AddBlogEntry(entry))
             {
                 this.txtComment.Clear();
                 lock (this.txtBlog) {
                     DispatchDataset ds = FreightGateway.ViewBlog();
                     refreshBlog(ds);
                 }
             }
         }
     }
     catch (Exception ex) { App.ReportError(ex, false, LogLevel.Warning); }
     finally { Cursor.Current = Cursors.Default; }
 }
Esempio n. 30
0
 private void OnShipperTextChanged(object sender, EventArgs e)
 {
     //Event handler for shipper TextChanged event- clear bound fields when user clears shipper text
     this.Cursor = Cursors.WaitCursor;
     try {
         if (this.cboShipper.SelectedIndex == -1)
         {
             this.txtAddressLine1.Text = "";
             this.txtAddressLine2.Text = "";
             this.txtCity.Text         = "";
             this.txtState.Text        = "";
             this.txtZip.Text          = "";
             this.txtZip4.Text         = "";
             //this.txtContactName.Text = "";
             //this.txtContactPhone.Text = "";
             //this.txtContactEmail.Text = "";
             //this.mtbOpen.Text = this.mtbClose.Text = "";
         }
         else if (this.cboShipper.SelectedValue != null)
         {
             string vendorNumber = this.cboShipper.SelectedValue.ToString();
             DispatchDataset.VendorTableRow vendor = FreightGateway.GetVendor(vendorNumber);
             if (vendor != null)
             {
                 this.txtAddressLine1.Text = vendor.AddressLine1;
                 this.txtAddressLine2.Text = !vendor.IsAddressLine2Null() ? vendor.AddressLine2 : "";
                 this.txtCity.Text         = vendor.City;
                 this.txtState.Text        = vendor.State;
                 this.txtZip.Text          = vendor.Zip;
                 this.txtZip4.Text         = !vendor.IsZip4Null() ? vendor.Zip4 : "";
             }
         }
     }
     catch (Exception ex) { App.ReportError(ex, false, LogLevel.Warning); }
     finally { OnValidateForm(null, null); this.Cursor = Cursors.Default; }
 }