Ejemplo n.º 1
0
        public ConfirmPickupOrderResponse ConfirmPickupOrder(ConfirmPickupOrderRequest request)
        {
            ConfirmPickupOrderResponse response = new ConfirmPickupOrderResponse();

            try
            {
                if (!AgentAdminServices.CheckAdmin(request.user_id, request.auth_token, response))
                {
                    return(response);
                }
                using (TeleOrderDao dao = new TeleOrderDao())
                {
                    TeleOrder order = dao.FindById(request.order_id, true);
                    order.StatusId = OrdersServices.ID_ORDER_CLOSED;
                    string invNo = InvoiceService.GenerateInvoiceNumber(order.AgentAdmin.AgenID);
                    order.InvoiceNumber = invNo;
                    dao.Update(order);
                    dao.Update(order);
                    OrderPickupHelper.CopyFromEntity(response, order);

                    response.code         = 0;
                    response.has_resource = 1;
                    response.message      = MessagesSource.GetMessage("cnfrm.pickup.order");
                }
            }
            catch (Exception ex)
            {
                response.MakeExceptionResponse(ex);
            }

            return(response);
        }
Ejemplo n.º 2
0
        public NegotiatedContentResult <ConfirmPickupOrderResponse> PostConfirmPickupOrder([FromBody] ConfirmPickupOrderRequest request)
        {
            ConfirmPickupOrderResponse resp = _orderpickupServices.ConfirmPickupOrder(request);

            return(Content(HttpStatusCode.OK, resp));
        }
 public static void CopyToEntity(Order order, ConfirmPickupOrderRequest request)
 {
     order.OrdrID = request.order_id; // user_id, auth_token
 }