public IHttpActionResult DispatchDeliveryRequest(DeliveryRequestBindingModel obj) { try { _deliveryRequestService.DispatchDeliveryRequest(obj); Log.Info($"{typeof(DeliveryRequestController).FullName}||{UserEnvironment}|| Despatched successful."); return(Content(HttpStatusCode.OK, "Despatched successful ")); } catch (Exception ex) { return(BadRequest()); } }
public bool DispatchDeliveryRequest(DeliveryRequestBindingModel obj) { var deliveryRequest = _deliveryRequestRepository.GetById(obj.Id); if (deliveryRequest != null) { deliveryRequest.DespatchedBy = obj.DespatchedBy; deliveryRequest.DespatchedDate = obj.DespatchedDate; deliveryRequest.Despatched = true; deliveryRequest.UpdatedBy = obj.UpdatedBy; deliveryRequest.PickedBy = obj.PickedBy; deliveryRequest.StatusId = 15; _deliveryRequestRepository.Update(deliveryRequest); return(true); } else { return(false); } }