Exemple #1
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; }
        }
Exemple #2
0
        private void OnFormLoad(object sender, System.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.ssMain.Font = global::Argix.Properties.Settings.Default.Font;
                    this.msViewToolbar.Checked     = this.tsMain.Visible = Convert.ToBoolean(global::Argix.Properties.Settings.Default.Toolbar);
                    this.msViewStatusBar.Checked   = this.ssMain.Visible = Convert.ToBoolean(global::Argix.Properties.Settings.Default.StatusBar);
                    this.msViewTermConfigs.Checked = !global::Argix.Properties.Settings.Default.TermConfigWindow;
                    this.msViewEquip.Checked       = !global::Argix.Properties.Settings.Default.DriverEquipWindow;
                    this.msViewRates.Checked       = !global::Argix.Properties.Settings.Default.DriverRatesWindow;
                    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

                //Set control defaults
                ServiceInfo t = FinanceGateway.GetServiceInfo();
                this.ssMain.SetTerminalPanel(t.TerminalID.ToString(), t.Description);
                this.ssMain.User1Panel.Width       = 144;
                this.ssMain.User1Panel.Text        = RoleServiceGateway.GetRoleForCurrentUser();
                this.ssMain.User1Panel.ToolTipText = "User role";

                this.tabMain.TabPages.Clear();
                this.msViewTermConfigs.PerformClick();
                this.msViewEquip.PerformClick();
                this.msViewRates.PerformClick();
            }
            catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); }
            finally { setUserServices(); this.Cursor = Cursors.Default; }
        }
Exemple #3
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; }
        }