コード例 #1
0
        private void OnMenuClick(object sender, System.EventArgs e)
        {
            //Event handler for menu selection
            try {
                ToolStripDropDownItem menu = (ToolStripDropDownItem)sender;
                switch (menu.Text)
                {
                case MNU_FILE_NEW_PALLET:       this.mPallet = null; this.userProcess = "NewPallet"; break;

                case MNU_FILE_REMOVECARTON:     this.userProcess = "RemoveCarton";  break;

                case MNU_FILE_EXIT:                             this.Close(); Application.Exit(); break;

                case MNU_VIEW_TOOLBAR:                  this.tlbMain.Visible = (this.mnuViewToolbar.Checked = (!this.mnuViewToolbar.Checked)); break;

                case MNU_VIEW_STATUSBAR:                this.stbMain.Visible = (this.mnuViewStatusBar.Checked = (!this.mnuViewStatusBar.Checked)); break;

                case MNU_TOOLS_CONFIG:          App.ShowConfig(); break;

                case MNU_TOOLS_DIAGNOSTICS:     App.ShowDiagnostics(); break;

                case MNU_TOOLS_TRACE:           App.ShowTrace();  break;

                case MNU_TOOLS_USEWEBSVC:
                    dlgLogin login = new dlgLogin(App.Config.MISPassword);
                    login.ValidateEntry();
                    if (login.IsValid)
                    {
                        this.Cursor = Cursors.WaitCursor;
                        this.mMessageMgr.AddMessage("Resetting the application configuration...");
                        Application.DoEvents();
                        App.UseWebSvc = this.mnuToolsUseWebSvc.Checked = (!this.mnuToolsUseWebSvc.Checked);
                        configApplication();
                        // this.mnuViewRefresh.PerformClick();
                        this.setUserServices();     //MK not sure if this is needed, have one in finally
                    }
                    break;

                case MNU_HELP_ABOUT:                    new dlgAbout(App.Product + " Application", App.Version, App.Copyright, App.Configuration).ShowDialog(this); break;
                }
            }
            catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); }
            finally { setUserServices(); this.Cursor = Cursors.Default; }
        }
コード例 #2
0
        public static Pallet GetPallet(string labelSequenceNumber)
        {
            //Return a pallet
            Pallet   pallet   = null;
            PalletDS palletDS = new PalletDS();
            DataSet  ds       = null;

            try
            {
                ds = Mediator.FillDataset(App.USP_BMCPALLETGET, App.TBL_PALLET, new object[] { labelSequenceNumber });
                palletDS.Merge(ds, false, MissingSchemaAction.Ignore);
                if (palletDS.PalletTable.Rows.Count > 0)
                {
                    pallet = new Pallet((PalletDS.PalletTableRow)palletDS.PalletTable.Rows[0]);
                }
            }
            catch (Exception ex) { throw new ApplicationException("Failed to get pallet.", ex); }
            return(pallet);
        }
コード例 #3
0
 private void txbPallet_TextChanged(object sender, EventArgs e)
 {
     if (txbPallet.Text.Length == ARGIX_BARCODE_LENGTH)
     {
         try
         {
             mPallet = SortBMCFactory.GetPallet(txbPallet.Text.Substring(10, 13));
             if (mPallet == null)
             {
                 throw new Exception("Pallet " + txbPallet.Text + " not found or not available for sort");
             }
             updatePalletFields();
             //Pallet good - startscanning cartons
             this.userProcess = USER_PROCESS_SCAN_CARTON;
         }  catch (Exception ex)
         {
             App.ReportError(ex, true, LogLevel.Warning);
         }
         this.adjustUIProcessFields();
     }
 }