private void add_booking1_Load(object sender, EventArgs e) { db = new Class_DB(); db.ConnectDB(); ds = new DataSet(); ds2 = new DataSet(); ds = db.selectdb("select * from booking ", "booking"); textBoxB_id.DataBindings.Add("Text", ds, "booking.booking_id"); dateTimePickerDate.DataBindings.Add("Value", ds, "booking.date_booking"); maskedTextBoxTime.DataBindings.Add("Text", ds, "booking.time_booking"); comboBoxPay.DataBindings.Add("Text", ds, "booking.required_pay"); ds2 = db.selectdb("select * from doctor ", "doctor"); comboBoxD_name.DataSource = ds2; comboBoxD_name.DisplayMember = "doctor.doctor_name"; comboBoxD_name.ValueMember = "doctor.doctor_id"; // comboBox2.DataBindings.Add("Text", ds, "booking.doctor_name"); ds3 = db.selectdb("select * from patient", "patient"); comboBoxP_name.DataSource = ds3; comboBoxP_name.DisplayMember = "patient.patient_name"; comboBoxP_name.ValueMember = "patient.patient_id"; // comboBox3.ValueMember = "patient.patient_id"; dataGridView1.DataSource = ds; dataGridView1.DataMember = "booking"; }
private void add_file_Load(object sender, EventArgs e) { db = new Class_DB(); db.ConnectDB(); ds = new DataSet(); ds2 = new DataSet(); ds3 = new DataSet(); ds = db.selectdb("select * from file ", "file"); textBoxf_id.DataBindings.Add("Text", ds, "file.file_id"); textBoxdiag.DataBindings.Add("Text", ds, "file.diagnosis"); textBoxexam.DataBindings.Add("Text", ds, "file.examination"); textBoxmedicin.DataBindings.Add("Text", ds, "file.medicin"); ds2 = db.selectdb("select * from doctor ", "doctor"); comboBoxD_name.DataSource = ds2; comboBoxD_name.DisplayMember = "doctor.doctor_name"; comboBoxD_name.ValueMember = "doctor.doctor_id"; // comboBox2.DataBindings.Add("Text", ds, "booking.doctor_name"); ds3 = db.selectdb("select * from patient", "patient"); comboBoxP_name.DataSource = ds3; comboBoxP_name.DisplayMember = "patient.patient_name"; comboBoxP_name.ValueMember = "patient.patient_id"; // comboBox3.ValueMember = "patient.patient_id"; dataGridView1.DataSource = ds; dataGridView1.DataMember = "file"; }
private void buttonlogin_Click(object sender, EventArgs e) { if (textBoxname.Text != "" && textBoxpass.Text != "") { Class_DB db = new Class_DB(); db.ConnectDB(); DataSet ds = new DataSet(); ds = db.selectdb("Select * from [user] where username='******' and password='******'", "user"); if (ds.Tables["user"].Rows.Count >= 1) { welcome_manger f = new welcome_manger(); f.Show(); this.Hide(); } else { label4.Text = "your Name or your Password not Vaild"; } } else { label4.Text = "your must Enter your Name and your Password"; } }
private void query_doctor_Load(object sender, EventArgs e) { db = new Class_DB(); db.ConnectDB(); ds = new DataSet(); ds2 = new DataSet(); ds = db.selectdb("select * from doctor ", "doctor"); textBoxd_id.DataBindings.Add("Text", ds, "doctor.doctor_id"); textBoxd_name.DataBindings.Add("Text", ds, "doctor.doctor_name"); // comboBoxdp_id.DataBindings.Add("Text", ds, "doctor.dept_id"); textBoxmajor.DataBindings.Add("Text", ds, "doctor.major"); maskedTextBoxidt_no.DataBindings.Add("Text", ds, "doctor.identity_no"); maskedTextBoxphone.DataBindings.Add("Text", ds, "doctor.phone_no"); textBoxemail.DataBindings.Add("Text", ds, "doctor.email"); textBoxstreet.DataBindings.Add("Text", ds, "doctor.street"); checkedListBoxday.DataBindings.Add("Text", ds, "doctor.day_work"); maskedTextBoxtime.DataBindings.Add("Text", ds, "doctor.time_work"); ds2 = db.selectdb("select * from dept", "dept"); comboBoxdp_id.DataSource = ds2; comboBoxdp_id.DisplayMember = "dept.dept_name"; comboBoxdp_id.ValueMember = "dept.dept_id"; dataGridView1.DataSource = ds; dataGridView1.DataMember = "doctor"; }
private void add_dept_Load(object sender, EventArgs e) { db = new Class_DB(); db.ConnectDB(); ds = new DataSet(); ds = db.selectdb("select * from dept ", "dept"); textBoxid.DataBindings.Add("Text", ds, "dept.dept_id"); textBoxname.DataBindings.Add("Text", ds, "dept.dept_name"); dataGridView1.DataSource = ds; dataGridView1.DataMember = "dept"; }
private void add_patient_Load(object sender, EventArgs e) { db = new Class_DB(); db.ConnectDB(); ds = new DataSet(); ds = db.selectdb("select * from patient ", "patient"); textBox1.DataBindings.Add("Text", ds, "patient.patient_id"); textBox2.DataBindings.Add("Text", ds, "patient.patient_name"); label3.DataBindings.Add("Text", ds, "patient.sex"); maskedTextBox1.DataBindings.Add("Text", ds, "patient.age"); maskedTextBox3.DataBindings.Add("Text", ds, "patient.identity_no"); maskedTextBox2.DataBindings.Add("Text", ds, "patient.phone_no"); textBox3.DataBindings.Add("Text", ds, "patient.email"); textBox4.DataBindings.Add("Text", ds, "patient.street"); dataGridView1.DataSource = ds; dataGridView1.DataMember = "patient"; }