public BestellingOpnemen()
        {
            InitializeComponent();
            FillComboBox();
            Login_Service login_Service = Login_Service.GetLoginService();

            FillLoggedIn();
            lbl_Datum.Text         = DateTime.Now.ToString("d");
            listViewMenuItems.View = View.Tile;
            ImageList imageList = new ImageList();

            imageList.ImageSize = new Size(32, 32);
            //load images from resources

            try
            {
                imageList.Images.Add(Properties.Resources._18plusdranken);
                imageList.Images.Add(Properties.Resources.dranken);
                imageList.Images.Add(Properties.Resources.food);
            }
            catch (Exception e) //afbeeldingen kunnen niet worden gevonden/geladen
            {
                MessageBox.Show("De afbeeldingen kunnen niet worden geladen. De menukaarten worden zonder afbeeldingen getoond.", "Foutmelding", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            listViewMenuItems.SmallImageList = imageList;
            listViewMenuItems.LargeImageList = imageList;
        }
        private void btn_logout_Click(object sender, EventArgs e)
        {
            Login         login        = Login.GetLoginScreen();
            Login_Service loginservice = Login_Service.GetLoginService();

            loginservice.LogoutEmployee();
            login.Show();
            this.Hide();
        }
        public KeukenBar()
        {
            InitializeComponent();

            Login_Service login_Service = Login_Service.GetLoginService();

            lbl_User.Text           = "Ingelogd: " + login_Service.CurrentEmployee.Firstname + " " + login_Service.CurrentEmployee.Lastname;
            tlp_OrderGrid.GrowStyle = TableLayoutPanelGrowStyle.AddRows;
        }
Esempio n. 4
0
        public BestellingOpnemen()
        {
            InitializeComponent();
            Login_Service login_Service = Login_Service.GetLoginService();

            FillLoggedIn();
            FillCurrentTable();
            lbl_Datum.Text         = DateTime.Now.ToString("d");
            listViewMenuItems.View = View.Tile;
        }
        public static Hub GetHubScreen()
        {
            Login_Service service = Login_Service.GetLoginService();


            if (_uniqueHub == null)
            {
                _uniqueHub = new Hub();
            }
            return(_uniqueHub);
        }
        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_Checkout.BackColor          = Color.SkyBlue;
                btn_TableOverview.BackColor     = Color.SkyBlue;
                btn_Bar.BackColor               = Color.Red;
                btn_Keuken.BackColor            = Color.Red;
                btn_BestellingOpnemen.BackColor = Color.SkyBlue;
                break;

            case 2:
                btn_Checkout.BackColor          = Color.Red;
                btn_TableOverview.BackColor     = Color.Red;
                btn_Bar.BackColor               = Color.Red;
                btn_Keuken.BackColor            = Color.SkyBlue;
                btn_BestellingOpnemen.BackColor = Color.Red;
                break;

            case 3:
                btn_Checkout.BackColor          = Color.Red;
                btn_TableOverview.BackColor     = Color.Red;
                btn_Bar.BackColor               = Color.SkyBlue;
                btn_Keuken.BackColor            = Color.Red;
                btn_BestellingOpnemen.BackColor = Color.Red;
                break;

            case 4:
                btn_Checkout.BackColor          = Color.Red;
                btn_TableOverview.BackColor     = Color.Red;
                btn_Bar.BackColor               = Color.SkyBlue;
                btn_Keuken.BackColor            = Color.Red;
                btn_BestellingOpnemen.BackColor = Color.Red;
                break;

            case 5:
                btn_Checkout.BackColor          = Color.SkyBlue;
                btn_TableOverview.BackColor     = Color.SkyBlue;
                btn_Bar.BackColor               = Color.SkyBlue;
                btn_Keuken.BackColor            = Color.SkyBlue;
                btn_BestellingOpnemen.BackColor = Color.SkyBlue;
                break;
            }
        }
        private void Btn_BestellingOpnemen_Click(object sender, EventArgs e)
        {
            Login_Service service = Login_Service.GetLoginService();

            if (service.CurrentEmployee.FunctionID == 1 || service.CurrentEmployee.FunctionID == 5)
            {
                BestellingOpnemen bestellingOpnemen = BestellingOpnemen.GetOrderScreen();
                bestellingOpnemen.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Je hebt geen toestemming tot het 'Bestelling opnemen' scherm.", "Foutmelding", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btn_Checkout_Click(object sender, EventArgs e)
        {
            Login_Service service = Login_Service.GetLoginService();

            if (service.CurrentEmployee.FunctionID == 1 || service.CurrentEmployee.FunctionID == 5)
            {
                Afreken co = Afreken.GetAfrekenScreen();
                co.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Je hebt geen toestemming om op het 'Betaalscherm' te komen.", "Foutmelding", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        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_Bar_Click(object sender, EventArgs e)
        {
            Login_Service service = Login_Service.GetLoginService();

            if (service.CurrentEmployee.FunctionID == 3 || service.CurrentEmployee.FunctionID == 4 || service.CurrentEmployee.FunctionID == 5)
            {
                KeukenBar kb = KeukenBar.GetKeukenBar();
                kb.Show();
                kb.ReloadPage("Bar");
                this.Hide();
            }
            else
            {
                MessageBox.Show("Je hebt geen toestemming tot het 'Bar' scherm.", "Foutmelding", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 11
0
        private void Btn_BestellingPlaatsen_Click(object sender, EventArgs e) //bestellingen versturen naar db
        {
            int recentOrderID = 0;

            if (listViewWinkelwagen.Items.Count == 0) //check of alle velden zijn ingevuld
            {
                MessageBox.Show("Vul alle velden in.", "Foutmelding", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                Table            currentTable     = Table.GetTable();
                MenuItem_Service menuItem_Service = MenuItem_Service.GetMenuItemService();
                Table_Service    table_Service    = Table_Service.GetTableService();
                Login_Service    s = Login_Service.GetLoginService();
                int reservationID  = table_Service.GetReservationID(currentTable.currentTable.TableID); //reservationID vinden van betreffende tafel
                if (reservationID == 0)
                {
                    MessageBox.Show("Er is geen reservering voor deze tafel.", "Foutmelding", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    Order_Service service = Order_Service.GetOrderService();
                    if (service.PlaceOrder(reservationID, s.CurrentEmployee.Id))
                    {
                        recentOrderID = GetMostRecentOrderID();
                        List <MenuOrder> menuOrders    = new List <MenuOrder>();
                        MenuOrder_DAO    menuOrder_DAO = new MenuOrder_DAO();
                        foreach (ListViewItem li in listViewWinkelwagen.Items) //Lijst met MenuOrders maken vanuit winkelwagen
                        {
                            Model.MenuOrder menuOrder = new MenuOrder(int.Parse(li.SubItems[1].Text), recentOrderID, menuItem_Service.GetMenuItemID(li.Text));
                            menuOrders.Add(menuOrder);
                        }
                        foreach (MenuOrder menuOrder in menuOrders) //lijst met menuOrders naar db sturen
                        {
                            menuOrder_DAO.PlaceMenuOrder(menuOrder.Amount, menuOrder.OrderID, menuOrder.MenuItemID);
                            menuOrder_DAO.UpdateStock(menuOrder.Amount, menuOrder.MenuItemID);
                        }
                        OrderPlaced();
                        this.Refresh(); //zet scherm weer op default
                    }
                    else
                    {
                        MessageBox.Show("Niet gelukt om de order te maken.", "Foutmelding", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
        public void ReloadPage(string OrderType)
        {
            Login_Service service = Login_Service.GetLoginService();

            lbl_User.Text = "Ingelogd: " + service.CurrentEmployee.Firstname + " " + service.CurrentEmployee.Lastname;

            switch (OrderType)
            {
            case "Keuken":
                MakeKitchenOrders();
                break;

            case "Bar":
                MakeBarOrders();
                break;

            default:
                break;
            }
            this.Refresh();
        }
Esempio n. 13
0
        public void FillLoggedIn()
        {
            Login_Service login_Service = Login_Service.GetLoginService();

            lbl_CurrentEmployee.Text = "Ingelogd: " + login_Service.CurrentEmployee.Firstname + " " + login_Service.CurrentEmployee.Lastname;
        }
Esempio n. 14
0
 public Login()
 {
     _uniqueLogin = this;
     InitializeComponent();
     _login_service = Login_Service.GetLoginService();
 }
        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;
            }
        }