Ejemplo n.º 1
0
        public void ResetModifyStock()
        {
            try
            {
                //ClEAR ALL INFO
                txtModifyDrinksName.Clear();
                txtModifyDrinksSoled.Clear();
                txtModifyDrinksStock.Clear();
                cbModifyDrinksAlcohol.Checked = false;
                cbSelectDrinksName.Items.Clear();
                tbModifyDrinksSellprice.Value = 1;

                cbModifyDrinksBTW.Items.Clear();
                cbModifyDrinksBTW.DropDownStyle = ComboBoxStyle.DropDownList;
                cbModifyDrinksBTW.Items.Add(9);
                cbModifyDrinksBTW.Items.Add(21);

                cbSelectDrinksName.DropDownStyle = ComboBoxStyle.DropDownList;
                SomerenLogic.Stock_Service stock_Service = new SomerenLogic.Stock_Service();
                List <Stock> stockpiles = stock_Service.GetStocks();
                stockpiles = stockpiles.OrderBy(stockpile => stockpile.Name).ToList();
                foreach (Stock stockpile in stockpiles)
                {
                    cbSelectDrinksName.Items.Add(stockpile.Name);
                }
                cbIAmSure.Checked = false;
            }
            catch (Exception exception)
            {
                Catch(exception);
                lblModifyStockLogOutput.Text += exception.Message;
            }
        }
Ejemplo n.º 2
0
        private void stockToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            showPanel("Students");
            lbl_Students.Text = ("Stock");
            listViewStudents.Items.Clear();

            SomerenLogic.Stock_Service stockService = new SomerenLogic.Stock_Service();
            List <Stock> stockList = stockService.GetStock();

            foreach (SomerenModel.Stock s in stockList)
            {
                ListViewItem li = new ListViewItem(s.Name.ToString());
                listViewStudents.Items.Add(li);
            }
        }
Ejemplo n.º 3
0
        private void showPanel(string panelName)
        {
            if (panelName == "Dashboard")
            {
                // hide all other panels
                pnl_Students.Hide();
                pnl_CashRegister.Hide();

                // show dashboard
                pnl_Dashboard.Show();
                img_Dashboard.Show();
            }
            else if (panelName == "Students")
            {
                // hide all other panels
                pnl_Dashboard.Hide();
                img_Dashboard.Hide();
                pnl_CashRegister.Hide();


                // show students
                pnl_Students.Show();



                // fill the students listview within the students panel with a list of students
                SomerenLogic.Student_Service studService = new SomerenLogic.Student_Service();
                List <Student> studentList = studService.GetStudents();

                // clear the listview before filling it again
                listViewStudents.Items.Clear();

                // TODO: Listview Aanpassen

                foreach (SomerenModel.Student s in studentList)
                {
                    ListViewItem li = new ListViewItem(s.Name);
                    listViewStudents.Items.Add(li);
                }
            }
            else if (panelName == "Cash Register")
            {
                // hide all other panels
                pnl_Dashboard.Hide();
                img_Dashboard.Hide();
                //pnl_Students.Hide();

                // show Cash Register
                pnl_Students.Show();
                pnl_CashRegister.Show();
                //pnl_Students.Show();

                SomerenLogic.Student_Service studService = new SomerenLogic.Student_Service();
                List <Student> studentList = studService.GetStudents();


                lv_RegisterStudent.Clear();
                lv_RegisterStock.Clear();

                foreach (SomerenModel.Student s in studentList)
                {
                    ListViewItem li = new ListViewItem(s.Name);

                    lv_RegisterStudent.Items.Add(li);
                }

                SomerenLogic.Stock_Service stockService = new SomerenLogic.Stock_Service();
                List <Stock> stockList = stockService.GetStock();

                foreach (SomerenModel.Stock v in stockList)
                {
                    ListViewItem li = new ListViewItem(v.Name);
                    lv_RegisterStock.Items.Add(li);
                }
            }
        }