private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     Img1.Source = Img2.Source = Img3.Source = Img4.Source = Img5.Source = Img6.Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + "cross-icon.png", UriKind.Absolute));
     timerStart();
     WpfApp1.marathonDataSet marathonDataSet = ((WpfApp1.marathonDataSet)(this.FindResource("marathonDataSet")));
     marathonDataSetTableAdapters.Registration1TableAdapter registration1TableAdapter = new marathonDataSetTableAdapters.Registration1TableAdapter();
     registration1TableAdapter.A(marathonDataSet.Registration1);
     TypeA0.Text = TypeA1.Text = TypeA2.Text = marathonDataSet.Registration1[0][1].ToString();
     registration1TableAdapter.B(marathonDataSet.Registration1);
     TypeB0.Text = TypeB1.Text = TypeB2.Text = TypeB3.Text = TypeB4.Text = marathonDataSet.Registration1[0][1].ToString();
     registration1TableAdapter.C(marathonDataSet.Registration1);
     TypeC0.Text = TypeC1.Text = TypeC2.Text = TypeC3.Text = TypeC4.Text = TypeC5.Text = TypeC6.Text = marathonDataSet.Registration1[0][1].ToString();
     marathonDataSetTableAdapters.InventoryTableAdapter inventoryTableAdapter = new marathonDataSetTableAdapters.InventoryTableAdapter();
     inventoryTableAdapter.Fill(marathonDataSet.Inventory);
     neob0.Text = Convert.ToString(Convert.ToInt32(TypeA0.Text) + Convert.ToInt32(TypeB0.Text) + Convert.ToInt32(TypeC0.Text));
     neob1.Text = Convert.ToString(Convert.ToInt32(TypeA1.Text) + Convert.ToInt32(TypeB1.Text) + Convert.ToInt32(TypeC1.Text));
     neob2.Text = Convert.ToString(Convert.ToInt32(TypeA2.Text) + Convert.ToInt32(TypeB2.Text) + Convert.ToInt32(TypeC2.Text));
     neob3.Text = Convert.ToString(Convert.ToInt32(TypeB3.Text) + Convert.ToInt32(TypeC3.Text));
     neob4.Text = Convert.ToString(Convert.ToInt32(TypeB4.Text) + Convert.ToInt32(TypeC4.Text));
     neob5.Text = Convert.ToString(Convert.ToInt32(TypeC5.Text));
     neob6.Text = Convert.ToString(Convert.ToInt32(TypeC6.Text));
     ost1.Text  = marathonDataSet.Inventory[0][2].ToString();
     ost2.Text  = marathonDataSet.Inventory[1][2].ToString();
     ost3.Text  = marathonDataSet.Inventory[2][2].ToString();
     ost4.Text  = marathonDataSet.Inventory[3][2].ToString();
     ost5.Text  = marathonDataSet.Inventory[4][2].ToString();
     ost6.Text  = marathonDataSet.Inventory[5][2].ToString();
 }
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            NewInventory newInventory = new NewInventory();

            newInventory.ShowDialog();
            WpfApp1.marathonDataSet marathonDataSet = ((WpfApp1.marathonDataSet)(FindResource("marathonDataSet")));
            marathonDataSetTableAdapters.InventoryTableAdapter inventoryTableAdapter = new marathonDataSetTableAdapters.InventoryTableAdapter();
            inventoryTableAdapter.Fill(marathonDataSet.Inventory);
            ost1.Text = marathonDataSet.Inventory[0][2].ToString();
            ost2.Text = marathonDataSet.Inventory[1][2].ToString();
            ost3.Text = marathonDataSet.Inventory[2][2].ToString();
            ost4.Text = marathonDataSet.Inventory[3][2].ToString();
            ost5.Text = marathonDataSet.Inventory[4][2].ToString();
            ost6.Text = marathonDataSet.Inventory[5][2].ToString();
        }
示例#3
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            WpfApp1.marathonDataSet marathonDataSet = ((WpfApp1.marathonDataSet)(this.FindResource("marathonDataSet")));
            marathonDataSetTableAdapters.InventoryTableAdapter inventoryTableAdapter = new marathonDataSetTableAdapters.InventoryTableAdapter();
            inventoryTableAdapter.Fill(marathonDataSet.Inventory);
            int num      = Convert.ToInt32(marathonDataSet.Inventory[0][2].ToString());;
            int rfid     = Convert.ToInt32(marathonDataSet.Inventory[1][2].ToString());
            int beis     = Convert.ToInt32(marathonDataSet.Inventory[2][2].ToString());
            int water    = Convert.ToInt32(marathonDataSet.Inventory[3][2].ToString());
            int fytbolka = Convert.ToInt32(marathonDataSet.Inventory[4][2].ToString());
            int bykl     = Convert.ToInt32(marathonDataSet.Inventory[5][2].ToString());

            inventoryTableAdapter.UpdateQuery("Номер", num + Convert.ToInt32(NumerTbox.Text));
            inventoryTableAdapter.UpdateQuery("RFID", rfid + Convert.ToInt32((Rfid.Text)));
            inventoryTableAdapter.UpdateQuery("Бейсболка", beis + Convert.ToInt32((beisbol.Text)));
            inventoryTableAdapter.UpdateQuery("Бутылка воды", water + Convert.ToInt32((WaterTbox.Text)));
            inventoryTableAdapter.UpdateQuery("Футболка", fytbolka + Convert.ToInt32((FytbTbox.Text)));
            inventoryTableAdapter.UpdateQuery("Сувенирный буклет", bykl + Convert.ToInt32((ByklTbox.Text)));
            Close();
        }