示例#1
0
        public IActionResult Post([FromBody] Appointment appointment)
        {
            OperationResult operationResult = new OperationResult();
            string appointmentString = string.Empty;

            appointmentString = appointment.AppointmentDescription;
            appointmentString = appointmentString.Replace("Appt on ", "");
            appointmentString = appointmentString.Replace("at ", "");
            string[] words = appointmentString.Split(' ');

            FairfieldAllergeryRepository fairfieldAllergeryRepository = new FairfieldAllergeryRepository();

            operationResult = fairfieldAllergeryRepository.AddAppointment(words[3], words[0] + words[1], appointment.Location.ToString(), appointment.UserId.ToString(), appointment.SlotID.ToString());

            if (operationResult.Success)
            {
                return Ok(new { status = "Success" });
            }
            else
            {
                return Ok(new { status = "Failure" });
            }
        }