Exemplo n.º 1
0
        private void btnWyp_Click(object sender, RoutedEventArgs e)
        {
            if (cmbItem.SelectedIndex != -1 && cmbId.SelectedIndex != -1)
            {
                //set do bazy danych
                dataBaseManager.SetHire(imgtmpQR.ToolTip.ToString().ToUpper(), cmbItem.Text, cmbId.Text, DateTime.Today.ToShortDateString());
                Refresh_bindedData();

                cmbItem.SelectedIndex = -1;
                cmbId.SelectedIndex   = -1;
                lblSelItemQR.Content  = "";
                SelectedQRItem.Source = null;
                count_down            = count_down_started;

                txtAvailableItems.Text = "0";

                btnWyp.FontWeight  = FontWeights.Normal;
                btnzwrot.IsEnabled = true;
                btnWyp.ToolTip     = null;
            }

            if (cmbItem.SelectedIndex >= 0 && cmbItem.SelectedIndex <= 6)
            {
                if (dataBaseManager.TakeBattery(cmbItem.Text, Battery_toRent))
                {
                    System.Windows.MessageBox.Show("Done");
                }
                else
                {
                    System.Windows.MessageBox.Show("Error");
                }
                cmbItem.SelectedIndex = -1;
            }
        }
Exemplo n.º 2
0
        private void btnWyp_Click(object sender, RoutedEventArgs e)
        {
            if (cmbItem.SelectedIndex != -1 && cmbId.SelectedIndex != -1)
            {
                //set do bazy danych
                dataBaseManager.SetHire(imgtmpQR.ToolTip.ToString().ToUpper(), cmbItem.Text, cmbId.Text, DateTime.Today.ToShortDateString());
                Refresh_bindedData();

                cmbItem.SelectedIndex = -1;
                cmbId.SelectedIndex   = -1;
                lblSelItemQR.Content  = "";
                SelectedQRItem.Source = null;
                count_down            = count_down_started;
                lblCounter.Background = new SolidColorBrush(Colors.White);
                if (rbnQRmode.IsChecked.Value)
                {
                    txtQRtoreadandfind.Focus();
                    dispatcherTimer_test.Start();
                }
                txtAvailableItems.Text = "0";
                btnWyp.FontWeight      = FontWeights.Normal;
                btnzwrot.IsEnabled     = true;
            }
        }