public static Content CurrentAppointment(HospitalAppointmentModel model) { return(new Content { Title = String.Format("Antrian di {0} {1} {2}", model.MedicalStaff.Title, model.MedicalStaff.FirstName, model.MedicalStaff.LastName), Body = String.Format("Antrian No. {0} sedang berjalan. Estimasi giliran anda {1}", model.QueueNumber, model.AppointmentDate.ToString("dd/MM/yyyy hh:mm", CultureInfo.InvariantCulture)) }); }
public static Content BookingDoctor(HospitalAppointmentModel model, bool includeLinkDownload = true) { string linkdonwload = includeLinkDownload == false ? String.Empty : "Untuk update antrian secara real time, silahkan download aplikasi SmartMedika pada link berikut: http://smartmedika.com/download"; return(new Content { Title = String.Format("Antrian di {0} {1} {2}", model.MedicalStaff.Title, model.MedicalStaff.FirstName, model.MedicalStaff.LastName), Body = String.Format("Antrian anda No. {0} dengan estimasi waktu tindakan {1} yang berlokasi di {2}. {3}", model.QueueNumber, model.AppointmentDate.ToString("dd/MM/yyyy hh:mm", CultureInfo.InvariantCulture), HospitalInfo(model.Hospital), linkdonwload) }); }
public async Task <IActionResult> BookingDoctor([FromBody] HospitalAppointmentModel param) { AssignModelState(); var result = await _appointmentService.CreateForNonRegisteredUserAsync(param); if (result.Success) { return(Ok(result.Item)); } else { return(BadRequest(result.Message)); } }
public IActionResult Edit(int id, [FromBody] HospitalAppointmentModel param) { AssignModelState(); param.Id = id; param.UserId = _authService.GetUserId() ?? 0; var result = _appointmentService.Edit(param); if (result.Success) { return(Ok(result.Item)); } else { return(BadRequest(result.Message)); } }
public async Task <IActionResult> Create([FromBody] UserAppointmentViewModel param) { var appt = new HospitalAppointmentModel { Id = param.Id, AppointmentDate = param.AppointmentDate, MedicalStaffId = param.MedicalStaffId, HospitalId = param.HospitalId }; int?userId = _authService.GetUserId(); appt.UserId = userId ?? 0; if (param.PatientProblems != null) { List <HospitalAppointmentDetailModel> patiens = new List <HospitalAppointmentDetailModel>(); foreach (var item in param.PatientProblems) { patiens.Add(new HospitalAppointmentDetailModel { PatientId = item.PatientId, Problem = item.Problems }); } appt.AppointmentDetails = patiens; } AssignModelState(); var result = await _appointmentService.Create(appt); if (result.Success) { return(Ok(result.Item)); } else { return(BadRequest(result.Message)); } }