コード例 #1
0
        private void limited_report_button_Click(object sender, EventArgs e)
        {
            //taking selected dates from the user
            DateTime start = picker_from_form.Value;
            DateTime end   = picker_to_form.Value;

            //clear the panel for new data
            panel1.Controls.Clear();

            //add the interface for the limited report (buttons)

            panel1.Controls.Add(limited_report_button);
            panel1.Controls.Add(From_text_button);
            panel1.Controls.Add(To_text_button);
            panel1.Controls.Add(picker_from_form);
            panel1.Controls.Add(picker_to_form);

            //formating date into dd-mm-yyyy
            picker_from_form.Format       = DateTimePickerFormat.Custom;
            picker_from_form.CustomFormat = "dd-MM-yyyy";
            picker_to_form.Format         = DateTimePickerFormat.Custom;
            picker_to_form.CustomFormat   = "dd-MM-yyyy";

            //check if the dates are correct
            if (end <= DateTime.Today && start < end)
            {
                panel1.Controls.Add(SomerenUI.showLimitedRevenueReport(start, end));
            }
            else
            {
                //saying to a user to try again
                MessageBox.Show("Please, enter the valid dates ('from - to' and max. is 'today')", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
コード例 #2
0
        private void toolStripMenuItem2_Click_1(object sender, EventArgs e)
        {
            panel1.Controls.Clear();
            groupBox1.Text = "Rooms";

            panel1.Controls.Add(SomerenUI.showRooms());
        }
コード例 #3
0
        private void drinkUpdateBtn_Click(object sender, EventArgs e)
        {
            if (boxId.Text == "" || drinkNameBox.Text == "" || drinkPriceBox.Text == "" || drinkAmountBox.Text == "")
            {
                // show a message if a user did not enter a value
                MessageBox.Show("Please enter a value for all fields before clicking on Update", "",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                // reading data from the textboxes
                int     id     = int.Parse(boxId.Text);
                string  name   = drinkNameBox.Text;
                decimal price  = decimal.Parse(drinkPriceBox.Text);
                int     amount = int.Parse(drinkAmountBox.Text);

                // passing data to the UI layer
                SomerenUI.uppdateBarServiceUI(id, name, price, amount);

                // show a messagebox after clicking on update button
                MessageBox.Show("You have successfully updated a drink!!\n" +
                                "Enter Refresh the list to see the changes", "",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            // clearing data from textboxes
            drinkAmountBox.Clear();
            drinkNameBox.Clear();
            drinkPriceBox.Clear();
            boxId.Clear();
        }
コード例 #4
0
        private void drinkDeleteBtn_Click(object sender, EventArgs e)
        {
            if (boxId.Text == "")
            {
                // show a message if a user did not enter a value
                MessageBox.Show("Please enter a value for ID before clicking on Delete", "",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                if (MessageBox.Show("Are you sure that you want to remove this drink?", "Warning"
                                    , MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
                {
                    // reading data from the textboxes
                    int id = int.Parse(boxId.Text);

                    // passing data to the UI layer
                    SomerenUI.deleteBarServiceUI(id);

                    // show a messagebox after clicking on update button
                    MessageBox.Show("You have successfully deleted a drink!!\n " +
                                    "Enter Refresh the list to see the changes", "",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }

            // clearing data from textboxes
            drinkAmountBox.Clear();
            drinkNameBox.Clear();
            drinkPriceBox.Clear();
            boxId.Clear();
        }
コード例 #5
0
        private void Remove_super_Click(object sender, EventArgs e)
        {
            string remove = Remove_sup.Text;

            if (remove == "")
            {
                MessageBox.Show("You didn't enter a last name! Please, enter a last name.", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                if ((MessageBox.Show("Are you sure that you wish to remove this supervisor?", "Exit SomerenAdministration?",
                                     MessageBoxButtons.YesNo, MessageBoxIcon.Question,
                                     MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes))
                {
                    SomerenUI.RemoveSuper(remove);

                    panel1.Controls.Clear();
                    Remove_sup.Clear();

                    groupBox1.Text = "Supervisors";
                    panel1.Controls.Add(Remove_super);
                    panel1.Controls.Add(Remove_sup);
                    panel1.Controls.Add(Remove_s);
                    panel1.Controls.Add(Add_super);
                    panel1.Controls.Add(Add_sup);
                    panel1.Controls.Add(Add_s);
                    panel1.Controls.Add(SomerenUI.showListSupervisors());
                    MessageBox.Show("The supervisor was successfully removed!", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
コード例 #6
0
 private void toonDocentenToolStripMenuItem_Click(object sender, EventArgs e)
 {
     //groupBox1.Controls.Clear();
     panel1.Controls.Clear();                       // clear stuff on panel1
     groupBox1.Text = "Teachers";                   // set title of groupbox
     panel1.Controls.Add(SomerenUI.showTeachers()); // show table in panel1
 }
コード例 #7
0
        private void activityAddBtn_Click(object sender, EventArgs e)
        {
            SomerenModel.Activities one = new SomerenModel.Activities();
            if (activityDescBox.Text == "" || activityStudBox.Text == "" || activitySuperBox.Text == "")
            {
                // show a message if a user did not enter a value
                MessageBox.Show("Please enter a value for (Description, Number of Students, Number of Supervisors) " +
                                "fields before clicking on Add", "",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                // reading data from the textboxes
                string desc               = activityDescBox.Text;
                int    numberOfStudent    = int.Parse(activityStudBox.Text);
                int    numberOfSupervisor = int.Parse(activitySuperBox.Text);

                // passing data to the UI layer
                SomerenUI.addActivity(desc, numberOfStudent, numberOfSupervisor);
            }

            // clearing data from textboxes
            activityIdBox.Clear();
            activityDescBox.Clear();
            activityStudBox.Clear();
            activitySuperBox.Clear();
        }
コード例 #8
0
        private void activityUpdateBtn_Click(object sender, EventArgs e)
        {
            if (activityIdBox.Text == "" || activityDescBox.Text == "" ||
                activityStudBox.Text == "" || activitySuperBox.Text == "")
            {
                // show a message if a user did not enter a value
                MessageBox.Show("Please enter a value for all fields before clicking on Update", "",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                // reading data from the textboxes
                int    id                 = int.Parse(activityIdBox.Text);
                string desc               = activityDescBox.Text;
                int    numberOfStudent    = int.Parse(activityStudBox.Text);
                int    numberOfSupervisor = int.Parse(activitySuperBox.Text);

                // passing data to the UI layer
                SomerenUI.uppdateActivity(id, desc, numberOfStudent, numberOfSupervisor);

                // show a messagebox after clicking on update button
                MessageBox.Show("You have successfully updated a activity!!\n" +
                                "Enter Refresh the list to see the changes", "",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            // clearing data from textboxes
            activityIdBox.Clear();
            activityDescBox.Clear();
            activityStudBox.Clear();
            activitySuperBox.Clear();
        }
コード例 #9
0
        private void activityDeleteBtn_Click(object sender, EventArgs e)
        {
            if (activityIdBox.Text == "")
            {
                // show a message if a user did not enter a value
                MessageBox.Show("Please enter a value for ID before clicking on Delete", "",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                // reading data from the textboxes
                int id = int.Parse(activityIdBox.Text);

                if (MessageBox.Show("Are you sure that you wish to remove this activity?", "Warning"
                                    , MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
                {
                    // passing data to the UI layer
                    SomerenUI.deleteActivity(id);

                    // show a messagebox after clicking on update button
                    MessageBox.Show("You have successfully deleted a activity!!\n " +
                                    "Enter Refresh the list to see the changes", "",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }

            // clearing data from textboxes
            activityIdBox.Clear();
            activityDescBox.Clear();
            activityStudBox.Clear();
            activitySuperBox.Clear();
        }
コード例 #10
0
        //Door Juan
        private void kassaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.panel1.Controls.Clear();
            this.groupBox1.Text = "Studenten";
            studentenList       = SomerenUI.showStudents();

            drankenList = SomerenUI.showDrankVoorraad();

            drankenList.Location = new Point(85, 0);

            studentenList.HideSelection = false;
            studentenList.FullRowSelect = true;

            drankenList.HideSelection = false;
            drankenList.FullRowSelect = true;

            this.panel1.Controls.Add(studentenList);
            this.panel1.Controls.Add(drankenList);


            Button afrekenen = new Button();

            afrekenen.Text = "Afrekenen";
            this.panel1.Controls.Add(afrekenen);

            afrekenen.Location = new Point(490, 200);

            afrekenen.Click += afrekenenEvent;
        }
コード例 #11
0
 private void drankvoorraadToolStripMenuItem_Click(object sender, EventArgs e)
 {
     // Made by: Davut
     this.panel1.Controls.Clear();
     this.groupBox1.Text = "DrankVoorraad";
     this.panel1.Controls.Add(SomerenUI.showDrankVoorraad());
 }
コード例 #12
0
 //Door Joost
 private void monthCalendar_DateSelected(object sender, DateRangeEventArgs e)
 {
     //Text = "Start = " + e.Start.ToShortDateString() +
     //    " : End = " + e.End.ToShortDateString();
     SomerenUI.getOmzetrapportage(ref infolabel, e.Start, e.End);
     infolabel.AutoSize = true;
     infolabel.Location = new Point(0, 200);
 }
コード例 #13
0
        private void roosterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            panel1.Controls.Clear();
            groupBox1.Text = "Timetable";

            Control[] controls = SomerenUI.showTimetable();
            panel1.Controls.AddRange(controls);

            // The third control is the button.  We want to reload everything after
            // saving so we just attach this menu item's click handler to the button
            // as well
            controls[3].Click += roosterToolStripMenuItem_Click;
        }
コード例 #14
0
        private void begeleidersToolStripMenuItem_Click(object sender, EventArgs e)
        {
            panel1.Controls.Clear();
            groupBox1.Text = "Supervisors";

            panel1.Controls.Add(Remove_super);
            panel1.Controls.Add(Remove_sup);
            panel1.Controls.Add(Remove_s);
            panel1.Controls.Add(Add_super);
            panel1.Controls.Add(Add_sup);
            panel1.Controls.Add(Add_s);
            panel1.Controls.Add(SomerenUI.showListSupervisors());
        }
コード例 #15
0
        private void activiteitenlijstToolStripMenuItem_Click(object sender, EventArgs e)
        {
            panel1.Controls.Clear();
            groupBox1.Text = "Activity List";
            panel1.Controls.Add(SomerenUI.showActivity());

            panel1.Controls.Add(activityAddBtn);
            panel1.Controls.Add(activityDeleteBtn);
            panel1.Controls.Add(activityUpdateBtn);
            panel1.Controls.Add(activityRefreshBtn);
            panel1.Controls.Add(activityIdBox);
            panel1.Controls.Add(activityDescBox);
            panel1.Controls.Add(activityStudBox);
            panel1.Controls.Add(activitySuperBox);
            panel1.Controls.Add(activityIdLbl);
            panel1.Controls.Add(activityStuLbl);
            panel1.Controls.Add(activityDescLbl);
            panel1.Controls.Add(activitySupLbl);
            panel1.Controls.Add(LblInstructions);
        }
コード例 #16
0
        private void omzetrapportageToolStripMenuItem_Click(object sender, EventArgs e)
        {
            panel1.Controls.Clear();
            groupBox1.Text = "The Revenue Report";
            panel1.Controls.Add(SomerenUI.showRevenueReport());

            //add the interface for the report (calendar and button)

            panel1.Controls.Add(picker_from_form);
            panel1.Controls.Add(picker_to_form);
            panel1.Controls.Add(From_text_button);
            panel1.Controls.Add(To_text_button);
            panel1.Controls.Add(limited_report_button);

            //formating date into dd-mm-yyyy
            picker_from_form.Format       = DateTimePickerFormat.Custom;
            picker_from_form.CustomFormat = "dd-MM-yyyy";
            picker_to_form.Format         = DateTimePickerFormat.Custom;
            picker_to_form.CustomFormat   = "dd-MM-yyyy";
        }
コード例 #17
0
        private void activityRefreshBtn_Click(object sender, EventArgs e)
        {
            panel1.Controls.Clear();                       // clear stuff on panel1
            groupBox1.Text = "Activity List";              // set title of groupbox
            panel1.Controls.Add(SomerenUI.showActivity()); // show table in panel1

            // add buttons and labels to the panel after refreshing the list
            panel1.Controls.Add(activityAddBtn);
            panel1.Controls.Add(activityDeleteBtn);
            panel1.Controls.Add(activityUpdateBtn);
            panel1.Controls.Add(activityRefreshBtn);
            panel1.Controls.Add(activityIdBox);
            panel1.Controls.Add(activityDescBox);
            panel1.Controls.Add(activityStudBox);
            panel1.Controls.Add(activitySuperBox);
            panel1.Controls.Add(activityIdLbl);
            panel1.Controls.Add(activityStuLbl);
            panel1.Controls.Add(activityDescLbl);
            panel1.Controls.Add(activitySupLbl);
            panel1.Controls.Add(LblInstructions);
        }
コード例 #18
0
        private void refreshBtn_Click(object sender, EventArgs e)
        {
            panel1.Controls.Clear();                         // clear stuff on panel1
            groupBox1.Text = "Bar Service";                  // set title of groupbox
            panel1.Controls.Add(SomerenUI.showBarService()); // show table in panel1

            // add buttons and labels to the panel after refreshing the list
            panel1.Controls.Add(drinkAddBtn);
            panel1.Controls.Add(drinkDeleteBtn);
            panel1.Controls.Add(drinkUpdateBtn);
            panel1.Controls.Add(drinkNameLbl);
            panel1.Controls.Add(drinkPriceLbl);
            panel1.Controls.Add(drinkAmountLbl);
            panel1.Controls.Add(drinkAmountBox);
            panel1.Controls.Add(drinkNameBox);
            panel1.Controls.Add(drinkPriceBox);
            panel1.Controls.Add(refreshBtn);
            panel1.Controls.Add(LblInstructions);
            panel1.Controls.Add(boxId);
            panel1.Controls.Add(lblId);
        }
コード例 #19
0
        private void Add_super_Click(object sender, EventArgs e)
        {
            string add = Add_sup.Text;

            if (add == "")
            {
                MessageBox.Show("You didn't enter a last name! Please, enter a last name.", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            SomerenUI.AddSuper(add);

            panel1.Controls.Clear();
            Add_sup.Clear();

            groupBox1.Text = "Supervisors";
            panel1.Controls.Add(Remove_super);
            panel1.Controls.Add(Remove_sup);
            panel1.Controls.Add(Remove_s);
            panel1.Controls.Add(Add_super);
            panel1.Controls.Add(Add_sup);
            panel1.Controls.Add(Add_s);
            panel1.Controls.Add(SomerenUI.showListSupervisors());
        }
コード例 #20
0
        //Door Juan
        //06-04-17, opdracht 6, variant A
        private void activiteitenlijstToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.panel1.Controls.Clear();
            this.groupBox1.Text = "Activiteitenlijst";
            activiteit          = SomerenUI.showActiviteiten();
            this.panel1.Controls.Add(activiteit);

            activiteit.HideSelection = false;
            activiteit.FullRowSelect = true;

            Button btn_activiteitToevoegen = new Button();

            btn_activiteitToevoegen.Text  = "Activiteit toevoegen";
            btn_activiteitToevoegen.Width = 150;
            this.panel1.Controls.Add(btn_activiteitToevoegen);
            btn_activiteitToevoegen.Location = new Point(410, 30);

            btn_activiteitToevoegen.Click += toevoegenEvent;

            Button btn_updateActiviteit = new Button();

            btn_updateActiviteit.Text  = "Activiteit wijzigen";
            btn_updateActiviteit.Width = 150;
            this.panel1.Controls.Add(btn_updateActiviteit);
            btn_updateActiviteit.Location = new Point(410, 70);


            btn_updateActiviteit.Click += wijzigenEvent;

            Button btn_deleteActiviteit = new Button();

            btn_deleteActiviteit.Text  = "Activiteit verwijderen";
            btn_deleteActiviteit.Width = 150;
            this.panel1.Controls.Add(btn_deleteActiviteit);
            btn_deleteActiviteit.Location = new Point(410, 110);

            btn_deleteActiviteit.Click += deleteEvent;
        }
コード例 #21
0
        public void begeleidersToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.panel1.Controls.Clear();
            this.groupBox1.Text = "Begeleiders";
            this.panel1.Controls.Add(SomerenUI.ShowBegeleiders());

            // voeg een tekstveld zodat de gebruiker een ID kan invullen
            this.panel1.Controls.Add(txt_id);
            txt_id.Location = new Point(370, 180);
            txt_id.Width    = 125;

            // Label voor het duidelijk maken van wat je kan doen
            Label lbl_id = new Label();

            lbl_id.Text     = "Geef de ID van de docent/begeleider";
            lbl_id.Location = new Point(350, 165);
            lbl_id.Width    = 200;
            this.panel1.Controls.Add(lbl_id);

            // button voor nieuwe begeleiders
            Button nieuweBegeleider = new Button();

            nieuweBegeleider.Text  = "Nieuwe Begeleider";
            nieuweBegeleider.Width = 125;
            this.panel1.Controls.Add(nieuweBegeleider);
            nieuweBegeleider.Location = new Point(300, 200);
            nieuweBegeleider.Click   += BegeleiderInsertEvent;

            // nieuwe button voor verwijderen van een begeleider
            Button begeleiderVerwijder = new Button();

            begeleiderVerwijder.Text  = "Begeleider Verwijderen";
            begeleiderVerwijder.Width = 125;
            this.panel1.Controls.Add(begeleiderVerwijder);
            begeleiderVerwijder.Location = new Point(440, 200);
            begeleiderVerwijder.Click   += BegeleiderDeleteEvent;
        }
コード例 #22
0
 private void toolStripMenuItem2_Click(object sender, EventArgs e)
 {
     this.panel1.Controls.Clear();
     this.groupBox1.Text = "Kamers";
     this.panel1.Controls.Add(SomerenUI.showKamers());
 }
コード例 #23
0
 private void toolStripMenuItem6_Click(object sender, EventArgs e)
 {
     this.panel1.Controls.Clear();                       // clear stuff on panel
     this.groupBox1.Text = "Students";                   // set name for groupbox
     this.panel1.Controls.Add(SomerenUI.showStudents()); // add data to the panel
 }
コード例 #24
0
 private void toolStripMenuItem2_Click(object sender, EventArgs e)
 {
     panel1.Controls.Clear();                    // clear stuff on panel
     groupBox1.Text = "Rooms";                   // set name for groupbox
     panel1.Controls.Add(SomerenUI.showRooms()); // add data to the panel
 }
コード例 #25
0
 private void toonDocentenToolStripMenuItem_Click(object sender, EventArgs e)
 {
     this.panel1.Controls.Clear();
     this.groupBox1.Text = "Docenten";
     this.panel1.Controls.Add(SomerenUI.showTeachers());
 }
コード例 #26
0
 private void toolStripMenuItem9_Click(object sender, EventArgs e)
 {
     SomerenUI.showStudents();
 }
コード例 #27
0
 private void kassaToolStripMenuItem_Click(object sender, EventArgs e)
 {
     panel1.Controls.Clear();
     groupBox1.Text = "Cashier";
     panel1.Controls.AddRange(SomerenUI.showCashier());
 }