Пример #1
0
 public void Update(PatientHistory model)
 {
     using (var db = new DbManager())
     {
         var query = new SqlQuery<PatientHistory>();
         query.Update(model);
     }
 }
Пример #2
0
 public void Insert(PatientHistory model)
 {
     using (var db = new DbManager())
     {
         var query = new SqlQuery<PatientHistory>();
         query.Insert(model);
     }
 }
Пример #3
0
        public void InsertOrUpdate(PatientHistory model)
        {
            var modelInDb = this.FindById(model.ID);

            if (modelInDb == null)
                this.Insert(model);
            else
                this.Update(model);
        }
Пример #4
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();
 }