void populate() { Pasien Pat = new Pasien(); string query = "select * from UserTab"; DataSet ds = Pat.ShowPatient(query); UserDGV.DataSource = ds.Tables[0]; }
void populate() { Pasien Pat = new Pasien(); string query = "select * from PrescriptionTab"; DataSet ds = Pat.ShowPatient(query); PrescDGV.DataSource = ds.Tables[0]; }
private void button1_Click(object sender, EventArgs e) { string query = "insert into PasTab values('" + PatNameTab.Text + "','" + PatHpTab.Text + "','" + PatAddresTab.Text + "','" + DOBDateCb.Value.Date + "','" + GenCb.SelectedItem.ToString() + "','" + PatAllergiesTab.Text + "')"; Pasien Pat = new Pasien(); try { Pat.AddPatient(query); MessageBox.Show("Patient Sucesfully Added"); populate(); }catch (Exception Ex) { MessageBox.Show(Ex.Message); } }
private void button1_Click(object sender, EventArgs e) { string query = "insert into UserTab values('" + UsNameTab.Text + "'," + UsPassw.Text + ",'" + UsPassw.Text + "')"; Pasien Pat = new Pasien(); try { Pat.AddPatient(query); MessageBox.Show("User Sucesfully Added"); populate(); } catch (Exception Ex) { MessageBox.Show(Ex.Message); } }
private void button1_Click(object sender, EventArgs e) { string query = "insert into AppointmentTab values('" + PatientCb.SelectedValue.ToString() + "','" + TreatmentCb.SelectedValue.ToString() + "','" + Date.Value.Date + "','" + Time.Value.TimeOfDay + "')"; Pasien Pat = new Pasien(); try { Pat.AddPatient(query); MessageBox.Show("Appointment Sucesfully Recorded"); populate(); } catch (Exception Ex) { MessageBox.Show(Ex.Message); } }
private void button1_Click(object sender, EventArgs e) { string query = "insert into PrescriptionTab values('" + PasId.SelectedValue.ToString() + "','" + TreatmentTab.Text + "','" + TreatCostTab.Text + "', '" + MedTab.Text + "', '" + QtyTab.Text + "')"; Pasien Pat = new Pasien(); try { Pat.AddPatient(query); MessageBox.Show("Treatment Sucesfully Added"); populate(); } catch (Exception Ex) { MessageBox.Show(Ex.Message); } }
private void DelButt_Click(object sender, EventArgs e) { Pasien Pat = new Pasien(); if (key == 0) { MessageBox.Show("Select the Patient"); } else { try { string query = "Delete from PrescriptionTab where PrescId=" + key + ""; Pat.DeletePatient(query); MessageBox.Show("Patient Sucesfully Deleted"); populate(); } catch (Exception Ex) { MessageBox.Show(Ex.Message); } } //Pasien Pat = new Pasien(); //if (key == 0) //{ // MessageBox.Show("Select the Prescription to Cancel"); //} //else //{ // try // { // string query = "Delete from PrescriptionTab where PrescId=" + key + ""; // Pat.DeletePatient(query); // MessageBox.Show("Prescription Succesfully Deleted"); // populate(); // } // catch (Exception Ex) // { // MessageBox.Show(Ex.Message); // } //} }
private void button2_Click(object sender, EventArgs e) { Pasien Pat = new Pasien(); if (key == 0) { MessageBox.Show("Select the User to Delete"); } else { try { string query = "Delete from UserTab where Ud=" + key + ""; Pat.DeletePatient(query); MessageBox.Show("User Succesfully Deleted"); populate(); } catch (Exception Ex) { MessageBox.Show(Ex.Message); } } }
private void button2_Click(object sender, EventArgs e) { Pasien Pat = new Pasien(); if (key == 0) { MessageBox.Show("Select the Appointment to Cancel"); } else { try { string query = "Delete from AppointmentTab where Apid=" + key + ""; Pat.DeletePatient(query); MessageBox.Show("Appointement Succesfully Deleted"); populate(); } catch (Exception Ex) { MessageBox.Show(Ex.Message); } } }
private void button3_Click(object sender, EventArgs e) { Pasien Pat = new Pasien(); if (key == 0) { MessageBox.Show("Select the User"); } else { try { string query = "Update UserTab set Uname='" + UsNameTab.Text + "',Upass="******",Uhp='" + UsPhoneTab.Text + "'where Ud=" + key + ";"; Pat.DeletePatient(query); MessageBox.Show("User Sucesfully Updated"); populate(); } catch (Exception Ex) { MessageBox.Show(Ex.Message); } } }
private void button3_Click(object sender, EventArgs e) { Pasien Pat = new Pasien(); if (key == 0) { MessageBox.Show("Select the Patient"); } else { try { string query = "Update PasTab set PatName='" + PatNameTab.Text + "',PatHp='" + PatHpTab.Text + "',PatAddress='" + PatAddresTab.Text + "',PatDOB='" + DOBDateCb.Value.Date + "',PatGender='" + GenCb.SelectedItem.ToString() + "',PatAllergies='" + PatAllergiesTab.Text + "'where Patid=" + key + ""; Pat.DeletePatient(query); MessageBox.Show("Patient Sucesfully Updated"); populate(); } catch (Exception Ex) { MessageBox.Show(Ex.Message); } } }
private void button3_Click(object sender, EventArgs e) { Pasien Pat = new Pasien(); if (key == 0) { MessageBox.Show("Select the Treatment"); } else { try { string query = "Update TreatmentTab set TreatName='" + TreatmentNameTab.Text + "',TreatDesc='" + TreatmentDesc.Text + "',TreatCost='" + TreatmentCostTab.Text + "'where Treatid=" + key + ""; Pat.DeletePatient(query); MessageBox.Show("Treatment Sucesfully Updated"); populate(); } catch (Exception Ex) { MessageBox.Show(Ex.Message); } } }
private void button3_Click(object sender, EventArgs e) { Pasien Pat = new Pasien(); if (key == 0) { MessageBox.Show("Select the Patient"); } else { try { string query = "Update AppointmentTab set Patient='" + PatientCb.SelectedValue.ToString() + "',Treatment='" + TreatmentCb.SelectedValue.ToString() + "',ApDate='" + Date.Value.Date + "',ApTime='" + Time.Value.TimeOfDay + "'where Apid=" + key + ""; Pat.DeletePatient(query); MessageBox.Show("Appointment Sucesfully Updated"); populate(); } catch (Exception Ex) { MessageBox.Show(Ex.Message); } } }