예제 #1
0
 public UCHelpAppointment(doctor d)
 {
     InitializeComponent();
     MyInit();
     this.d = d;
     FreshDataGridView(d.id);
 }
예제 #2
0
        void enter(string login)
        {
            List <string> data = connector.enter(login);

            this.Visible = false;
            switch (data[0])
            {
            case "0":
                adminForm admin = new adminForm(connector);
                admin.ShowDialog();
                break;

            case "1":
                doctor doctorShow = new doctor(data[1]);
                doctorShow.ShowDialog();
                break;

            case "2":
                patient patientShow = new patient(data[1], connector);
                patientShow.ShowDialog();
                break;
            }
            this.Visible  = true;
            textBox1.Text = "";
            textBox2.Text = "";
        }
예제 #3
0
 public UCShowAppointment(doctor doc)
 {
     InitializeComponent();
     this.doc = doc;
     FreshDataGridView();
     comboBox1.Enabled = false;
     textBox1.Enabled  = false;
     button1.Enabled   = false;
 }
예제 #4
0
 public UCVacation(doctor D)
 {
     InitializeComponent();
     this.D         = D;
     this.id        = D.id;
     this.name      = D.name;
     comboBox1.Text = "上午";
     comboBox2.Text = "上午";
 }
예제 #5
0
 public UCChangeShifts(doctor doctor)
 {
     InitializeComponent();
     this.doctor    = doctor;
     id             = doctor.id;
     comboBox1.Text = "上午";
     comboBox2.Text = "上午";
     label4.Text    = "";
     //     button1.Enabled = false;
 }
예제 #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");
            }
        }
예제 #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            while (doctors.Count > 0)
            {
                for (int i = 0; i < doctors.Count; i++)
                {
                    doctors.Remove(doctors[i]);
                    listBox1.Items.RemoveAt(i);
                }
            }

            SqlConnection conn = new SqlConnection();

            conn.ConnectionString = @"Server=.\; Integrated Security=True;" +
                                    "Database=Hospital_Management";
            String name = d_nametext.Text;

            try
            {
                conn.Open();
            }
            catch (SqlException)
            {
                MessageBox.Show("Connection failed!");
            }

            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "SELECT doctors.id, name, doctors.lname, doctors.tel, doctors.address, " +
                              "doctors.e_area, h_name, h_location, image " +
                              "FROM Hospital_Management.dbo.Hospital, Hospital_Management.dbo.H_D, Hospital_Management.dbo.doctors " +
                              "WHERE Hospital.h_id=H_D.h_id AND doctors.id=H_D.d_id AND " +
                              "doctors." + comboBox1.SelectedItem.ToString() + "='" + d_nametext.Text + "';";
            cmd.Connection = conn;

            try
            {
                SqlDataReader rdr = cmd.ExecuteReader();
                for (int i = 0; rdr.Read() == true; i++)
                {
                    listBox1.Items.Add(rdr.GetValue(0).ToString());
                    doctor d = new doctor(
                        rdr.GetValue(0).ToString(),
                        rdr.GetValue(1).ToString(),
                        rdr.GetValue(2).ToString(),
                        rdr.GetValue(3).ToString(),
                        rdr.GetValue(4).ToString(),
                        rdr.GetValue(5).ToString(),
                        rdr.GetValue(6).ToString(),
                        rdr.GetValue(7).ToString(),
                        rdr.GetValue(8).ToString()
                        );
                    doctors.Add(d);
                    if (rdr.GetValue(8).ToString() == "")
                    {
                        doctors[i].Image = @"C:\Users\-ZaferAYAN-\Documents\Visual Studio 2012\Projects\Hospital\none.jpg";
                    }
                }
                if (doctors.Count > 1)
                {
                    listBox1.Visible = true;
                }
                idtext.Text         = doctors[0].ID;
                nametext.Text       = doctors[0].Name;
                lnametext.Text      = doctors[0].LName;
                phonetext.Text      = doctors[0].Tel;
                addresstext.Text    = doctors[0].Address;
                specialitytext.Text = doctors[0].E_area;
                hospitaltext.Text   = doctors[0].H_name;
                locationtext.Text   = doctors[0].H_location;
                pictureBox1.Image   = Image.FromFile(@"" + doctors[0].Image);
            }
            catch
            {
                if (doctors.Count == 0)
                {
                    MessageBox.Show(d_nametext.Text + " not found!");
                }
            }
            finally
            {
                conn.Close();
            }
        }
예제 #8
0
파일: login.cs 프로젝트: GM303/Hospital
        private void button1_Click(object sender, EventArgs e)
        {
            string account  = textBox1.Text;
            string password = Encrypt.MD5Encrypt32(textBox2.Text);

            if (radioButton1.Checked)
            {
                switch (AccountCheck(account, password, "patientAccount"))
                {
                case 0:
                    //  MessageBox.Show("验证成功");
                    if (IsFreeze(account) == 0)
                    {
                        patient ap = new patient(account);
                        ap.ShowDialog();
                    }
                    else
                    {
                        ReleaseFreezeApplication rfp = new ReleaseFreezeApplication();
                        rfp.ShowDialog();
                    }
                    break;

                case 1:
                    MessageBox.Show("账号不存在");
                    break;

                case 2:
                    MessageBox.Show("密码错误");
                    break;
                }
            }
            else if (radioButton2.Checked)
            {
                switch (AccountCheck(account, password, "doctorAccount"))
                {
                case 0:
                    // MessageBox.Show("验证成功");
                    doctor d = new doctor(account);
                    d.ShowDialog();
                    break;

                case 1:
                    MessageBox.Show("账号不存在");
                    break;

                case 2:
                    MessageBox.Show("密码错误");
                    break;
                }
            }
            else if (radioButton3.Checked)
            {
                switch (AccountCheck(account, password, "adminAccount"))
                {
                case 0:
                    admin adm = new admin(this);
                    adm.ShowDialog();
                    break;

                case 1:
                    MessageBox.Show("账号不存在");
                    break;

                case 2:
                    MessageBox.Show("密码错误");
                    break;
                }
            }
        }
예제 #9
0
 public void add_doctor(doctor d)
 {
     doctors.Add(d);
 }