Esempio n. 1
0
        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();

                //Set control services
                this.cboTerminal.DisplayMember = "TerminalName";
                this.cboTerminal.ValueMember   = "TerminalID";
                this.cboTerminal.DataSource    = MobileDevicesProxy.GetLocalTerminals();
                this.cboTerminal.SelectedValue = this.mItem.TerminalID;
                this.cboTerminal.Enabled       = false; //this.cboTerminal.Items.Count>0);
                OnTerminalChanged(null, null);

                this.mInstallTypes.Merge(MobileDevicesProxy.GetInstallationTypes());
                if (this.cboInstallType.Items.Count > 0)
                {
                    this.cboInstallType.SelectedIndex = 0;
                }
                this.cboInstallType.Enabled = (this.cboInstallType.Items.Count > 0);

                this.lblDeviceID.Text           = this.mItem.DeviceID;
                this.dtpAssignedDate.Value      = DateTime.Today;
                this.dtpAssignedDate.Enabled    = false;
                this.txtInstallNumber.MaxLength = 20;
                this.txtInstallNumber.Text      = "";
                this.txtInstallNumber.Enabled   = true;
            }
            catch (Exception ex) { App.ReportError(ex, true, Argix.Terminals.LogLevel.Error); }
            finally { this.OnValidateForm(null, null); this.Cursor = Cursors.Default; }
        }
Esempio n. 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();

                this.mCategoriesDS.Merge(MobileDevicesProxy.GetComponentTypeCategories());
                if (this.mType.CategoryID.Length != 0)
                {
                    this.cboCategory.SelectedValue = this.mType.CategoryID;
                }
                else
                if (this.cboCategory.Items.Count > 0)
                {
                    this.cboCategory.SelectedIndex = 0;
                }
                this.cboCategory.Enabled      = (this.mType.TypeID.Length == 0 && this.cboCategory.Items.Count > 0);
                this.txtType.MaxLength        = 20;
                this.txtType.Text             = this.mType.TypeID;
                this.txtType.Enabled          = (this.mType.TypeID.Length == 0);
                this.txtDescription.MaxLength = 50;
                this.txtDescription.Text      = this.mType.Description;
            }
            catch (Exception ex) { App.ReportError(ex, true, Argix.Terminals.LogLevel.Error); }
            finally { this.btnOK.Enabled = false; this.Cursor = Cursors.Default; }
        }
Esempio n. 3
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();
                #region Grid control
                this.grdAssignments.DisplayLayout.CaptionAppearance.FontData.SizeInPoints = 8;
                this.grdAssignments.DisplayLayout.Override.AllowUpdate                             = DefaultableBoolean.True;
                this.grdAssignments.DisplayLayout.Bands[0].Override.AllowUpdate                    = DefaultableBoolean.True;
                this.grdAssignments.DisplayLayout.Bands[0].Override.CellClickAction                = CellClickAction.Edit;
                this.grdAssignments.DisplayLayout.Bands[0].Columns["Assign"].CellActivation        = Activation.AllowEdit;
                this.grdAssignments.DisplayLayout.Bands[0].Override.RowFilterMode                  = RowFilterMode.AllRowsInBand;
                this.grdAssignments.DisplayLayout.Bands[0].Columns["AssignedDate"].SortIndicator   = SortIndicator.Descending;
                this.grdAssignments.DisplayLayout.Bands[0].Columns["AssignedDate"].EditorComponent = this.dtGrid;
                this.grdAssignments.DisplayLayout.Bands[0].Columns["AssignedDate"].CellActivation  = Activation.AllowEdit;
                #endregion
                this._chkShowUnassigned.Checked = this.mDriver.IsActive == 1;
                this._chkShowUnassigned.Enabled = this.mDriver.IsActive == 1;

                this.mDriverAssignments = new BatteryItemAssignments();
                for (int i = 0; i < this.mDriver.Assignments.Count; i++)
                {
                    BatteryItemAssignment assignment = new BatteryItemAssignment();
                    assignment.ItemID       = this.mDriver.Assignments[i].ItemID;
                    assignment.DriverID     = this.mDriver.Assignments[i].DriverID;
                    assignment.AssignedDate = this.mDriver.Assignments[i].AssignedDate;
                    assignment.AssignedUser = this.mDriver.Assignments[i].AssignedUser;
                    assignment.Comments     = this.mDriver.Assignments[i].Comments;
                    assignment.RowVersion   = this.mDriver.Assignments[i].RowVersion;
                    this.mDriverAssignments.Add(assignment);
                }

                BatteryItems items = MobileDevicesProxy.GetUnassignedBatteryItems(this.mDriver.TerminalID);
                for (int i = 0; i < items.Count; i++)
                {
                    BatteryItemAssignment assignment = new BatteryItemAssignment();
                    assignment.ItemID     = items[i].ItemID;
                    assignment.Comments   = items[i].Comments;
                    assignment.RowVersion = items[i].RowVersion;
                    this.mDriverAssignments.Add(assignment);
                }
                this.mAssignments.DataSource = this.mDriverAssignments;
                OnShowUnassignedBatteries(null, null);
                this.txtBatteryInput.Focus();
            }
            catch (Exception ex) { App.ReportError(ex, true, Argix.Terminals.LogLevel.Error); }
            finally { this.btnOK.Enabled = false; this.Cursor = Cursors.Default; }
        }
Esempio n. 4
0
 public void Refresh2()
 {
     this.mGridSvc.CaptureState();
     try {
         setStatusMessage("Refreshing view of component types...");
         this.mTypes.DataSource = MobileDevicesProxy.GetComponentTypes();
         this.grdComponents.DisplayLayout.Bands[0].SortedColumns.RefreshSort(false);
     }
     catch (Exception ex) { App.ReportError(ex, true, Argix.Terminals.LogLevel.Error); }
     finally {
         this.mGridSvc.RestoreState();
         OnGridSelectionChanged(this.grdComponents, null);
     }
 }
Esempio n. 5
0
 private void OnTerminalChanged(object sender, System.EventArgs e)
 {
     //Even handler for change in selected driver terminal
     try {
         this.cboDriver.DisplayMember = "FullName";
         this.cboDriver.ValueMember   = "DriverID";
         this.cboDriver.DataSource    = MobileDevicesProxy.GetDrivers(Convert.ToInt64(this.cboTerminal.SelectedValue), true);
         if (this.cboDriver.Items.Count > 0)
         {
             this.cboDriver.SelectedIndex = 0;
         }
         this.cboDriver.Enabled = true;
     }
     catch (Exception ex) { App.ReportError(ex, false, Argix.Terminals.LogLevel.Warning); }
 }
Esempio n. 6
0
 private void OnGridSelectionChanged(object sender, Infragistics.Win.UltraWinGrid.AfterSelectChangeEventArgs e)
 {
     //Event handler for after selection changes
     try {
         //Select grid and forward to update
         this.mType = null;
         if (this.grdComponents.Selected.Rows.Count > 0)
         {
             string typeID = this.grdComponents.Selected.Rows[0].Cells["TypeID"].Value.ToString();
             this.mType = MobileDevicesProxy.GetComponentType(typeID);
         }
     }
     catch (Exception ex) { App.ReportError(ex, false, Argix.Terminals.LogLevel.Warning); }
     finally { setServices(); }
 }
Esempio n. 7
0
        private void OnPriorComponentTypeChanged(object sender, System.EventArgs e)
        {
            //Event handler for change in prior comonent type
            try {
                //Create filtered subset for the selected component type
                //Add a blank entry since a selection is not required
                //Add the current entry to keep current selection
                this.mPriorDevices.Clear();
                DeviceItem di = new DeviceItem();
                di.DeviceID = "";
                di.ItemID   = "";
                this.mPriorDevices.Add(di);
                if ((this.cboPriorComponentType.SelectedValue.ToString() == this.mItem.TypeID) && this.mItem.PriorItemID != null)
                {
                    di          = new DeviceItem();
                    di.ItemID   = this.mItem.PriorItemID;
                    di.DeviceID = this.mItem.PriorDeviceID;
                    this.mPriorDevices.Add(di);
                }

                string typeID = this.cboPriorComponentType.SelectedValue != null?this.cboPriorComponentType.SelectedValue.ToString() : "";

                DeviceItems priorDeviceItems = MobileDevicesProxy.GetPriorDeviceItems();
                for (int i = 0; i < priorDeviceItems.Count; i++)
                {
                    if (typeID.Length == 0 || priorDeviceItems[i].TypeID == typeID)
                    {
                        this.mPriorDevices.Add(priorDeviceItems[i]);
                    }
                }

                //Sort and select
                this.mPriorDevices.Sort = "DeviceID";
                if (this.mItem.PriorItemID != null)
                {
                    this.cboPriorDeviceID.SelectedValue = this.mItem.PriorItemID;
                }
                else
                {
                    this.cboPriorDeviceID.SelectedIndex = 0;
                }
                this.cboPriorDeviceID.Enabled = (this.mItem.ItemID != "");
            }
            catch (Exception ex) { App.ReportError(ex, false, Argix.Terminals.LogLevel.Warning); }
            finally { this.OnValidateForm(null, null); }
        }
Esempio n. 8
0
 public void Edit()
 {
     try {
         ComponentType    type    = this.mType;
         dlgComponentType dlgType = new dlgComponentType(type);
         if (dlgType.ShowDialog(this) == DialogResult.OK)
         {
             //Update exisiting component type
             setStatusMessage("Updating component type " + type.TypeID + "...");
             if (MobileDevicesProxy.SaveComponentType(type))
             {
                 setStatusMessage("Component type " + type.TypeID + " was updated.");
                 Refresh2();
             }
             else
             {
                 MessageBox.Show(this, "Component type " + type.TypeID + " could not be updated. Please try again.", this.Text, MessageBoxButtons.OK);
             }
         }
     }
     catch (Exception ex) { App.ReportError(ex, true, Argix.Terminals.LogLevel.Error); }
 }
Esempio n. 9
0
        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; }
        }
Esempio n. 10
0
        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; }
        }