public IHttpActionResult Create([FromBody] Appointment appointment) { try { return(Content(HttpStatusCode.OK, _appointmentManager.Add(appointment))); } catch (Exception ex) { return(Content(HttpStatusCode.InternalServerError, ex.Message)); } }
public override IHttpActionResult Post(AppointmentViewModel viewModel) { var dresses = viewModel.Dresses.Select(i => i.Id); Appointment item = new Appointment { Name = viewModel.Name, Phone = viewModel.Phone, Date = viewModel.Date, Details = viewModel.Details, IsApprove = viewModel.IsApprove, ApprovedDate = DateTime.Now }; Appointment model = appointmentManager.Add(item, dresses); return(Ok(model.Id)); }
public int SaveAppointment(Appointment appointment) { return(appointmentManager.Add(appointment)); }