Exemplo n.º 1
0
        public static IrregularOrder ConvertToIrregularOrder(TOrder order)
        {
            IrregularOrder irregularOrder = new IrregularOrder();

            DateTime tempDate;

            irregularOrder.id                   = order.OrderId;
            irregularOrder.created_by           = order.CreateBy;
            irregularOrder.closed_date          = DateTime.TryParse(order.CloseDate, out tempDate) ? tempDate : (DateTime?)null;
            irregularOrder.created_date         = DateTime.Parse(order.CreateDate);
            irregularOrder.order_status         = order.OrderStaus;
            irregularOrder.payment_status       = order.PaymentStatus;
            irregularOrder.recipient_id_card_no = order.RecipientIdNo;
            irregularOrder.recipient_name       = order.RecipientName;
            irregularOrder.recipient_phone      = order.RecipientPhone;
            irregularOrder.recipient_address    = string.Empty;
            irregularOrder.sender_id_card_no    = order.SenderIdNo;
            irregularOrder.sender_name          = order.SenderName;
            irregularOrder.sender_phone         = order.SenderPhone;
            irregularOrder.sender_address       = string.Empty;
            irregularOrder.total_cost           = decimal.Parse(order.TotalCost.ToString());;
            irregularOrder.total_quantity       = order.TotalQuantity;
            irregularOrder.total_value          = decimal.Parse(order.TotalValue.ToString());
            irregularOrder.confirmation_user_id = string.Empty;
            irregularOrder.tour_id              = order.Destination;

            return(irregularOrder);
        }
        public string UpdateSingleOrderInfoRequest(EntityObject order)
        {
            try
            {
                TOrder torder = ThriftUtil.ConvertToTOrder(order);

                return(_targetServer.UpdateSingleOrderInfo(torder, SystemParam.CurrentUser.id));
            }
            catch (Exception exc)
            {
                AppLogger.logError("{REQUEST-ERROR} UpdateOrderInfoRequest", exc);
                return(exc.Message);
            }
        }
        public string DeleteOrderInfoRequest(EntityObject order)
        {
            try
            {
                TOrder torder = ThriftUtil.ConvertToTOrder(order);

                //OpenTransaction();
                return(_targetServer.DeleteOrder(torder, SystemParam.CurrentUser.id));
                //CloseTransaction();
            }
            catch (Exception exc)
            {
                AppLogger.logError("{REQUEST-ERROR} DeleteOrderInfoRequest", exc);
                return(exc.Message);
            }
        }
        public string CreateOrderRequest(EntityObject order, List <OrderItem> orderItems)
        {
            try
            {
                TOrder torder = ThriftUtil.ConvertToTOrder(order);

                List <TOrderItem> torderItems = ThriftUtil.ConvertToTOrderItemList(orderItems);

                //OpenTransaction();
                return(_targetServer.CreateOrder(torder, torderItems, SystemParam.CurrentUser.id));
                //CloseTransaction();
            }
            catch (Exception exc)
            {
                AppLogger.logError("{REQUEST-ERROR} CreateOrderRequest", exc);
                return(exc.Message);
            }
        }
Exemplo n.º 5
0
        public static TOrder ConvertToTOrder(RegularOrder order)
        {
            TOrder torder = new TOrder();

            torder.OrderId       = order.id;
            torder.CloseDate     = order.closed_date.ToString();
            torder.CreateBy      = order.created_by;
            torder.CreateDate    = order.created_date.ToString();
            torder.OrderStaus    = order.order_status;
            torder.PaymentStatus = order.payment_status;
            torder.RecipientId   = order.recipient_id;
            torder.SenderId      = order.sender_id;
            torder.TotalCost     = double.Parse(order.total_cost.ToString());
            torder.TotalQuantity = order.total_quantity;
            torder.TotalValue    = double.Parse(order.total_value.ToString());
            torder.Destination   = order.tour_id;
            torder.Type          = Constants.VALUE_ORDER_TYPE_REGULAR;

            return(torder);
        }
Exemplo n.º 6
0
        public static RegularOrder ConvertToRegualrOrder(TOrder order)
        {
            RegularOrder regularOrder = new RegularOrder();

            DateTime tempDate;

            regularOrder.id             = order.OrderId;
            regularOrder.created_by     = order.CreateBy;
            regularOrder.closed_date    = DateTime.TryParse(order.CloseDate, out tempDate) ? tempDate : (DateTime?)null;
            regularOrder.created_date   = DateTime.Parse(order.CreateDate);
            regularOrder.order_status   = order.OrderStaus;
            regularOrder.payment_status = order.PaymentStatus;
            regularOrder.recipient_id   = order.RecipientId;
            regularOrder.sender_id      = order.SenderId;
            regularOrder.tour_id        = order.Destination;
            regularOrder.total_cost     = decimal.Parse(order.TotalCost.ToString());
            regularOrder.total_quantity = order.TotalQuantity;
            regularOrder.total_value    = decimal.Parse(order.TotalValue.ToString());

            return(regularOrder);
        }
Exemplo n.º 7
0
 public string CompleteOrder(TOrder order)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 8
0
 public string UpdateOrderInfo(TOrder order, List <TOrderItem> orderItems)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 9
0
 public string CreateTransportOrder(TOrder order, List <TOrderItem> orderItems)
 {
     throw new NotImplementedException();
 }
 public string DeleteOrder(TOrder order, string userId)
 {
     return(_deleteOrder(order, userId));
 }
 public string UpdateSingleOrderInfo(TOrder order, string userId)
 {
     return(_updateSingleOrderInfo(order, userId));
 }
 public string UpdateOrder(TOrder order, List <TOrderItem> orderItem, string userId)
 {
     return(_updateOrderInfo(order, orderItem, userId));
 }
 public string CreateOrder(TOrder order, List <TOrderItem> orderItem, string userId)
 {
     return(_createOrder(order, orderItem, userId));
 }