public static void SearchDoctorsAvailabeTimeByPatient(TextBox textBox, DataGridView dataGridView)
        {
            DoctorPatientDataContext dp = new DoctorPatientDataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Arwin\documents\visual studio 2015\Projects\CSharpProjects\DoctorPatientPortal\DoctorPatient.mdf;Integrated Security=True;Connect Timeout=30");
            DoctorAvailable          da = null;

            try
            {
                da = dp.DoctorAvailables.FirstOrDefault(dal => dal.DoctorId == int.Parse(textBox.Text)); /*&& dal.CurrentDateTime==DateTime.Now.AddDays(1)*/
            }catch (Exception ex)
            {
                MessageBox.Show(ex.GetType().Name + ", " + ex.Message, "Query Result");
            }

            if (da != null)
            {
                //DateTime dateResult = DateTime.ParseExact(DateTime.Now.AddDays(1).ToShortDateString(), "dd/mmm/yy", CultureInfo.InvariantCulture);

                var x = from a in dp.DoctorAvailables where da.DoctorId == int.Parse(textBox.Text) /*&& da.CurrentDateTime == DateTime.Now.AddDays(1).ToShortDateString()*/ select a;
                dataGridView.DataSource = x.ToList();
                MessageBox.Show("Doctor Available Time Found", "Query Result");
                //MessageBox.Show((DateTime.ParseExact(DateTime.Now.AddDays(1).ToString(),"dd-mm-yy")).ToString());
            }
            if (da == null)
            {
                MessageBox.Show("Doctor Availabe time not found. Try with another id", "Query Result");
                dataGridView.DataSource = null;
                textBox.Clear();
            }
        }
        public static void BookDoctorByPatient(int doctorId, int patientID, ComboBox comboBox)
        {
            DoctorPatientDataContext dp = new DoctorPatientDataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Arwin\documents\visual studio 2015\Projects\CSharpProjects\DoctorPatientPortal\DoctorPatient.mdf;Integrated Security=True;Connect Timeout=30");

            DoctorBooking db = null;

            try
            {
                db = new DoctorBooking()
                {
                    DrId        = doctorId,
                    PId         = patientID,
                    BookingTime = comboBox.Text,
                    BookingDate = DateTime.Now.AddDays(1).ToShortDateString()
                };

                dp.DoctorBookings.InsertOnSubmit(db);
                dp.SubmitChanges();

                MessageBox.Show("Booked successfully", "Query Result");
            }catch (Exception)
            {
                MessageBox.Show("Failed to set the time", "Query Result");
            }
        }
Ejemplo n.º 3
0
        public static void DoctorProfileUpdate(string emailID, List <TextBox> textBoxList, ComboBox comboBox1, DateTimePicker dateTimePicker1)
        {
            DoctorPatientDataContext dp = new DoctorPatientDataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Arwin\documents\visual studio 2015\Projects\CSharpProjects\DoctorPatientPortal\DoctorPatient.mdf;Integrated Security=True;Connect Timeout=30");

            try
            {
                Doctor dr = dp.Doctors.FirstOrDefault(drl => drl.Email_ID.Equals(emailID)); //Email must be from constructor value
                dr.First_Name     = textBoxList[0].Text;
                dr.Last_Name      = textBoxList[1].Text;
                dr.Password       = textBoxList[3].Text;
                dr.Contact_Number = textBoxList[4].Text;
                dr.Address        = textBoxList[5].Text;
                dr.Blood_Group    = comboBox1.Text;
                dr.Gender         = textBoxList[6].Text;
                dr.Birth_Date     = dateTimePicker1.Value;

                dp.SubmitChanges();

                MessageBox.Show("Dr. information updated", "Result");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.GetType().Name + ", " + ex.Message);
            }
        }
        public static void PatientProfile(string emailID, GroupBox groupBox1, ComboBox comboBox1, DateTimePicker dateTimePicker1, List <TextBox> textBoxList)
        {
            DoctorPatientDataContext dp = new DoctorPatientDataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Arwin\documents\visual studio 2015\Projects\CSharpProjects\DoctorPatientPortal\DoctorPatient.mdf;Integrated Security=True;Connect Timeout=30");

            try
            {
                var x = from a in dp.Patients
                        where a.Email_ID == emailID
                        select a;

                //Admin ad = dp.Admins.Single(adml => adml.Email_ID == emailID);

                groupBox1.Text = "User ID: " + Convert.ToString(x.FirstOrDefault().Id);

                textBoxList[0].Text  = x.FirstOrDefault().First_Name;
                textBoxList[1].Text  = x.FirstOrDefault().Last_Name;
                textBoxList[2].Text  = x.FirstOrDefault().Email_ID;
                textBoxList[3].Text  = x.FirstOrDefault().Password;
                textBoxList[4].Text  = x.FirstOrDefault().Contact_Number;
                textBoxList[5].Text  = x.FirstOrDefault().Address;
                comboBox1.Text       = x.FirstOrDefault().Blood_Group;
                textBoxList[6].Text  = x.FirstOrDefault().Gender;
                dateTimePicker1.Text = Convert.ToString(x.FirstOrDefault().Birth_Date);
                //byte[] img;

                //img = (byte[])(ad.Photo);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.GetType().Name, "Exception Type");
            }
        }
        public static void ShowPatientBookingDetails(DataGridView dataGridView1, int PId)
        {
            DoctorPatientDataContext dp = new DoctorPatientDataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Arwin\documents\visual studio 2015\Projects\CSharpProjects\DoctorPatientPortal\DoctorPatient.mdf;Integrated Security=True;Connect Timeout=30");

            var x = from a in dp.DoctorBookings where a.PId == PId select a;

            dataGridView1.DataSource = x.ToList();
        }
        public static void GetDoctorsAvailableTime(DataGridView dataGridView1)
        {
            DoctorPatientDataContext dp = new DoctorPatientDataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Arwin\documents\visual studio 2015\Projects\CSharpProjects\DoctorPatientPortal\DoctorPatient.mdf;Integrated Security=True;Connect Timeout=30");

            var x = from a in dp.DoctorAvailables select new { a.DoctorId, a.FromTime1, a.FromTime2, a.FromTime3, a.FromTime4, a.FromTime5, a.FromTime6, a.FromTime7, a.FromTime8, a.FromTime9, a.FromTime10, a.FromTime11, a.ToTime1, a.ToTime2, a.ToTime3, a.ToTime4, a.ToTime5, a.ToTime6, a.ToTime7, a.ToTime8, a.ToTime9, a.ToTime10, a.CurrentDateTime };

            dataGridView1.DataSource = x.ToList();
        }
        public static void ShowPatientDetails(DataGridView dataGridView1)
        {
            DoctorPatientDataContext dp = new DoctorPatientDataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Arwin\documents\visual studio 2015\Projects\CSharpProjects\DoctorPatientPortal\DoctorPatient.mdf;Integrated Security=True;Connect Timeout=30");

            var x = from a in dp.Patients select new { a.Id, a.First_Name, a.Last_Name };

            dataGridView1.DataSource = x.ToList();
        }
        public static int GetPatientID(string emailID)
        {
            DoctorPatientDataContext dp = new DoctorPatientDataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Arwin\documents\visual studio 2015\Projects\CSharpProjects\DoctorPatientPortal\DoctorPatient.mdf;Integrated Security=True;Connect Timeout=30");

            var x = from a in dp.Patients where a.Email_ID == emailID select a.Id;

            return(x.FirstOrDefault());
        }
Ejemplo n.º 9
0
        public static bool DrIdValidOrNot(int drId)
        {
            DoctorPatientDataContext dp = new DoctorPatientDataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Arwin\documents\visual studio 2015\Projects\CSharpProjects\DoctorPatientPortal\DoctorPatient.mdf;Integrated Security=True;Connect Timeout=30");

            Doctor d = null;

            try
            {
                d = dp.Doctors.Single(ptl => ptl.Id == drId);
                return(true);
            }
            catch (Exception) { return(false); }
        }
Ejemplo n.º 10
0
        public static void ShowDoctorBookingHistory(DataGridView dataGridView, int drID)
        {
            DoctorPatientDataContext dp = new DoctorPatientDataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Arwin\documents\visual studio 2015\Projects\CSharpProjects\DoctorPatientPortal\DoctorPatient.mdf;Integrated Security=True;Connect Timeout=30");

            try
            {
                var x = from a in dp.DoctorBookings where a.DrId == drID select a;

                dataGridView.DataSource = x.ToList();
            }catch (Exception ex)
            {
                MessageBox.Show(ex.GetType().Name + ", " + ex.Message, "Query Result");
            }
        }
        public static void CheckIsPatientMethod(MainWindowForm mwf, TextBox textBox1, TextBox textBox2)
        {
            DoctorPatientDataContext dp = new DoctorPatientDataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Arwin\documents\visual studio 2015\Projects\CSharpProjects\DoctorPatientPortal\DoctorPatient.mdf;Integrated Security=True;Connect Timeout=30");

            Patient p = null;

            try
            {
                p = dp.Patients.FirstOrDefault(pl => pl.Email_ID == textBox1.Text && pl.Password == textBox2.Text);
            }
            catch (Exception) { mwf.IsPatient = false; }
            if (p != null)
            {
                mwf.IsPatient = true;
            }
        }
Ejemplo n.º 12
0
        public static void DeletePatient(int PatientID)
        {
            DoctorPatientDataContext dp = new DoctorPatientDataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Arwin\documents\visual studio 2015\Projects\CSharpProjects\DoctorPatientPortal\DoctorPatient.mdf;Integrated Security=True;Connect Timeout=30");

            try
            {
                Patient p = dp.Patients.FirstOrDefault(dl => dl.Id.Equals(PatientID));

                dp.Patients.DeleteOnSubmit(p);
                dp.SubmitChanges();
                MessageBox.Show("Patient Deleted", "Query Result");
            }
            catch (Exception ex)
            {
                MessageBox.Show("No data found on the database..." + ex.GetType().Name + ex.Message, "Query Result");
            }
        }
Ejemplo n.º 13
0
        public static bool DeleteDoctor(string userID)
        {
            DoctorPatientDataContext dp = new DoctorPatientDataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Arwin\documents\visual studio 2015\Projects\CSharpProjects\DoctorPatientPortal\DoctorPatient.mdf;Integrated Security=True;Connect Timeout=30");

            try
            {
                Doctor d = dp.Doctors.FirstOrDefault(dl => dl.Id.Equals(userID));

                dp.Doctors.DeleteOnSubmit(d);
                dp.SubmitChanges();
                return(true);
            }
            catch (Exception)
            {
                MessageBox.Show("No data found on the database...", "Query Result");
                return(false);
            }
        }
        public static void AdminLogin(MainWindowForm mwf, string emailID, string password)
        {
            DoctorPatientDataContext dp = new DoctorPatientDataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Arwin\documents\visual studio 2015\Projects\CSharpProjects\DoctorPatientPortal\DoctorPatient.mdf;Integrated Security=True;Connect Timeout=30");
            Admin ad = null;

            try
            {
                ad = dp.Admins.Single(adml => adml.Email_ID == emailID && adml.Password == password);
            }
            catch (Exception)
            {
                MessageBox.Show("No data found on Database...Try agin.", "Query Result");
            }
            if (ad != null)
            {
                //MessageBox.Show("Login successful...", "Query Result");
                new AdminDashBoard(emailID).Show();
                mwf.Hide();
            }
        }
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            DoctorPatientDataContext dp = new DoctorPatientDataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Arwin\documents\visual studio 2015\Projects\CSharpProjects\DoctorPatientPortal\DoctorPatient.mdf;Integrated Security=True;Connect Timeout=30");

            var x = from a in dp.Admins where a.Email_ID == emailID select a;

            List <Label> labelList = new List <Label>();

            labelList.Add(label1);
            labelList.Add(label2);
            labelList.Add(label3);
            labelList.Add(label4);
            labelList.Add(label5);
            labelList.Add(label6);
            labelList.Add(label7);
            labelList.Add(label8);
            labelList.Add(firstNameDB);
            labelList.Add(LastNameDB);
            labelList.Add(emailIdDB);
            labelList.Add(passwordDB);
            labelList.Add(contactNumberDB);
            labelList.Add(addressDB);
            labelList.Add(bloodGroupDB);
            labelList.Add(birthDateDB);
            labelList.Add(userID);
            labelList.Add(clearText);

            VisibilityOfLabel(labelList, true);

            labelList[8].Text  = x.FirstOrDefault().First_Name;
            labelList[9].Text  = x.FirstOrDefault().Last_Name;
            labelList[10].Text = x.FirstOrDefault().Email_ID;
            labelList[11].Text = x.FirstOrDefault().Password;
            labelList[12].Text = x.FirstOrDefault().Contact_Number;
            labelList[13].Text = x.FirstOrDefault().Address;
            labelList[14].Text = x.FirstOrDefault().Blood_Group;
            labelList[15].Text = ((x.FirstOrDefault().Birth_Date).ToShortDateString()).ToString();
            labelList[16].Text = "Admin ID: " + (x.FirstOrDefault().Id).ToString();
        }
Ejemplo n.º 16
0
        public static void SearchDoctor(List <Label> labelList, List <TextBox> textBoxList, string userID)
        {
            DoctorPatientDataContext dp = new DoctorPatientDataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Arwin\documents\visual studio 2015\Projects\CSharpProjects\DoctorPatientPortal\DoctorPatient.mdf;Integrated Security=True;Connect Timeout=30");

            try
            {
                var StringQuery = from a in dp.Doctors where a.Id == int.Parse(userID) select a;

                foreach (TextBox textBox in textBoxList)
                {
                    textBox.Enabled = false;
                }

                HideOrEnabledDefaultDoctorProfileLabel(labelList, textBoxList, true);
                textBoxList[0].Text = StringQuery.FirstOrDefault().First_Name;
                textBoxList[1].Text = StringQuery.FirstOrDefault().Last_Name;
                textBoxList[2].Text = StringQuery.FirstOrDefault().Email_ID;
                textBoxList[3].Text = StringQuery.FirstOrDefault().Password;
                textBoxList[4].Text = StringQuery.FirstOrDefault().Contact_Number;
                textBoxList[5].Text = StringQuery.FirstOrDefault().Address;
                textBoxList[6].Text = StringQuery.FirstOrDefault().Blood_Group;
                textBoxList[7].Text = (StringQuery.FirstOrDefault().Birth_Date).ToShortDateString();
                MessageBox.Show("Doctor found", "Query Result");
            }
            catch (Exception)
            {
                foreach (Label label in labelList)
                {
                    label.Visible = false;
                }
                foreach (TextBox textBox in textBoxList)
                {
                    textBox.Visible = false;
                    textBox.Clear();
                }
                MessageBox.Show("No data found on the database...", "Query Result");
            }
        }
Ejemplo n.º 17
0
        private void button1_Click(object sender, EventArgs e)
        {
            DoctorPatientDataContext dp = new DoctorPatientDataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Arwin\documents\visual studio 2015\Projects\CSharpProjects\DoctorPatientPortal\DoctorPatient.mdf;Integrated Security=True;Connect Timeout=30");

            if (textBox1.Text == "")
            {
                MessageBox.Show("First Name must be filled up", "Notification");
            }
            else if (textBox2.Text == "")
            {
                MessageBox.Show("Last Name must be filled up", "Notification");
            }
            else if (textBox3.Text == "")
            {
                MessageBox.Show("Email id must be filled up", "Notification");
            }
            else if (passwordText.Text == "")
            {
                MessageBox.Show("Password text must be filled up", "Notification");
            }
            else if (confirmPasswordText.Text == "")
            {
                MessageBox.Show("Confirm password text must be filled up", "Notification");
            }
            else if (textBox6.Text == "")
            {
                MessageBox.Show("Please provide a contact number", "Notification");
            }
            else if (textBox7.Text == "")
            {
                MessageBox.Show("Address must be filled up", "Notification");
            }
            else if (comboBox1.Text == "")
            {
                MessageBox.Show("Please select blood group", "Notification");
            }
            else if (passwordText.Text != confirmPasswordText.Text)
            {
                MessageBox.Show("Password mismatched", "Notification");
            }
            else
            {
                try
                {
                    Admin pt = new Admin
                    {
                        First_Name     = textBox1.Text,
                        Last_Name      = textBox2.Text,
                        Email_ID       = textBox3.Text,
                        Password       = passwordText.Text,
                        Contact_Number = textBox6.Text,
                        Address        = textBox7.Text,
                        Blood_Group    = comboBox1.Text,
                        Birth_Date     = dateTimePicker1.Value,
                        //Photo = ConvertFileToByte(pictureBox2.ImageLocation)
                    };

                    List <CheckBox> listOfCheckBox = new List <CheckBox>();
                    listOfCheckBox.Add(checkBox1);
                    listOfCheckBox.Add(checkBox2);
                    listOfCheckBox.Add(checkBox3);

                    if (listOfCheckBox[0].Checked == true && listOfCheckBox[1].Checked == false && listOfCheckBox[2].Checked == false)
                    {
                        pt.Gender = "Male";
                    }
                    else if (listOfCheckBox[0].Checked == false && listOfCheckBox[1].Checked == true && listOfCheckBox[2].Checked == false)
                    {
                        pt.Gender = "Female";
                    }
                    else if (listOfCheckBox[0].Checked == false && listOfCheckBox[1].Checked == false && listOfCheckBox[2].Checked == true)
                    {
                        pt.Gender = "Other";
                    }

                    dp.Admins.InsertOnSubmit(pt);
                    dp.SubmitChanges();
                    label12.Text = "Information successfully updated";
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.GetType().Name + ", " + ex.Message, "Query Result");
                }
            }
        }
Ejemplo n.º 18
0
        public static void DoctorAvailableTimeSetToDB(string emailID, string fromTime, string toTime, int drID)
        {
            DoctorPatientDataContext dp = new DoctorPatientDataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Arwin\documents\visual studio 2015\Projects\CSharpProjects\DoctorPatientPortal\DoctorPatient.mdf;Integrated Security=True;Connect Timeout=30");

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

            fromTimeList.Add("8:00 AM");
            fromTimeList.Add("9:00 AM");
            fromTimeList.Add("10:00 AM");
            fromTimeList.Add("11:00 AM");
            fromTimeList.Add("12:00 PM");
            fromTimeList.Add("1:00 PM");
            fromTimeList.Add("2:00 PM");
            fromTimeList.Add("3:00 PM");
            fromTimeList.Add("4:00 PM");
            fromTimeList.Add("5:00 PM");
            fromTimeList.Add("6:00 PM");

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

            toTimeList.Add("12:00 PM");
            toTimeList.Add("1:00 PM");
            toTimeList.Add("2:00 PM");
            toTimeList.Add("3:00 PM");
            toTimeList.Add("4:00 PM");
            toTimeList.Add("5:00 PM");
            toTimeList.Add("6:00 PM");
            toTimeList.Add("7:00 PM");
            toTimeList.Add("8:00 PM");
            toTimeList.Add("9:00 PM");

            string[] arrayList = new string[11];
            int      i = 0, l = 0;

            foreach (string f in fromTimeList)
            {
                arrayList[i] = f;
                i++;
            }

            for (int j = 0; j < arrayList.Length; j++)
            {
                if (arrayList[j] == fromTime)
                {
                    l = j;
                }
            }
            for (int m = 0; m < l; m++)
            {
                arrayList[m] = "";
            }

            //new area 2

            string[] arrayList2 = new string[10];
            int      i2 = 0, l2 = 0;

            foreach (string f in toTimeList)
            {
                arrayList2[i2] = f;
                i2++;
            }

            for (int kk = 0; kk < arrayList2.Length; kk++)
            {
                if (arrayList2[kk] == arrayList[arrayList.Length - 1])
                {
                    l2 = arrayList2[kk].Length;
                }
            }

            for (int m = 0; m < l2; m++)
            {
                arrayList2[m] = "";
            }

            int s1 = 0;

            for (int s = 0; s < arrayList2.Length; s++)
            {
                if (arrayList2[s] == toTime)
                {
                    s1 = s;
                }
            }

            for (int s3 = arrayList2.Length - 1; s3 > s1; s3--)
            {
                arrayList2[s3] = "";
            }
            string          dt;
            DoctorAvailable ad = null;

            try
            {
                ad = new DoctorAvailable();

                ad.DoctorId        = drID;
                ad.CurrentDateTime = dt = DateTime.Now.AddDays(1).ToShortDateString();
                ad.FromTime1       = arrayList[0];
                ad.FromTime2       = arrayList[1];
                ad.FromTime3       = arrayList[2];
                ad.FromTime4       = arrayList[3];
                ad.FromTime5       = arrayList[4];
                ad.FromTime6       = arrayList[5];
                ad.FromTime7       = arrayList[6];
                ad.FromTime8       = arrayList[7];
                ad.FromTime9       = arrayList[8];
                ad.FromTime10      = arrayList[9];
                ad.FromTime11      = arrayList[10];

                ad.ToTime1  = arrayList2[0];
                ad.ToTime2  = arrayList2[1];
                ad.ToTime3  = arrayList2[2];
                ad.ToTime4  = arrayList2[3];
                ad.ToTime5  = arrayList2[4];
                ad.ToTime6  = arrayList2[5];
                ad.ToTime7  = arrayList2[6];
                ad.ToTime8  = arrayList2[7];
                ad.ToTime9  = arrayList2[8];
                ad.ToTime10 = arrayList2[9];

                dp.DoctorAvailables.InsertOnSubmit(ad);
                dp.SubmitChanges();
                MessageBox.Show("Available time set successfully...", "Query Result");
            }
            catch (Exception ex)
            {
                MessageBox.Show("c1" + ex.GetType().Name + ex.Message, "Query Result");
            }
        }
        public static void CreateDoctor(List <TextBox> textBoxList, ComboBox comboBox, List <CheckBox> checkBoxList, DateTimePicker dateTimePicker1 /*, PictureBox photo*/)
        {
            DoctorPatientDataContext dp = new DoctorPatientDataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Arwin\documents\visual studio 2015\Projects\CSharpProjects\DoctorPatientPortal\DoctorPatient.mdf;Integrated Security=True;Connect Timeout=30");

            if (textBoxList[0].Text == string.Empty)
            {
                MessageBox.Show("First Name must be filled up", "Notification");
            }
            else if (textBoxList[1].Text == string.Empty)
            {
                MessageBox.Show("Last Name must be filled up", "Notification");
            }
            else if (textBoxList[2].Text == string.Empty)
            {
                MessageBox.Show("Email ID must be filled up", "Notification");
            }
            else if (textBoxList[5].Text == string.Empty)
            {
                MessageBox.Show("Contact number must be filled up", "Notification");
            }
            else if (textBoxList[6].Text == string.Empty)
            {
                MessageBox.Show("Address must be filled up", "Notification");
            }
            else if (textBoxList[3].Text != textBoxList[4].Text)
            {
                MessageBox.Show("Password Mismatched", "Notification");
            }
            else if (textBoxList[3].Text == string.Empty)
            {
                MessageBox.Show("Enter password", "Notification");
            }
            else if (textBoxList[4].Text == string.Empty)
            {
                MessageBox.Show("Enter confirm password", "Notification");
            }
            else if (comboBox.Text == string.Empty)
            {
                MessageBox.Show("Please select Blood Group", "Notification");
            }
            else if ((checkBoxList.ElementAt(0).Checked == true && checkBoxList.ElementAt(1).Checked == true && checkBoxList.ElementAt(2).Checked == true) || (checkBoxList.ElementAt(0).Checked == true && checkBoxList.ElementAt(1).Checked == true) || (checkBoxList.ElementAt(1).Checked == true && checkBoxList.ElementAt(2).Checked == true) || (checkBoxList.ElementAt(0).Checked == true && checkBoxList.ElementAt(2).Checked == true))
            {
                MessageBox.Show("Please select a check box", "Notification");
            }
            else if (checkBoxList.ElementAt(0).Checked == false && checkBoxList.ElementAt(1).Checked == false && checkBoxList.ElementAt(2).Checked == false)
            {
                MessageBox.Show("Please select a gender", "Notification");
            }
            else
            {
                try
                {
                    Doctor d = new Doctor
                    {
                        First_Name     = textBoxList[0].Text,
                        Last_Name      = textBoxList[1].Text,
                        Email_ID       = textBoxList[2].Text,
                        Password       = textBoxList[3].Text,
                        Contact_Number = textBoxList[5].Text,
                        Address        = textBoxList[6].Text,
                        Blood_Group    = comboBox.Text,
                        Birth_Date     = dateTimePicker1.Value,
                        //Photo = ConvertFileToByte(photo.ImageLocation)
                    };

                    if (checkBoxList.ElementAt(0).Checked == true && checkBoxList.ElementAt(1).Checked == false && checkBoxList.ElementAt(2).Checked == false)
                    {
                        d.Gender = "Male";
                    }
                    else if (checkBoxList.ElementAt(0).Checked == false && checkBoxList.ElementAt(1).Checked == true && checkBoxList.ElementAt(2).Checked == false)
                    {
                        d.Gender = "Female";
                    }
                    else if (checkBoxList.ElementAt(0).Checked == false && checkBoxList.ElementAt(1).Checked == false && checkBoxList.ElementAt(2).Checked == true)
                    {
                        d.Gender = "Other";
                    }

                    dp.Doctors.InsertOnSubmit(d);
                    dp.SubmitChanges();
                    MessageBox.Show("Doctor added successfully", "Query Result");
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Registration failed. Try again", "Query Result");
                    MessageBox.Show("Error Type: " + ex.GetType().Name + " " + ex.Message, "Query Result");
                }
            }
        }
 public static void PatientBooking(DataGridView dataGridView1, int patientID)
 {
     DoctorPatientDataContext dp = new DoctorPatientDataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Arwin\documents\visual studio 2015\Projects\CSharpProjects\DoctorPatientPortal\DoctorPatient.mdf;Integrated Security=True;Connect Timeout=30");
 }