Esempio n. 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            this.Hide();
            signin s = new signin();

            s.Show();
        }
Esempio n. 2
0
        private void logout_Click(object sender, EventArgs e)
        {
            signin si = new signin();

            si.Show();
            this.Hide();
        }
Esempio n. 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            signin s = new signin();

            s.hosp.add_cure(textBox2.Text, Int32.Parse(textBox1.Text));
            //   s.hosp.save();
            // s.hosp.load();
            s.hosp.save_pharmacy();
            s.hosp.load_pharmacy();
            MessageBox.Show("Successfully added");
        }
Esempio n. 4
0
        private void buy_Click(object sender, EventArgs e)
        {
            signin s   = new signin();
            bool   ans = s.hosp.buy_cure(textBox2.Text, Int32.Parse(textBox1.Text));

            if (ans == true)
            {
                // s.hosp.save();
                //s.hosp.load();
                s.hosp.save_pharmacy();
                s.hosp.load_pharmacy();
                MessageBox.Show("Successful buying process");
            }
            else
            {
                MessageBox.Show("A failed purchase");
            }
        }
Esempio n. 5
0
        private void display_Click(object sender, EventArgs e)
        {
            //henaaaaaa
            signin        s   = new signin(); //
            List <string> doc = new List <string>();

            s.hosp.doctor_spiciality(special.Text, ref doc);
            MessageBox.Show(doc.Count.ToString());
            if (doc.Count == 0)
            {
                MessageBox.Show("NOT FOUND.");
            }
            else
            {
                richTextBox1.Clear();

                for (int i = 0; i < doc.Count; i++)
                {
                    richTextBox1.Text += doc[i] + "\n";
                }
            }
        }
Esempio n. 6
0
        private void register_Click(object sender, EventArgs e)
        {
            if (textBox2.Text != "" && textBox3.Text != "" && comboBox1.Text != "" && textBox4.Text != "" && textBox5.Text != "" && textBox6.Text != "" && textBox7.Text != "" && male.Checked == true || female.Checked == true)
            {
                if (s.hosp.available(textBox3.Text))
                {
                    if (comboBox1.Text == "doctor")
                    {
                        doctor d = new doctor(textBox2.Text, textBox6.Text, textBox7.Text, Int32.Parse(textBox5.Text), textBox1.Text);
                        s.hosp.add_doctor(d);
                        //s.hosp.save();
                        s.hosp.save_doctor();
                        s.hosp.save_pharmacy();
                        account a = new account(textBox3.Text, textBox4.Text, textBox2.Text, comboBox1.Text);
                        s.hosp.add_account(a);
                        //  s.hosp.save();
                        s.hosp.save_accounts();
                        MessageBox.Show("successfully Registered");
                        signin x = new signin();
                        this.Hide();
                        x.Show();
                    }
                    else if (comboBox1.Text == "pharmacist")
                    {
                        doctor d = new doctor(textBox2.Text, textBox6.Text, textBox7.Text, Int32.Parse(textBox5.Text), "pharmacist");
                        s.hosp.add_doctor(d);
                        //s.hosp.save();
                        s.hosp.save_doctor();
                        s.hosp.save_pharmacy();
                        account a = new account(textBox3.Text, textBox4.Text, textBox2.Text, comboBox1.Text);
                        s.hosp.add_account(a);
                        //  s.hosp.save();
                        s.hosp.save_accounts();
                        MessageBox.Show("successfully Registered");
                        signin x = new signin();
                        this.Hide();
                        x.Show();
                    }

                    else if (comboBox1.Text == "receptionist")
                    {
                        account a = new account(textBox3.Text, textBox4.Text, textBox2.Text, comboBox1.Text);
                        s.hosp.add_account(a);
                        //s.hosp.save();
                        s.hosp.save_accounts();
                        MessageBox.Show("successfully Registered");
                        signin x = new signin();
                        this.Hide();
                        x.Show();
                    }
                }
                else
                {
                    MessageBox.Show("This E-mail Is Already Exist");
                }
            }
            else
            {
                MessageBox.Show("Please enter all your information");
            }
        }