private void button2_Click(object sender, EventArgs e)
        {
            Patient temp = new Patient();

            temp.Id = Convert.ToInt32(textBox1.Text);
            PatientServices patientServices = new PatientServices();
            Patient         patient         = new Patient();

            patient = patientServices.Get(temp);

            string consult = this.doctor.Name + ":" + this.doctor.Phone;

            if (patient.Status != 1)
            {
                textBox2.Text = "";
                textBox3.Text = "";
                textBox4.Text = "";
                MessageBox.Show("NO Data");
            }
            else if (patient != null && patient.Consultant.Equals(consult))
            {
                textBox2.Text = patient.Name;
                textBox3.Text = patient.Gender;
                textBox4.Text = patient.Age.ToString();
            }
            else
            {
                textBox2.Text = "";
                textBox3.Text = "";
                textBox4.Text = "";
                MessageBox.Show("NO Data");
            }
        }
        private void extraServicesBtn_Click(object sender, EventArgs e)
        {
            dataGridView1.Visible = false;

            label14.Show();
            label15.Show();
            textBox10.Show();
            textBox11.Show();

            if (textBox1.Text == "")
            {
                MessageBox.Show("provide Id");
            }
            else
            {
                Patient temp = new Patient();
                temp.Id = Convert.ToInt32(textBox1.Text);

                Patient         patient         = new Patient();
                PatientServices patientServices = new PatientServices();
                patient = patientServices.Get(temp);
                if (patient.OT == 1)
                {
                    textBox11.Text = "YES";
                }
                else
                {
                    textBox11.Text = "NO";
                }

                textBox10.Text = patient.ExtraServices;
            }
        }
Пример #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            comboBox3.Hide();
            label15.Hide();
            checkedListBox1.Hide();
            label14.Hide();
            button3.Hide();
            button4.Hide();



            Patient temp = new Patient();

            temp.Id = Convert.ToInt32(textBox1.Text);
            PatientServices patientServices = new PatientServices();
            Patient         patient         = new Patient();

            patient = patientServices.Get(temp);
            string consult = doctor.Name + ":" + doctor.Phone;

            if (patient.Status != 1)
            {
                textBox2.Text = "";
                textBox8.Text = "";
                textBox3.Text = "";
                textBox4.Text = "";
                textBox5.Text = "";
                textBox6.Text = "";
                textBox7.Text = "";
                textBox9.Text = "";

                MessageBox.Show("No data");
            }
            else if (patient != null && patient.Consultant.Equals(consult))
            {
                textBox2.Text  = patient.Name;
                textBox8.Text  = patient.Date;
                textBox3.Text  = patient.Gender;
                textBox4.Text  = patient.Age.ToString();
                textBox5.Text  = patient.Phone;
                textBox6.Text  = patient.Consultant;
                textBox7.Text  = patient.Address;
                textBox9.Text  = patient.Emergency;
                comboBox2.Text = patient.ReadyToRelease;
                comboBox1.Text = patient.ReleaseCondition;
            }
            else
            {
                textBox2.Text = "";
                textBox8.Text = "";
                textBox3.Text = "";
                textBox4.Text = "";
                textBox5.Text = "";
                textBox6.Text = "";
                textBox7.Text = "";
                textBox9.Text = "";
                MessageBox.Show("NO Data");
            }
        }
Пример #4
0
        private void button3_Click(object sender, EventArgs e)
        {
            PatientServices patientServices = new PatientServices();
            Patient         temp            = new Patient();

            temp.Id = Convert.ToInt32(textBox1.Text);

            Patient patient = new Patient();

            patient = patientServices.Get(temp);

            List <string> test = new List <string>();

            foreach (string item in checkedListBox1.CheckedItems)
            {
                test.Add(item);
            }
            string testList = "";
            double tcost    = patient.TotalCost;

            foreach (string item in test)
            {
                testList += item + ",";
                tcost    += 500;
            }


            // patient.Id = Convert.ToInt32(textBox1.Text);
            if (comboBox3.Text.Equals("YES"))
            {
                patient.OT = 1;
                tcost     += 2000;
            }
            else
            {
                patient.OT = 0;
            }

            patient.ExtraServices = testList;
            patient.TotalCost     = tcost;


            bool check = patientServices.ExtraServicesUpdate(patient);

            if (check)
            {
                MessageBox.Show("Extra services added.");
            }

            else
            {
                MessageBox.Show("error occured.");
            }
        }
        private void button2_Click(object sender, EventArgs e)
        {
            Patient temp = new Patient();



            temp.Id = Convert.ToInt32(textBox1.Text);
            PatientServices patientServices = new PatientServices();
            Patient         patient         = new Patient();

            patient = patientServices.Get(temp);
            if (patient.Status != 1)
            {
                textBox2.Text = "";
                textBox8.Text = "";
                textBox3.Text = "";
                textBox4.Text = "";
                textBox5.Text = "";
                textBox6.Text = "";
                textBox7.Text = "";
                textBox9.Text = "";



                MessageBox.Show("No data");
            }
            else if (patient != null)
            {
                textBox2.Text = patient.Name;
                textBox8.Text = patient.Date;
                textBox3.Text = patient.Gender;
                textBox4.Text = patient.Age.ToString();
                textBox5.Text = patient.Phone;
                textBox6.Text = patient.Consultant;
                textBox7.Text = patient.Address;
                textBox9.Text = patient.Emergency;

                comboBox2.Text = patient.ReadyToRelease;
                if (patient.ReadyToRelease == "Yes")
                {
                    comboBox1.Text = patient.ReleaseCondition;
                }
                else
                {
                    comboBox1.Enabled = false;
                }
            }
        }
Пример #6
0
        private void serachBtn_Click(object sender, EventArgs e)
        {
            Patient temp = new Patient();

            temp.Id = Convert.ToInt32(textBox1.Text);
            PatientServices patientServices = new PatientServices();
            Patient         patient         = new Patient();

            patient = patientServices.Get(temp);
            if (patient.Status != 0)
            {
                textBox2.Text  = "";
                textBox8.Text  = "";
                textBox3.Text  = "";
                textBox4.Text  = "";
                textBox5.Text  = "";
                textBox6.Text  = "";
                textBox7.Text  = "";
                textBox9.Text  = "";
                textBox10.Text = "";
                textBox11.Text = "";
                textBox12.Text = "";
                MessageBox.Show("No data");
            }
            else if (patient != null)
            {
                textBox2.Text  = patient.Name;
                textBox8.Text  = patient.Date;
                textBox3.Text  = patient.Gender;
                textBox4.Text  = patient.Age.ToString();
                textBox5.Text  = patient.Phone;
                textBox6.Text  = patient.Consultant;
                textBox7.Text  = patient.Address;
                textBox9.Text  = patient.Emergency;
                comboBox2.Text = patient.ReadyToRelease;
                textBox10.Text = patient.TotalCost.ToString();

                textBox11.Text = patient.RoomNumber.ToString();
                textBox12.Text = patient.Seat.ToString();


                comboBox1.Text    = patient.ReleaseCondition;
                comboBox1.Enabled = true;
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            Patient temp = new Patient();

            temp.Id = Convert.ToInt32(textBox1.Text);
            PatientServices patientServices = new PatientServices();
            Patient         patient         = new Patient();

            patient = patientServices.Get(temp);
            patient.Prescription = textBox5.Text;

            bool check = patientServices.PrescriptionUpdate(patient);

            if (check)
            {
                MessageBox.Show("Successfull");
            }
            else
            {
                MessageBox.Show("Error Occured");
            }
        }