private void OnFormLoad(object sender, System.EventArgs e) { //Event handler for form load event this.Cursor = Cursors.WaitCursor; try { //Show early this.Visible = true; Application.DoEvents(); //Get selection lists, and set control values this.mTypes.DataSource = MobileDevicesProxy.GetComponentTypeList(true, "Battery"); //ComponentType.CATEGORYID_BATTERY); this.mStatusDS.Merge(this.mItem.StatusList); this.mTerminals.DataSource = MobileDevicesProxy.GetLocalTerminals(); if (this.mItem.TypeID.Length > 0) { this.cboComponentType.SelectedValue = this.mItem.TypeID; } else if (this.cboComponentType.Items.Count > 0) { this.cboComponentType.SelectedIndex = 0; } this.cboComponentType.Enabled = (this.mItem.ItemID.Length == 0 && this.cboComponentType.Items.Count > 0); this.txtBatteryID.MaxLength = 20; this.txtBatteryID.Text = this.mItem.ItemID; this.txtBatteryID.Enabled = false; this.cboTerminal.SelectedValue = this.mItem.TerminalID; this.cboTerminal.Enabled = (this.cboTerminal.Items.Count > 0 && App.Config.AllowTerminalChange); this.cboStatus.SelectedIndex = 0; this.cboStatus.Enabled = (this.mItem.ItemID.Length > 0); this.dtpInServiceDate.Value = this.mItem.InServiceDate; this.dtpInServiceDate.Enabled = (this.mItem.ItemID.Length == 0 && App.Config.AllowBatteryInService); this.txtComments.MaxLength = 100; this.txtComments.Text = this.mItem.Comments; } catch (Exception ex) { App.ReportError(ex, true, Argix.Terminals.LogLevel.Error); } finally { this.btnOK.Enabled = false; this.Cursor = Cursors.Default; } }
private void OnFormLoad(object sender, System.EventArgs e) { //Event handler for form load event this.Cursor = Cursors.WaitCursor; try { //Show early this.Visible = true; Application.DoEvents(); //Get selection lists, and set control values this.mTypes.DataSource = MobileDevicesProxy.GetComponentTypeList(true, "MobilDevice"); //ComponentType.CATEGORYID_DEVICE); this.mStatusDS.Merge(this.mItem.StatusList); this.mTerminals.DataSource = MobileDevicesProxy.GetLocalTerminals(); this.mPriorTypes.DataSource = MobileDevicesProxy.GetComponentTypeList(false, "MobilDevice"); //ComponentType.CATEGORYID_DEVICE); if (this.mItem.TypeID.Length > 0) { this.cboComponentType.SelectedValue = this.mItem.TypeID; } else if (this.cboComponentType.Items.Count > 0) { this.cboComponentType.SelectedIndex = 0; } this.cboComponentType.Enabled = (this.mItem.ItemID.Length == 0); this.btnAddComponentType.Enabled = false; this.txtDeviceID.MaxLength = 20; this.txtDeviceID.Text = this.mItem.DeviceID; this.cboTerminal.SelectedValue = this.mItem.TerminalID; this.cboTerminal.Enabled = (this.cboTerminal.Items.Count > 0 && App.Config.AllowTerminalChange); this.cboStatus.SelectedValue = this.mItem.Status; this.cboStatus.Enabled = true; if (this.mItem.TypeID.Length > 0) { this.cboPriorComponentType.SelectedValue = this.mItem.TypeID; } else if (this.cboPriorComponentType.Items.Count > 0) { this.cboPriorComponentType.SelectedIndex = 0; } this.cboPriorComponentType.Enabled = (this.mItem.ItemID.Length > 0); OnPriorComponentTypeChanged(null, null); this.txtModel.MaxLength = 20; this.txtModel.Text = this.mItem.ModelNumber; this.txtFirmwareVersion.MaxLength = 20; this.txtFirmwareVersion.Text = this.mItem.FirmWareVersion; this.txtSoftwareVersion.MaxLength = 20; this.txtSoftwareVersion.Text = this.mItem.SoftWareVersion; this.dtpServiceExpiration.Value = this.mItem.ServiceExpiration; this.txtCurrentMGAID.MaxLength = 20; this.txtCurrentMGAID.Text = this.mItem.AccountID; this.txtPriorMGAID.MaxLength = 20; this.txtPriorMGAID.Text = this.mItem.PriorAccountID; this.txtComments.MaxLength = 100; this.txtComments.Text = this.mItem.Comments; } catch (Exception ex) { App.ReportError(ex, true, Argix.Terminals.LogLevel.Error); } finally { this.btnOK.Enabled = false; this.Cursor = Cursors.Default; } }