public IHttpActionResult CreateDeliveryAppointmentDutchNed([FromBody] DutchNedDeliveryAppointment data, string apiKey) { try { // Check the api key var user = _userRepository.GetByUsername(User.Identity.Name); if (user.ApiKey != apiKey) { return(Unauthorized()); } var deliveryAppointment = new DeliveryAppointment() { Carrier = "999068", SalesOrderLineId = data.OrderLineId, DeliveryAppointmentStatus = data.Status, TransactionDate = DateTime.Parse(data.Date, null, System.Globalization.DateTimeStyles.RoundtripKind), }; _deliveryAppointmentRepository.Insert(deliveryAppointment); return(Ok(deliveryAppointment)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public void InsertDeliveryAppointment() { var rep = new DeliveryAppointmentRepository(); var status = new DeliveryAppointment() { Carrier = "999068", SalesOrderLineId = 0, DeliveryAppointmentStatus = 200, TransactionDate = DateTime.Now, }; rep.Insert(status); }