Beispiel #1
0
 void procedure_proc(object sender, program e)
 {
     try
     {
         if (e.subProc > 0)
         {
             this.Dispatcher.Invoke((Action)(() =>
             {
                 switch (e.subProc)
                 {
                     case 1:
                         frames(0);
                         break;
                     case 2:
                         frames(2);
                         break;
                 }
             }));
         }
     }
     catch (Exception ex)
     {
         log.write("app", ex.Message + "\r\n " + ex.TargetSite);
     }
 }
Beispiel #2
0
        void procedure_proc(object sender, program e)
        {
            try
            {
                if (e.subProc == 5)
                {
                    this.Dispatcher.Invoke((Action)(() =>
                    {

                        bottle b = bottle.getBottle(procedure.process);
                        this.btl_id.Content = (procedure.process + 1).ToString("00");
                        this.btl_name.Text = b.Name;
                        this.btl_vintage.Text = b.Vintage.ToString("0000");
                        this.btl_grower.Text = b.Grower;
                        this.btl_attribute.Text = b.Attribute;
                        this.btl_country.Text = b.Country;
                        this.btl_volume.Text = b.Volume.ToString();
                        this.btl_small.Text = (b.SmallPrice / 100).ToString("0.00");
                        this.btl_medium.Text = (b.MediumPrice / 100).ToString("0.00");
                        this.btl_large.Text = (b.LargePrice / 100).ToString("0.00");
                       // this.s_PLU.Text = b.SmallPLU;
                       // this.m_PLU.Text = b.SmallPLU;
                        //this.l_PLU.Text = b.SmallPLU;
                        this.btl_small_dose.Text = b.SmallDose.ToString();
                        this.btl_medium_dose.Text = b.MediumDose.ToString();
                        this.btl_large_dose.Text = b.LargeDose.ToString();

                         BrushConverter c = new BrushConverter();
                         Brush defaultB = (Brush)c.ConvertFromString("#FF327793");
                         this.btl_volume.Foreground = this.btl_vintage.Foreground  = defaultB;
                         this.btl_small.Foreground = this.btl_small_dose.Foreground = defaultB;
                         this.btl_medium.Foreground = this.btl_medium_dose.Foreground = defaultB;
                         this.btl_large.Foreground = this.btl_large_dose.Foreground = defaultB;

                    }));
                }
                if (e.subProc == 14 && procedure.page == 6)
                {
                    this.Dispatcher.Invoke((Action)(() =>
                    {
                        save();
                    }));
                }
            }
            catch (Exception ex)
            {
                log.write("app", ex.Message + "\r\n " + ex.TargetSite);
            }
        }
Beispiel #3
0
 void procedure_proc(object sender, program e)
 {
     try
     {
         if (e.subProc == 4)
         {
             this.Dispatcher.Invoke((Action)(() =>
             {
                 this.combo.Items.Clear();
                 for (int i = 1; i <= settings.Positions; i++)
                 {
                     this.combo.Items.Add(i.ToString());
                 }
                 if (this.combo.Items.Count > 0) this.combo.SelectedIndex = 0;
             }));
         }
     }
     catch (Exception ex)
     {
         log.write("app", ex.Message + "\r\n " + ex.TargetSite);
     }
 }
Beispiel #4
0
        void procedure_proc(object sender, program e)
        {
            try
            {
                if (e.subProc == 13)
                {
                    Thread load = new Thread(() =>
                    {
                        this.Dispatcher.Invoke((Action)(() =>
                        {
                            this.vatAmout.Text = AES2.Properties.Settings.Default.VAT.ToString();
                            this.sorry.Visibility = Visibility.Hidden;
                            reportTable.s.Clear();
                            this.bottles.ItemsSource = null;
                            if (COM.sp.IsOpen)
                            {
                                for (int i = 0; i < bottleList.list.Count; i++)
                                {
                                    bottle btl = bottleList.list[i];
                                    s.Add(new states()
                                    {
                                        position = i.ToString(),
                                        num_name = (i + 1).ToString() + ". " + btl.Name,
                                        vintage = btl.Vintage.ToString("0000"),
                                        grower_country = btl.Grower + ", " + btl.Country,
                                        small = price(btl.SmallPrice),
                                        medium = price(btl.MediumPrice),
                                        large = price(btl.LargePrice),
                                        volume = btl.Volume.ToString(),
                                        residue = btl.Residue.ToString(),
                                        height = residue(btl.Volume, btl.Residue),
                                        height2 = residue(btl.Volume, btl.Residue, 28)
                                    });
                                }

                                this.bottles.ItemsSource = s;
                            }
                            else
                            {
                                this.sorry.Visibility = Visibility.Visible;
                            }


                            List<string> l = SQL.getTables();
                            if (l != null)
                            {
                                this.revenueMachines.Items.Clear();
                                this.machines.Items.Clear();
                                foreach (string s in l)
                                {
                                    if (s == "machines") continue;
                                    this.revenueMachines.Items.Add(s);
                                    this.machines.Items.Add(s);
                                }

                                this.revenueMachines.SelectedIndex = 0;
                                this.machines.SelectedIndex = 0;
                            }

                        }));

                    });
                    load.IsBackground = true;
                    load.Start();
                }

                if (e.subProc == 14 && procedure.page == 4)
                {
                    COM.tx("dir", "log");
                }
            }
            catch (Exception ex)
            {
                log.write("app", ex.Message + "\r\n " + ex.TargetSite);
            }
        }