Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            bool check = ValidateForm();

            if (check == true)
            {
                string  role        = StatusList.GetItemText(StatusList.SelectedItem);
                string  name        = NameTbx.Text;
                string  email       = EmailTb.Text;
                string  password    = PasswordTbx.Text;
                string  phoneNumber = PhoneTbx.Text;
                string  address     = AddressTbx.Text;
                string  text        = "";
                Contact contact     = new Contact();

                if (role.Equals("CLIENT"))
                {
                    CustomerAccount client = new CustomerAccount();
                    int             group  = Int32.Parse(textBox1.Text);

                    text = client.addNewClient(name, password, group, email, phoneNumber, address);
                }
                else
                {
                    TeacherAccount staff = new TeacherAccount();
                    text = staff.addNewStaff(name, password, role, email, address, phoneNumber);
                }

                MessageBox.Show(text);
            }
        }
Beispiel #2
0
        private void ChangeBtn_Click(object sender, EventArgs e)
        {
            string nameRoom = ListRooms.GetItemText(ListRooms.SelectedItem);
            string status   = StatusList.GetItemText(StatusList.SelectedItem);
            string text     = room.changeStatusRoom(nameRoom, status);

            MessageBox.Show(text);
        }
Beispiel #3
0
        private void ChangeBtn_Click(object sender, EventArgs e)
        {
            TeacherAccount staff     = new TeacherAccount();
            string         staffName = listOfStaff.GetItemText(listOfStaff.SelectedItem);

            string email  = EmailTbx.Text;
            string phone  = PhoneTbx.Text;
            string status = StatusList.GetItemText(StatusList.SelectedItem);
            string text   = staff.changePermission(staffName, status, email, phone);
        }