Пример #1
0
 public frmSetNest(ref BarCode br)
 {
     InitializeComponent();
       _scanner = new BaseScannerControl(OnScan, this);
       _scanner.Init();
       _br = br;
 }
Пример #2
0
 private void frmSetNest_Closing(object sender, CancelEventArgs e)
 {
     if (_scanner != null)
       {
     _scanner.Close();
     _scanner = null;
       }
 }
Пример #3
0
 private void frmMain_Closing(object sender, CancelEventArgs e)
 {
     DialogResult res = MessageBox.Show(
     "Вы уверены, что хотите выйти из программы?"
     , "Выход из программы", MessageBoxButtons.YesNo
     , MessageBoxIcon.Question
     , MessageBoxDefaultButton.Button2);
       if (res == DialogResult.No)
       {
     e.Cancel = true;
       }
       else
       {
     new DataMemento().RemoveState();
     if (_scanner != null)
     {
       _scanner.Close();
       _scanner = null;
     }
       }
 }
Пример #4
0
        private void btnCollect_Click(object sender, EventArgs e)
        {
            if (_scanner != null)
              {
            _scanner.Close();
            _scanner = null;
              }
              BarCode br = new BarCode();
              frmSetAtm form = new frmSetAtm(ref br);
              form.Focus();
              if (form.ShowDialog() == DialogResult.OK)
              {
            if (br.IsEmpty == false)
            {
              lblAtmNumber.Text = br.BarCodeData;
              lblAtmNumber.ForeColor = Color.Red;
              _brAtm = br;
              //btnAddNest.Enabled = true;
              //btnAddNest.Focus();
              btnCollect.Text = "След. банкомат";
              btnClear.Enabled = false;
            }
              }
              else
              {
            //TODO:if the barcode is empty
              }

              if (_brAtm.IsEmpty == false)
              {
            _scanner = new BaseScannerControl(OnScan, this);
            _scanner.Init();
              }
        }