예제 #1
0
 private void Tables_Load(object sender, EventArgs e)
 {
     Context = new SystemRFIDsEntities();
     historyvisitBindingSource.DataSource = Context.history_visit.ToList();
     carscRFIDBindingSource.DataSource    = Context.cars_c_RFID.ToList();
     statusactiveBindingSource.DataSource = Context.status_active.ToList();
     carsBindingSource.DataSource         = Context.cars.ToList();
     typecarBindingSource.DataSource      = Context.type_car.ToList();
     rFIDmetkiBindingSource.DataSource    = Context.RFID_metki.ToList();
     listaccessBindingSource.DataSource   = Context.list_access.ToList();
     chauffeursBindingSource.DataSource   = Context.chauffeurs.ToList();
 }
예제 #2
0
 public Main()
 {
     InitializeComponent();
     Context = new SystemRFIDsEntities();
     try
     {
         // Подключение к считывателю.
         // Подключение по введенному IP или имени  считывателя
         reader.Connect("");
         if (reader.IsConnected)
         {
             Random rand = new Random();
             TimerTags.Interval = rand.Next(10000, 15000);
             TimerTags.Enabled  = true;
             // Подготовка к считыванию
             if (!reader.QueryStatus().IsSingulating)
             {
                 // Старт считывания
                 reader.Start();
                 Add_RoSpec();
                 Enable_RoSpec();
             }
             //Вызов метода отображения информации с меток
             reader.TagsReported += OnTagsReported;
         }
         else
         {
             MessageBox.Show("Считыватель не подключен!", "Подключение...", MessageBoxButtons.OK);
             TimerTags.Enabled = false;
             Random rand = new Random();
             TimerTags.Interval = rand.Next(10000, 15000);
             fsettings.ShowDialog();
             TimerTags.Enabled = true;
         }
     }
     catch (OctaneSdkException ex)
     {
         // Ошибка пакета Octane
         MessageBox.Show(ex.Message);
     }
     catch (Exception ex)
     {
         // Ошибки программы
         MessageBox.Show(ex.Message);
     }
 }