Esempio n. 1
0
        private void metroButton4_Click(object sender, EventArgs e)
        {
            DoctorDataContext up = new DoctorDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Priom\Downloads\c#\Private_Clinic - Copy\Private_Clinic\Clinic.mdf;Integrated Security=True;Connect Timeout=30");
            var x = up.Doctors.Where(a => a.E_mail == metroTextBox2.Text).Count();

            if (x != 0 && metroTextBox2.Text != "")
            {
                var z              = up.Doctors.Where(a => a.E_mail == metroTextBox2.Text);
                z.First().Name     = metroTextBox1.Text;
                z.First().Age      = int.Parse(metroTextBox3.Text);
                z.First().Gender   = metroComboBox1.Text;
                z.First().Address  = metroTextBox4.Text;
                z.First().Password = metroTextBox6.Text;
                z.First().Type     = metroComboBox2.Text;
                up.SubmitChanges();


                MessageBox.Show("Your data is updated ");
                this.Hide();
                Form2 login = new Form2();
                login.Show();
            }
            else
            {
                MessageBox.Show("Invalid value ");
            }
        }
Esempio n. 2
0
        private void metroButton1_Click(object sender, EventArgs e)
        {
            DoctorDataContext dd = new DoctorDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Priom\Downloads\c#\Private_Clinic - Copy\Private_Clinic\Clinic.mdf;Integrated Security=True;Connect Timeout=30");

            if (metroTextBox2.Text != "" && metroTextBox6.Text != "")
            {
                Doctor d = new Doctor
                {
                    Name     = metroTextBox1.Text,
                    E_mail   = metroTextBox2.Text,
                    Age      = int.Parse(metroTextBox3.Text),
                    Gender   = metroComboBox1.Text,
                    Address  = metroTextBox4.Text,
                    Type     = metroComboBox2.Text,
                    Password = metroTextBox6.Text
                };


                dd.Doctors.InsertOnSubmit(d);
                dd.SubmitChanges();


                MessageBox.Show("You are Registered ");
                this.Hide();
                Form1 menu = new Form1();
                menu.Show();
            }
            else
            {
                MessageBox.Show("Invalid value ");
            }
        }
Esempio n. 3
0
        private void metroButton7_Click(object sender, EventArgs e)
        {
            DoctorDataContext dbp = new DoctorDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Priom\Downloads\c#\Private_Clinic - Copy\Private_Clinic\Clinic.mdf;Integrated Security=True;Connect Timeout=30");
            var x = from a in dbp.Doctors
                    where a.Type == metroComboBox1.Text
                    select a;

            metroGrid1.DataSource = x.ToList();
        }
Esempio n. 4
0
        private void metroButton1_Click(object sender, EventArgs e)
        {
            DoctorDataContext log = new DoctorDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Priom\Downloads\c#\Private_Clinic - Copy\Private_Clinic\Clinic.mdf;Integrated Security=True;Connect Timeout=30");
            var x = log.Doctors.Where(a => a.E_mail == metroTextBox1.Text && a.Password == metroTextBox2.Text).Count();

            if (x != 0 && metroTextBox1.Text != "" && metroTextBox2.Text != "")
            {
                this.Hide();
                Form8 dinfo = new Form8();
                dinfo.Show();
            }
            else
            {
                MessageBox.Show("Invalid Please try again ");
            }
        }
Esempio n. 5
0
        void UpdateGridView()
        {
            DoctorDataContext up = new DoctorDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Priom\Downloads\c#\Private_Clinic - Copy\Private_Clinic\Clinic.mdf;Integrated Security=True;Connect Timeout=30");

            metroGrid1.DataSource = up.Doctors;
        }