Пример #1
0
        public CafeTeria()
        {
            InitializeComponent();
            items       = new DatabaseClasses.Cafeteria_DataHelper();
            orders      = new List <Classes.Cafeteria>();
            myCafeteria = new Cafeteria(20, "Coffee", 5);
            phidget     = new phidget();

            try
            {
                phidget.OpenRFID();
                phidget.RFID.Tag += new RFIDTagEventHandler(AssignRFID);
                //   phidget.RFID.Tag += new RFIDTagEventHandler(RFIDTagNr);
                if (RFIDTagNr == null)
                {
                    MessageBox.Show("Please scan the rfid chip");
                }
            }
            catch (Exception)
            {
                MessageBox.Show("There was an error opening the rfid reader.");
            }
        }
Пример #2
0
        public CafeTeria()
        {
            InitializeComponent();
            INVOICE = new Invoice_DH();
            items   = new DatabaseClasses.Cafeteria_DataHelper();
            orders  = new List <Classes.Cafeteria>();
            //  myCafeteria = new Cafeteria(20,"Coffee",5);

            foreach (var v in items.getItems())
            {
                if (v.ItemNr == 1)
                {
                    drink1.Text = v.Name;
                }
                if (v.ItemNr == 2)
                {
                    drink2.Text = v.Name;
                }
                if (v.ItemNr == 3)
                {
                    drink3.Text = v.Name;
                }
                if (v.ItemNr == 4)
                {
                    drink4.Text = v.Name;
                }
                if (v.ItemNr == 5)
                {
                    drink5.Text = v.Name;
                }
                if (v.ItemNr == 6)
                {
                    drink6.Text = v.Name;
                }
                if (v.ItemNr == 7)
                {
                    drink7.Text = v.Name;
                }
                if (v.ItemNr == 8)
                {
                    drink8.Text = v.Name;
                }
                if (v.ItemNr == 9)
                {
                    drink9.Text = v.Name;
                }
                if (v.ItemNr == 10)
                {
                    drink10.Text = v.Name;
                }
                if (v.ItemNr == 11)
                {
                    drink11.Text = v.Name;
                }
                if (v.ItemNr == 12)
                {
                    drink12.Text = v.Name;
                }
                if (v.ItemNr == 13)
                {
                    drink13.Text = v.Name;
                }
                if (v.ItemNr == 14)
                {
                    drink14.Text = v.Name;
                }
                if (v.ItemNr == 15)
                {
                    drink15.Text = v.Name;
                }
                if (v.ItemNr == 16)
                {
                    drink16.Text = v.Name;
                }
                if (v.ItemNr == 17)
                {
                    drink17.Text = v.Name;
                }
                if (v.ItemNr == 18)
                {
                    drink18.Text = v.Name;
                }
                if (v.ItemNr == 19)
                {
                    food19.Text = v.Name;
                }
                if (v.ItemNr == 20)
                {
                    food20.Text = v.Name;
                }
                if (v.ItemNr == 21)
                {
                    food21.Text = v.Name;
                }
                if (v.ItemNr == 22)
                {
                    food22.Text = v.Name;
                }
                if (v.ItemNr == 23)
                {
                    food23.Text = v.Name;
                }
                if (v.ItemNr == 24)
                {
                    food24.Text = v.Name;
                }
                if (v.ItemNr == 25)
                {
                    food25.Text = v.Name;
                }
                if (v.ItemNr == 26)
                {
                    food26.Text = v.Name;
                }
                if (v.ItemNr == 27)
                {
                    food27.Text = v.Name;
                }
                if (v.ItemNr == 28)
                {
                    food28.Text = v.Name;
                }
                if (v.ItemNr == 29)
                {
                    food29.Text = v.Name;
                }
                if (v.ItemNr == 30)
                {
                    food30.Text = v.Name;
                }
                if (v.ItemNr == 31)
                {
                    food31.Text = v.Name;
                }
                if (v.ItemNr == 32)
                {
                    food32.Text = v.Name;
                }
                if (v.ItemNr == 33)
                {
                    food33.Text = v.Name;
                }
                if (v.ItemNr == 34)
                {
                    food34.Text = v.Name;
                }
                if (v.ItemNr == 35)
                {
                    food35.Text = v.Name;
                }
            }
            phidget = new phidget();

            try
            {
                phidget.OpenRFID();
                phidget.RFID.Tag += new RFIDTagEventHandler(AssignRFID);
                // phidget.RFID.Tag += new RFIDTagEventHandler(RFIDTagNr);
            }
            catch (Exception)
            {
                MessageBox.Show("There was an error opening the rfid reader.");
            }

            //  MessageBox.Show("Note:itemNr has to be assigned to a product according to the button itemnr");
        }