public void Appointment_AddNewAppointment() { string GUID = "5348CCBE-7BED-4B5C-A2CE-E3E872F2CBC5"; string WORKLOAD_GUID = "c1507019-1d97-4629-8015-c01bf02ce6ab"; ArdaTestMgr.Validate(this, $"AppointmentRepository.AddNewAppointment({GUID})", (list, ctx) => { AppointmentRepository appointment = new AppointmentRepository(ctx); var row = new AppointmentViewModel() { _AppointmentComment = "My Appointment", _AppointmentDate = DateTime.Parse("2020-01-20"), _AppointmentHoursDispensed = 8, _AppointmentID = Guid.Parse(GUID), _AppointmentTE = (decimal)100.0, _AppointmentUserUniqueName = "*****@*****.**", _AppointmentWorkloadWBID = Guid.Parse(WORKLOAD_GUID) }; appointment.AddNewAppointment(row); return(appointment.GetAllAppointmentsSimple()); }); }
protected void btnSave_Click(object sender, EventArgs e) { AppointmentFormTemplateContainer container = (AppointmentFormTemplateContainer)Parent; if (cbPatients.SelectedItem != null || cbDoctors.SelectedItem != null || cbClinics.SelectedItem != null || cbStatus.SelectedItem != null) { if (container.IsNewAppointment) { AppointmentViewModelFull app = new AppointmentViewModelFull() { ClinicID = int.Parse(cbClinics.SelectedItem.Value.ToString()), DoctorID = int.Parse(cbDoctors.SelectedItem.Value.ToString()), PatientID = int.Parse(cbPatients.SelectedItem.Value.ToString()), start_date = edtStartDate.Date, end_date = edtEndDate.Date, Reason = string.Empty, Status = cbStatus.SelectedItem.Text, text = tbDescription.Text }; AppointmentRepository apprep = new AppointmentRepository(); apprep.AddNewAppointment(app); } else { AppointmentViewModelFull app = new AppointmentViewModelFull() { id = int.Parse(container.Appointment.Id.ToString()), ClinicID = int.Parse(cbClinics.SelectedItem.Value.ToString()), DoctorID = int.Parse(cbDoctors.SelectedItem.Value.ToString()), PatientID = int.Parse(cbPatients.SelectedItem.Value.ToString()), start_date = edtStartDate.Date, end_date = edtEndDate.Date, Reason = string.Empty, Status = cbStatus.SelectedItem.Text, text = tbDescription.Text }; AppointmentRepository apprep = new AppointmentRepository(); apprep.alterAppointment(app); } Response.Redirect("~/Appoiment/Appoiments.aspx"); } else { //warining } }