Beispiel #1
0
        private void button7_Click(object sender, EventArgs e)
        {
            clear();
            panel4.Visible = true;
            AddStuff      doctorINFOrmation = new AddStuff();
            List <string> DoctorInfo        = doctorINFOrmation.doctorINFO(this.special_id);

            textBox34.Text = DoctorInfo[0];
            textBox30.Text = DoctorInfo[1];
            textBox35.Text = DoctorInfo[2];
            textBox29.Text = DoctorInfo[3];
            textBox22.Text = DoctorInfo[4];
            textBox26.Text = DoctorInfo[5];
            textBox23.Text = DoctorInfo[6];
            textBox36.Text = DoctorInfo[7];
            textBox37.Text = DoctorInfo[8];
        }
Beispiel #2
0
        private void button7_Click(object sender, EventArgs e)
        {
            clear();
            panel4.Visible = true;
            AddStuff      pharmacyinfo = new AddStuff();
            List <string> phINFO       = pharmacyinfo.PHINFO(this.special_id);

            textBox30.Text = phINFO[1];
            if (textBox30.Text != "")
            {
                textBox30.Enabled = false;
            }
            textBox29.Text = phINFO[0];
            textBox26.Text = phINFO[5];
            textBox17.Text = phINFO[3];
            textBox23.Text = phINFO[2];
            if (textBox23.Text != "")
            {
                textBox23.Enabled = false;
            }
            textBox18.Text = phINFO[4];
        }
        private void button7_Click(object sender, EventArgs e)
        {
            Clera();
            panel4.Visible = true;
            AddStuff      receptionistInformaion = new AddStuff();
            List <string> ReceptINFO             = receptionistInformaion.ReceptionistInformation(this.special_id);

            textBox30.Text = ReceptINFO[1];
            if (textBox30.Text != "")
            {
                textBox30.Enabled = false;
            }
            textBox29.Text = ReceptINFO[0];
            textBox26.Text = ReceptINFO[5];
            textBox19.Text = ReceptINFO[3];
            textBox23.Text = ReceptINFO[2];
            if (textBox23.Text != "")
            {
                textBox23.Enabled = false;
            }
            textBox18.Text = ReceptINFO[4];
        }
Beispiel #4
0
        }//null input

        private void button7_Click(object sender, EventArgs e)//admin personal information
        {
            hidepanels();
            panel3.Visible = true;
            AddStuff      admininformation = new AddStuff();
            List <string> AdminINFO        = admininformation.AdminInformation(this.special_id);

            textBox30.Text = AdminINFO[1];
            if (textBox30.Text != "")
            {
                textBox30.Enabled = false;
            }
            textBox29.Text = AdminINFO[0];
            textBox26.Text = AdminINFO[5];
            textBox17.Text = AdminINFO[3];
            textBox23.Text = AdminINFO[2];
            if (textBox23.Text != "")
            {
                textBox23.Enabled = false;
            }
            textBox18.Text = AdminINFO[4];
        }
Beispiel #5
0
        private void button13_Click(object sender, EventArgs e)
        {
            AddStuff updatePharmacy = new AddStuff();

            updatePharmacy.UpdatePharmacy(textBox29.Text, this.special_id, textBox17.Text, int.Parse(textBox26.Text), textBox18.Text, textBox23.Text);
        }
Beispiel #6
0
        private void button15_Click(object sender, EventArgs e)
        {
            AddStuff UPDATEDOCTOR = new AddStuff();

            UPDATEDOCTOR.updatedoctorinformation(this.special_id, textBox30.Text, textBox35.Text, textBox29.Text, textBox22.Text, textBox26.Text, textBox23.Text, textBox36.Text, textBox37.Text);
        }
        private void button15_Click(object sender, EventArgs e)
        {
            AddStuff updateReceptionistInformation = new AddStuff();

            updateReceptionistInformation.UpdateReceptionistInformation(this.special_id, textBox19.Text, textBox23.Text);
        }
Beispiel #8
0
        }//AddNewStuff panel2

        private void button10_Click(object sender, EventArgs e)//adding new stuff
        {
            if (comboBox1.Text == "Admin")
            {
                try
                {
                    AddStuff newAdmin = new AddStuff();
                    newAdmin.AddAdmin(textBox3.Text, textBox5.Text, textBox2.Text, textBox8.Text + textBox16.Text, textBox10.Text, textBox15.Text, int.Parse(textBox7.Text), textBox20.Text);
                    if (checkemail(textBox10.Text))
                    {
                        sendmessage(textBox10.Text, textBox2.Text, textBox5.Text);
                    }
                    MessageBox.Show($"Successfully registered {textBox2.Text}!", "Register completed", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    comboBox1.Text = "Select Type";
                    restorNewStuffInformation();
                }
                catch (Exception)
                {
                    MessageBox.Show("Invalid details", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else if (comboBox1.Text == "Pharmacist")
            {
                try
                {
                    AddStuff newPH  = new AddStuff();
                    string   gender = null;
                    if (radioButton1.Checked)
                    {
                        gender = radioButton1.Text;
                    }
                    else if (radioButton2.Checked)
                    {
                        gender = radioButton2.Text;
                    }
                    else
                    {
                        gender = radioButton3.Text;
                    }
                    string timing = textBox13.Text + comboBox4.Text + " " + textBox14.Text + comboBox3.Text;
                    newPH.AddPharmacist(textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, gender, int.Parse(textBox7.Text), textBox8.Text + textBox16.Text, textBox9.Text, textBox10.Text, textBox11.Text, textBox12.Text, timing, textBox15.Text, textBox20.Text);
                    if (checkemail(textBox10.Text))
                    {
                        sendmessage(textBox10.Text, textBox2.Text, textBox5.Text);
                    }
                    MessageBox.Show($"Successfully registered {textBox2.Text}!", "Register completed", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    restorNewStuffInformation();
                    comboBox1.Text = "Select Type";
                }
                catch (Exception)
                {
                    MessageBox.Show("Please check the values", "Wrong input", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else if (comboBox1.Text == "Doctor")
            {
                try
                {
                    AddStuff newDoctor = new AddStuff();
                    string   gender    = null;
                    if (radioButton1.Checked)
                    {
                        gender = radioButton1.Text;
                    }
                    else if (radioButton2.Checked)
                    {
                        gender = radioButton2.Text;
                    }
                    else
                    {
                        gender = radioButton3.Text;
                    }
                    string timing = textBox13.Text + comboBox4.Text + " - " + textBox14.Text + comboBox3.Text;
                    newDoctor.AddDoctor(textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, gender, int.Parse(textBox7.Text), textBox8.Text + textBox16.Text, textBox9.Text, textBox10.Text, textBox11.Text, textBox12.Text, textBox1.Text, timing, textBox15.Text, textBox20.Text);
                    if (checkemail(textBox10.Text))
                    {
                        sendmessage(textBox10.Text, textBox2.Text, textBox5.Text);
                    }
                    MessageBox.Show($"Successfully registered {textBox2.Text}!", "Register completed", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    restorNewStuffInformation();
                    comboBox1.Text = "Select Type";
                }
                catch (Exception)
                {
                    MessageBox.Show("Please check the values", "Wrong input", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else if (comboBox1.Text == "Receptionist")
            {
                try
                {
                    AddStuff newreceptionist = new AddStuff();
                    string   gender          = null;
                    if (radioButton1.Checked)
                    {
                        gender = radioButton1.Text;
                    }
                    else if (radioButton2.Checked)
                    {
                        gender = radioButton2.Text;
                    }
                    else
                    {
                        gender = radioButton3.Text;
                    }
                    string timing = textBox13.Text + comboBox4.Text + " - " + textBox14.Text + comboBox3.Text;
                    newreceptionist.Addreceptionist(textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, gender, int.Parse(textBox7.Text), textBox8.Text + textBox16.Text, textBox9.Text, textBox10.Text, textBox11.Text, textBox12.Text, textBox1.Text, timing, textBox15.Text, textBox20.Text);
                    if (checkemail(textBox10.Text))
                    {
                        sendmessage(textBox10.Text, textBox2.Text, textBox5.Text);
                    }
                    MessageBox.Show($"Successfully registered {textBox2.Text}!", "Register completed", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    restorNewStuffInformation();
                    comboBox1.Text = "Select Type";
                }
                catch (Exception)
                {
                    MessageBox.Show("Please check the values", "Wrong input", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Please select Staff Type", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }//storenewstuff
Beispiel #9
0
        private void button13_Click(object sender, EventArgs e)//update Admin information
        {
            AddStuff updateadmininformation = new AddStuff();

            updateadmininformation.UpdateAdminInformation(textBox29.Text, this.special_id, textBox17.Text, int.Parse(textBox26.Text), textBox18.Text);
        }
Beispiel #10
0
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     //generating IDs and passwords
     if (comboBox1.Text == "Select Type")
     {
         restorNewStuffInformation();
     }
     else if (comboBox1.Text == "Admin")
     {
         restorNewStuffInformation();
         textBox1.Enabled     = false;
         textBox4.Enabled     = false;
         label10.Enabled      = false;
         label12.Enabled      = false;
         label16.Enabled      = false;
         label21.Enabled      = false;
         label22.Enabled      = false;
         label17.Enabled      = false;
         label18.Enabled      = false;
         radioButton1.Enabled = false;
         radioButton2.Enabled = false;
         radioButton3.Enabled = false;
         textBox11.Enabled    = false;
         textBox12.Enabled    = false;
         textBox14.Enabled    = false;
         comboBox4.Enabled    = false;
         textBox13.Enabled    = false;
         comboBox3.Enabled    = false;
         AddStuff adminid = new AddStuff();
         string   n       = adminid.findLastAdminID().Remove(0, 1);
         textBox2.Text = "A" + (int.Parse(n) + 1);
         textBox5.Text = textBox2.Text;
     }
     else if (comboBox1.Text == "Pharmacist")
     {
         restorNewStuffInformation();
         AddStuff      stffid = new AddStuff();
         List <string> vs     = stffid.findallPHID();
         Random        rand   = new Random();
         do
         {
             int s = rand.Next(100, 999);
             textBox2.Text = "PH" + s;
         } while (vs.Contains(textBox2.Text));
         textBox5.Text = textBox2.Text;
     }
     else if (comboBox1.Text == "Doctor")
     {
         restorNewStuffInformation();
         AddStuff      stffid = new AddStuff();
         List <string> vs     = stffid.findall_D_ID();
         Random        rand   = new Random();
         do
         {
             int s = rand.Next(100, 999);
             textBox2.Text = "D" + s;
         } while (vs.Contains(textBox2.Text));
         textBox5.Text = textBox2.Text;
     }
     else if (comboBox1.Text == "Receptionist")
     {
         restorNewStuffInformation();
         AddStuff      stffid = new AddStuff();
         List <string> vs     = stffid.findall_R_ID();
         Random        rand   = new Random();
         do
         {
             int s = rand.Next(100, 999);
             textBox2.Text = "R" + s;
         } while (vs.Contains(textBox2.Text));
         textBox5.Text = textBox2.Text;
     }
 }