Beispiel #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; }
        }
Beispiel #2
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; }
        }