private void metroButtonDelete_Click(object sender, EventArgs e)
        {
            //MetroFramework.MetroMessageBox.Show(this, "Hi There!");
            BLL.UserInfoHandler u = new BLL.UserInfoHandler();
            if (comboBoxAccType.Text == "Admin")
            {
                bool m = u.DeleteAdminInfo(metroTextBoxUsername.Text);
                if (m == true)
                {
                    MetroFramework.MetroMessageBox.Show(this, "Admin Account Deleted Successfully!");
                }
                else
                {
                    MetroFramework.MetroMessageBox.Show(this, "No Such Account Found!");
                }
            }


            else if (comboBoxAccType.Text == "Doctor")
            {
                bool m = u.DeleteDocInfo(metroTextBoxUsername.Text);
                if (m == true)
                {
                    MetroFramework.MetroMessageBox.Show(this, "Doctor Account Deleted Successfully!");
                }
                else
                {
                    MetroFramework.MetroMessageBox.Show(this, "No Such Account Found!");
                }
            }


            else if (comboBoxAccType.Text == "Receptionist")
            {
                bool m = u.DeleteReceptionistInfo(metroTextBoxUsername.Text);
                if (m == true)
                {
                    MetroFramework.MetroMessageBox.Show(this, "Receptionist Account Deleted Successfully!");
                }
                else
                {
                    MetroFramework.MetroMessageBox.Show(this, "No Such Account Found!");
                }
            }
            else
            {
                MetroFramework.MetroMessageBox.Show(this, "Please select Account Type");
            }
        }
Example #2
0
 private void metroButtonAddPatient_Click(object sender, EventArgs e)
 {
     if (metroTextBoxPhoneNo.Text != "" && metroTextBoxName.Text != "" && metroTextBoxContactAddress.Text != "")
     {
         BLL.UserInfoHandler ui = new BLL.UserInfoHandler();
         bool bx = ui.AddPatient(metroTextBoxName.Text, metroTextBoxPhoneNo.Text, metroTextBoxContactAddress.Text);
         if (bx == true)
         {
             MetroFramework.MetroMessageBox.Show(this, "Patient Added!");
             initializePhoneNoComboBox();
         }
         else
         {
             MetroFramework.MetroMessageBox.Show(this, "Failed!");
         }
     }
     else
     {
         MetroFramework.MetroMessageBox.Show(this, "Please Enter All Values");
     }
 }
        //Admin
        //Doctor
        //Receptionist
        private void metroButtonViewAll_Click(object sender, EventArgs e)
        {
            BLL.UserInfoHandler u = new BLL.UserInfoHandler();

            if (comboBoxAccType.Text == "Admin")
            {
                var           a  = u.viewAllAdmin();
                BindingSource bi = new BindingSource();
                bi.DataSource = a;

                ViewAll v = new ViewAll();
                v.changeValues(bi, "Admins", "EmployeeAccounts");
                v.Show();
            }
            else if (comboBoxAccType.Text == "Doctor")
            {
                List <DAL.Doctor> a  = u.viewAllDoctors();
                BindingSource     bi = new BindingSource();
                bi.DataSource = a;

                ViewAll v = new ViewAll();
                v.changeValues(bi, "Doctors", "EmployeeAccounts");
                v.Show();
            }
            else if (comboBoxAccType.Text == "Receptionist")
            {
                List <DAL.Receptionist> a  = u.viewAllReceptionists();
                BindingSource           bi = new BindingSource();
                bi.DataSource = a;

                ViewAll v = new ViewAll();
                v.changeValues(bi, "Receptionists", "EmployeeAccounts");
                v.Show();
            }
            else
            {
                MetroFramework.MetroMessageBox.Show(this, "Please Select Account Type.");
            }
        }