Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "")
            {
                MessageBox.Show("Fillup Information Correctly");
            }

            else
            {
                if (IsvalidDoctor(textBox1.Text))
                {
                    CabinDBDataContext cb = new CabinDBDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\AIUB\8th semester\C#\Project\Final\Hospital\HospitalManagementSystem.mdf;Integrated Security=True;Connect Timeout=30");

                    var x = from a in cb.Doctors
                            where a.Doctor_Name == textBox1.Text
                            select a;

                    foreach (Doctor p in x)
                    {
                        cb.Doctors.DeleteOnSubmit(p);
                    }

                    cb.SubmitChanges();
                    MessageBox.Show("SUCCESFULLY DELETED");
                }
                else
                {
                    MessageBox.Show("Invalid Name");
                }
            }
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "")
            {
                MessageBox.Show("Fillup Information Correctly");
            }
            else if (textBox2.Text == "")
            {
                MessageBox.Show("Fillup Information Correctly");
            }

            else
            {
                CabinDBDataContext cb = new CabinDBDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\AIUB\8th semester\C#\Project\Final\Hospital\HospitalManagementSystem.mdf;Integrated Security=True;Connect Timeout=30");
                Blood bl = new Blood
                {
                    Blood_Group = textBox1.Text,
                    Available   = int.Parse(textBox2.Text),
                };

                cb.Bloods.InsertOnSubmit(bl);
                cb.SubmitChanges();
                UpdateGridView();
            }
        }
        private void button4_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "")
            {
                MessageBox.Show("Fillup Information Correctly");
            }

            else
            {
                if (IsvalidDoctor(textBox1.Text))
                {
                    CabinDBDataContext cb = new CabinDBDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\AIUB\8th semester\C#\Project\Final\Hospital\HospitalManagementSystem.mdf;Integrated Security=True;Connect Timeout=30");
                    var x = from a in cb.Doctors
                            where a.Doctor_Name == textBox1.Text
                            select a;
                    textBox2.Text = x.FirstOrDefault().Cabin_No;
                    textBox3.Text = x.First().Phone;
                    textBox4.Text = x.First().Address;
                    textBox5.Text = x.First().Working_Hour.ToString();
                    textBox6.Text = x.First().Salary.ToString();

                    cb.SubmitChanges();
                    dataGridView1.DataSource = x.ToList();
                }
                else
                {
                    MessageBox.Show("No match Found");
                }
            }
        }
Esempio n. 4
0
        private void button4_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "")
            {
                MessageBox.Show("Fillup Information Correctly");
            }

            else
            {
                if (IsvalidCabinNo(int.Parse(textBox1.Text)))
                {
                    CabinDBDataContext cb = new CabinDBDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\AIUB\8th semester\C#\Project\Final\Hospital\HospitalManagementSystem.mdf;Integrated Security=True;Connect Timeout=30");
                    var x = from a in cb.CabinLists
                            where a.Cabin_No == int.Parse(textBox1.Text)
                            select a;
                    textBox2.Text = x.FirstOrDefault().Type;
                    textBox3.Text = x.First().Price.ToString();
                    textBox4.Text = x.First().Doctor_Name;


                    cb.SubmitChanges();
                    dataGridView1.DataSource = x.ToList();
                }

                else
                {
                    MessageBox.Show("Invalid Cabin No");
                }
            }
        }
Esempio n. 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "")
            {
                MessageBox.Show("Fillup Information Correctly");
            }
            else if (textBox2.Text == "")
            {
                MessageBox.Show("Fillup Information Correctly");
            }
            else if (textBox3.Text == "")
            {
                MessageBox.Show("Fillup Information Correctly");
            }
            else if (textBox4.Text == "")
            {
                MessageBox.Show("Fillup Information Correctly");
            }

            else if (textBox5.Text == "")
            {
                MessageBox.Show("Fillup Information Correctly");
            }

            else if (textBox6.Text == "")
            {
                MessageBox.Show("Fillup Information Correctly");
            }

            else
            {
                CabinDBDataContext cb = new CabinDBDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\AIUB\8th semester\C#\Project\Final\Hospital\HospitalManagementSystem.mdf;Integrated Security=True;Connect Timeout=30");
                Doctor             c1 = new Doctor();
                c1.Doctor_Name  = textBox1.Text;
                c1.Cabin_No     = textBox2.Text;
                c1.Phone        = textBox3.Text;
                c1.Address      = textBox4.Text;
                c1.Working_Hour = int.Parse(textBox5.Text);
                c1.Salary       = int.Parse(textBox6.Text);

                cb.Doctors.InsertOnSubmit(c1);
                cb.SubmitChanges();
                updateGridView();
                MessageBox.Show("Succesfully Added");

                DoctorList f2 = new DoctorList(this);
                this.Hide();
                f2.Show();
            }
        }
Esempio n. 6
0
        bool IsvalidDoctor(string name)
        {
            CabinDBDataContext cb = new CabinDBDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\AIUB\8th semester\C#\Project\Final\Hospital\HospitalManagementSystem.mdf;Integrated Security=True;Connect Timeout=30");
            var q = from p in cb.Doctors
                    where p.Doctor_Name == textBox1.Text
                    select p;

            if (q.Any())
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 7
0
        bool IsvalidCabinNo(int cabinNo)
        {
            CabinDBDataContext cb = new CabinDBDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\AIUB\8th semester\C#\Project\Final\Hospital\HospitalManagementSystem.mdf;Integrated Security=True;Connect Timeout=30");
            var q = from p in cb.CabinLists
                    where p.Cabin_No == int.Parse(textBox1.Text)
                    select p;

            if (q.Any())
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 8
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "")
            {
                MessageBox.Show("Fillup Information Correctly");
            }
            else
            {
                CabinDBDataContext cb = new CabinDBDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\AIUB\8th semester\C#\Project\Final\Hospital\HospitalManagementSystem.mdf;Integrated Security=True;Connect Timeout=30");

                var x = from a in cb.Bloods
                        where a.Blood_Group == textBox1.Text
                        select a;

                textBox2.Text = x.FirstOrDefault().Available.ToString();

                dataGridView1.DataSource = x.ToList();
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "")
            {
                MessageBox.Show("Fillup Information Correctly");
            }
            else if (textBox2.Text == "")
            {
                MessageBox.Show("Fillup Information Correctly");
            }
            else if (textBox3.Text == "")
            {
                MessageBox.Show("Fillup Information Correctly");
            }
            else if (textBox4.Text == "")
            {
                MessageBox.Show("Fillup Information Correctly");
            }
            else if (textBox5.Text == "")
            {
                MessageBox.Show("Fillup Information Correctly");
            }


            else
            {
                CabinDBDataContext cb = new CabinDBDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\AIUB\8th semester\C#\Project\Final\Hospital\HospitalManagementSystem.mdf;Integrated Security=True;Connect Timeout=30");
                Paitent            p1 = new Paitent();
                p1.Paitent_Name = textBox1.Text;
                p1.Cabin_No     = int.Parse(textBox2.Text);
                p1.Phone        = textBox3.Text;
                p1.Room_Type    = textBox4.Text;
                p1.Price        = int.Parse(textBox5.Text);
                p1.Date         = textBox6.Text;

                cb.Paitents.InsertOnSubmit(p1);
                cb.SubmitChanges();
                updateGridView();
                MessageBox.Show("Succesfully Registerd");
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (IsvalidDoctor(textBox1.Text))
            {
                CabinDBDataContext cb = new CabinDBDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\AIUB\8th semester\C#\Project\Final\Hospital\HospitalManagementSystem.mdf;Integrated Security=True;Connect Timeout=30");
                var x = from a in cb.Doctors
                        where a.Doctor_Name == textBox1.Text
                        select a;
                x.First().Cabin_No     = textBox2.Text;
                x.First().Phone        = textBox3.Text;
                x.First().Address      = textBox4.Text;
                x.First().Working_Hour = int.Parse(textBox5.Text);
                x.First().Salary       = int.Parse(textBox6.Text);

                cb.SubmitChanges();
                dataGridView1.DataSource = x.ToList();
                MessageBox.Show("Updated");
            }
            else
            {
                MessageBox.Show("Invalid Name");
            }
        }
Esempio n. 11
0
        private void paitentCabinList_Load(object sender, EventArgs e)
        {
            CabinDBDataContext cb = new CabinDBDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\AIUB\8th semester\C#\Project\Final\Hospital\HospitalManagementSystem.mdf;Integrated Security=True;Connect Timeout=30");

            dataGridView1.DataSource = cb.CabinLists;
        }
Esempio n. 12
0
        void updateGridView()
        {
            CabinDBDataContext cb = new CabinDBDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\AIUB\8th semester\C#\Project\Final\Hospital\HospitalManagementSystem.mdf;Integrated Security=True;Connect Timeout=30");

            dataGridView1.DataSource = cb.Doctors;
        }