示例#1
0
        private void button3_Click(object sender, EventArgs e)
        {
            DoctorList d = new DoctorList();

            this.Hide();
            d.Show();
        }
示例#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 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();
            }
        }