Пример #1
0
 public void SetPatientHistory(int id)
 {
     PatientHistoryAccessor patientAccessor = new PatientHistoryAccessor();
     var patient = patientAccessor.FindById(id);
     this._id = id;
     patient.ID = this._id;
     cboPatient.SelectedValue = patient.PatientID;
     cboDoctor.SelectedValue = patient.DoctorID;
     txtMedicine.Text = patient.Medicine;
     txtDescription.Text = patient.Description;
     dtpCheckDate.Value = patient.CheckDate;
     dtpAppointmentDate.Value = patient.AppointmentDate;
 }
Пример #2
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     PatientHistoryAccessor patientAccessor = new PatientHistoryAccessor();
     var patient = new PatientHistory();
     patient.ID = this._id;
     patient.PatientID = (int)cboPatient.SelectedValue;
     patient.DoctorID = (int)cboDoctor.SelectedValue;
     patient.Medicine = txtMedicine.Text;
     patient.Description = txtDescription.Text;
     patient.CheckDate = dtpCheckDate.Value;
     patient.AppointmentDate = dtpAppointmentDate.Value;
     patientAccessor.InsertOrUpdate(patient);
     this.Close();
 }
Пример #3
0
 void RefreshGridView()
 {
     var accessor = new PatientHistoryAccessor();
     gvMain.DataSource = accessor.FindAll();
 }