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