Exemplo n.º 1
0
 public static Tafeloverzicht GetTafeloverzichtScreen()
 {
     if (_uniqueTafeloverzicht == null)
     {
         _uniqueTafeloverzicht = new Tafeloverzicht();
     }
     return(_uniqueTafeloverzicht);
 }
        private void btn_TableOverview_Click(object sender, EventArgs e)
        {
            Login_Service service = Login_Service.GetLoginService();

            if (service.CurrentEmployee.FunctionID == 1 || service.CurrentEmployee.FunctionID == 5)
            {
                Tafeloverzicht to = Tafeloverzicht.GetTafeloverzichtScreen();
                to.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Je hebt geen toestemming om op het 'Tafeloverzicht' te komen.", "Foutmelding", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btn_afreken_Click(object sender, EventArgs e)
        {
            Payment_Service payment_Service = Payment_Service.GetPaymentService();

            if (radioButtonPIN.Checked || radioButtonContant.Checked)
            {
                double Money;
                bool   res = double.TryParse(textBoxFooi.Text, out Money);
                if (res == false)
                {
                    Money = 0;
                }
                else
                {
                    Money = double.Parse(textBoxFooi.Text);
                    if (Money < 0)
                    {
                        Money = 0;
                    }
                }

                int Payment;
                if (radioButtonPIN.Checked)
                {
                    Payment = 2;
                }
                else
                {
                    Payment = 3;
                }
                payment_Service.PlacePayment(Money, Payment);

                MessageBox.Show("Bestelling afgerekend.", "Gelukt!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Tafeloverzicht tafeloverzicht = Tafeloverzicht.GetTafeloverzichtScreen();
                tafeloverzicht.Show();
                tafeloverzicht.RefreshListView();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Kies een betaalmethode.", "Foutmelding", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public void GetColor() //bepaald kleuren voor hub knoppen
        {
            Login_Service service = Login_Service.GetLoginService();

            lbl_Ingelogd.Text = "Ingelogd: " + service.CurrentEmployee.Firstname + " " + service.CurrentEmployee.Lastname;
            int functionID = service.CurrentEmployee.FunctionID;

            switch (functionID)
            {
            case 1:
                btn_TableOverview.Visible     = true;
                btn_Checkout.Visible          = false;
                btn_TableOverview.BackColor   = Color.SkyBlue;
                btn_Bar.Visible               = false;
                btn_Keuken.Visible            = false;
                btn_BestellingOpnemen.Visible = false;
                btn_TableOverview.Location    = new Point(175, 57);
                Tafeloverzicht to = Tafeloverzicht.GetTafeloverzichtScreen();
                to.Show();
                break;

            case 2:
                btn_Keuken.Visible            = true;
                btn_Checkout.Visible          = false;
                btn_TableOverview.Visible     = false;
                btn_Bar.Visible               = false;
                btn_Keuken.BackColor          = Color.SkyBlue;
                btn_BestellingOpnemen.Visible = false;
                btn_Keuken.Location           = new Point(175, 57);
                KeukenBar kb = KeukenBar.GetKeukenBar();
                kb.Show();
                kb.ReloadPage("Keuken");
                break;

            case 3:
                btn_Bar.Visible               = true;
                btn_Checkout.Visible          = false;
                btn_TableOverview.Visible     = false;
                btn_Bar.BackColor             = Color.SkyBlue;
                btn_Keuken.Visible            = false;
                btn_BestellingOpnemen.Visible = false;
                btn_Bar.Location              = new Point(175, 57);
                KeukenBar kb1 = KeukenBar.GetKeukenBar();
                kb1.Show();
                kb1.ReloadPage("Bar");
                this.Hide(); break;

            case 4:
                btn_Bar.Visible               = true;
                btn_Checkout.Visible          = false;
                btn_TableOverview.Visible     = false;
                btn_Bar.BackColor             = Color.SkyBlue;
                btn_Keuken.Visible            = false;
                btn_BestellingOpnemen.Visible = false;
                btn_Bar.Location              = new Point(175, 57);
                KeukenBar kb2 = KeukenBar.GetKeukenBar();
                kb2.Show();
                kb2.ReloadPage("Bar");
                this.Hide(); break;

            case 5:
                btn_TableOverview.Visible     = true;
                btn_Bar.Visible               = true;
                btn_Keuken.Visible            = true;
                btn_Checkout.Visible          = false;
                btn_TableOverview.BackColor   = Color.SkyBlue;
                btn_Bar.BackColor             = Color.SkyBlue;
                btn_Keuken.BackColor          = Color.SkyBlue;
                btn_BestellingOpnemen.Visible = false;
                btn_Bar.Location              = new Point(10, 57);
                btn_TableOverview.Location    = new Point(175, 57);
                btn_Keuken.Location           = new Point(350, 57);
                break;
            }
        }