Esempio n. 1
0
        private void showA2()
        {
            try
            {
                Ca_price.Clear();
                Ca_Day.Clear();
                Ca_year.Clear();
                Ca_mounth.Clear();
                Ca_index.Clear();
                var       capt      = new Assest.Capt2();
                DataTable datatable = new DataTable();
                DataTable Comput    = new DataTable();
                capt.show(datatable);
                foreach (DataRow dr in datatable.Rows)
                {
                    Ca_price.Add(dr.Field <string>("PRICE"));
                    Ca_Day.Add(dr.Field <string>("MOUNTH"));  //mounth
                    Ca_year.Add(dr.Field <string>("DAY"));
                    Ca_mounth.Add(dr.Field <string>("YEAR")); //year
                }

                object       JCmpute;
                ComboBoxItem C  = (ComboBoxItem)A2.SelectedItem;
                string       C2 = C.Content.ToString();

                for (int i = 0; i < Ca_Day.Count; i++)
                {
                    if (Ca_Day[i] == C2)
                    {
                        Ca_index.Add(Ca_price[i]);
                    }
                    if (Ca_Day[i] == 12.ToString())
                    {
                        capt.Updating3("0");
                    }
                }
                Comput.Clear();
                Comput.Columns.Add("D");
                DataRow Drr;
                int     loool = 0;

                for (int i = 0; i < Ca_index.Count; i++)
                {
                    Drr      = Comput.NewRow();
                    Drr["D"] = Ca_index[i];
                    Comput.Rows.Add(Drr);
                    loool += int.Parse(Ca_index[i]);
                }
                price1.Text = loool.ToString();
            }
            catch (Exception ex) { }
        }
Esempio n. 2
0
 private void Window_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         try {
             publicbar.Add(Barcode.Text);
             k100_();
             if (Exists == 1)
             {
                 NameList.Add(Name.Text);
                 PriceList.Add(price.Text);
                 var Capt = new Assest.Capt2();
                 Capt.Insert(price.Text, DateTime.Now.Day.ToString(),
                             DateTime.Now.Month.ToString(), DateTime.Now.Year.ToString(), DateTime.Now.ToString(), Name.Text);
             }
         }catch (Exception ex) {  }
     }
 }
Esempio n. 3
0
        private void showA1()
        {
            try
            {
                Ca_price.Clear();
                Ca_Day.Clear();
                Ca_year.Clear();
                Ca_mounth.Clear();
                Ca_index.Clear();


                var       capt      = new Assest.Capt2();
                DataTable datatable = new DataTable();
                DataTable Comput    = new DataTable();
                DataTable Maxe      = new DataTable();
                var       asd       = new Assest.orcDataacess4();

                capt.show(datatable);
                asd.Show(datatable);


                object JCmpute;

                foreach (DataRow dr in datatable.Rows)
                {
                    Ca_price.Add(dr.Field <string>("PRICE"));
                    Ca_Day.Add(dr.Field <string>("YEAR"));      //mounth
                    Ca_year.Add(dr.Field <string>("DAY"));
                    Ca_mounth.Add(dr.Field <string>("MOUNTH")); //year
                }
                DataRow      Drr;
                ComboBoxItem C  = (ComboBoxItem)A1.SelectedItem;
                string       C2 = C.Content.ToString();
                for (int i = 0; i < Ca_price.Count; i++)
                {
                    if (Ca_year[i] == C2)
                    {
                        Ca_index.Add(Ca_price[i]);
                        price2.Text = "0.00";
                        price1.Text = "0.00";
                    }
                    if (Ca_year[i] == 30.ToString())
                    {
                        var edit_day = new Assest.Capt2();
                        edit_day.Updating2("0");
                    }
                }
                Comput.Clear();
                Comput.Columns.Add("D");
                Int32 loool = 0;

                for (int i = 0; i < Ca_index.Count; i++)
                {
                    Drr      = Comput.NewRow();
                    Drr["D"] = Ca_index[i];
                    Comput.Rows.Add(Drr);
                    loool += Int32.Parse(Ca_index[i]);
                }
                price.Text = loool.ToString();
            }
            catch (Exception ex) { }
        }