Example #1
0
        private void OnFormLoad(object sender, System.EventArgs e)
        {
            //Initialize controls - set default values
            this.Cursor = Cursors.WaitCursor;
            try {
                //Set initial service states
                this.Visible = true;
                Application.DoEvents();

                //Get selection lists
                this.mTerminalsDS.Merge(EnterpriseFactory.GetEntTerminals());

                //Set control services
                this.txtNameFirst.MaxLength = 30;
                this.txtNameFirst.Text      = "";
                if (!this.mDriverDS.DriverDetailTable[0].IsFirstNameNull())
                {
                    this.txtNameFirst.Text = this.mDriverDS.DriverDetailTable[0].FirstName.Trim();
                }
                this.txtNameLast.MaxLength = 40;
                this.txtNameLast.Text      = "";
                if (!this.mDriverDS.DriverDetailTable[0].IsLastNameNull())
                {
                    this.txtNameLast.Text = this.mDriverDS.DriverDetailTable[0].LastName.Trim();
                }
                this.mskPhone.InputMask = "###-###-####";
                if (!this.mDriverDS.DriverDetailTable[0].IsPhoneNull())
                {
                    this.mskPhone.Value = this.mDriverDS.DriverDetailTable[0].Phone;
                }
                if (this.mDriverDS.DriverDetailTable[0].TerminalID != 0)
                {
                    this.cboTerminal.SelectedValue = this.mDriverDS.DriverDetailTable[0].TerminalID;
                }
                else
                if (this.cboTerminal.Items.Count > 0)
                {
                    this.cboTerminal.SelectedIndex = 0;
                }
                this.cboTerminal.Enabled = (this.cboTerminal.Items.Count > 0);
                this.chkStatus.Checked   = this.mDriverDS.DriverDetailTable[0].IsActive;

                //Reset
            }
            catch (Exception ex) { reportError(ex); }
            finally { this.btnOk.Enabled = false; this.Cursor = Cursors.Default; }
        }
Example #2
0
        private void OnFormLoad(object sender, System.EventArgs e)
        {
            //Initialize controls - set default values
            this.Cursor = Cursors.WaitCursor;
            try {
                //Show early
                this.Visible = true;
                Application.DoEvents();

                //Get selection lists
                this.mLaneTypesDS.Merge(EnterpriseFactory.GetTerminalLaneTypes());
                this.mTerminalsDS.Merge(EnterpriseFactory.GetEntTerminals());

                //Set control services
                this.txtNumber.MaxLength = 10;
                this.txtNumber.Text      = "";
                if (!this.mLaneDS.TerminalLaneTable[0].IsLaneNumberNull())
                {
                    this.txtNumber.Text = this.mLaneDS.TerminalLaneTable[0].LaneNumber.Trim();
                }
                if (!this.mLaneDS.TerminalLaneTable[0].IsLaneTypeNull())
                {
                    this.cboLaneTypes.SelectedValue = this.mLaneDS.TerminalLaneTable[0].LaneType;
                }
                else
                if (this.cboLaneTypes.Items.Count > 0)
                {
                    this.cboLaneTypes.SelectedIndex = 0;
                }
                this.cboLaneTypes.Enabled     = (this.cboLaneTypes.Items.Count > 0);
                this.txtDescription.MaxLength = 40;
                this.txtDescription.Text      = "";
                if (!this.mLaneDS.TerminalLaneTable[0].IsDescriptionNull())
                {
                    this.txtDescription.Text = this.mLaneDS.TerminalLaneTable[0].Description.Trim();
                }
            }
            catch (Exception ex) { reportError(ex); }
            finally { this.btnOk.Enabled = false; this.Cursor = Cursors.Default; }
        }