Exemplo n.º 1
0
        private void ScanWareHouse_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {
                this.Close();
            }
            else if (e.KeyCode == Keys.F1)
            {
                switch (ScanOperation)
                {
                case ListScanOperation.MXView:
                {
                    if (_view == null)
                    {
                        _view = new WareHouseView("MX0262.0006029");
                        _view.Show();
                    }
                    else
                    {
                        _view.Close();
                        // _scan.Dispose();
                        _view = new WareHouseView("MX0262.0006029");
                        _view.Show();
                    }
                    break;
                }

                case ListScanOperation.EUShip:
                {        //Для теста
                    ///TN = "S0001500000106002016";
                    if (_ship == null)
                    {
                        _ship = new EUShip(bcr, "S0001500000147412017");
                        _ship.Show();
                    }
                    else
                    {
                        if (_ship.FormActive)
                        {
                            return;
                        }

                        _ship.Close();
                        // _scan.Dispose();
                        _ship = new EUShip(bcr, "S0001500000147412017");
                        _ship.Show();
                    }
                }
                break;
                }
            }
        }
Exemplo n.º 2
0
        void bcr_BarcodeReadScanWareHouse(object sender, BarcodeReadEventArgs bre)
        {
            try
            {
                string EU = bre.strDataBuffer;
                //заюзаем новую дичь, в зависимости от кода операции будем использовать ту или иную дичь

                switch (ScanOperation)
                {
                case ListScanOperation.MXView:
                {
                    if (EU.IndexOf("MX") == 0)
                    {        //
                        if (_view == null)
                        {
                            _view = new WareHouseView(EU);
                            _view.Show();
                        }
                        else
                        {
                            _view.Close();
                            // _scan.Dispose();
                            _view = new WareHouseView(EU);
                            _view.Show();
                        }
                    }
                    break;
                }

                case ListScanOperation.EUShip:
                {
                    if (EU.IndexOf("S") == 0)
                    {        //Это вагонная карта
                        ///TN = "S0001500000106002016";
                        if (_ship == null)
                        {
                            _ship = new EUShip(bcr, EU);
                            _ship.Show();
                        }
                        else
                        {
                            if (_ship.FormActive)
                            {
                                return;
                            }

                            _ship.Close();
                            // _scan.Dispose();
                            _ship = new EUShip(bcr, EU);
                            _ship.Show();
                        }
                    }
                    break;
                }
                }
            }
            catch (Exception exp)
            {
                CLog.WriteException("ScanWareHouse.cs", "bcr_BarcodeReadScanWareHouse", exp.Message);
                //MessageBox.Show(exp.Message);
            }
        }