public IActionResult AddTreatment([FromForm] MedicAddTreatmentViewModel model) { if (!ModelState.IsValid) { return(BadRequest()); } medicsService.AddTreatment(model.AppointmentId, model.ClientId, model.MedicId, model.Equipment, model.Medication, model.EquipmentUsageTime, model.MedicationQuantityUsed, model.Diagnosis ); return(Redirect(Url.Action("AppointmentsTreatment", "Medics"))); }
public IActionResult AddTreatment(Guid Id) { var appointment = medicsService.GetAppointmentById(Id); var equipments = medicsService.GetEquipments(); var medications = medicsService.GetMedications(); MedicAddTreatmentViewModel medicAddTreatmentViewModel = new MedicAddTreatmentViewModel { AppointmentId = appointment.Id, ClientId = appointment.Client.Id, MedicId = appointment.Medic.Id, Equipments = new SelectList(equipments, "Id", "Name"), Medications = new SelectList(medications, "Id", "Name") }; return(View(medicAddTreatmentViewModel)); }