Beispiel #1
0
        /// <summary>
        /// 确认取货
        /// </summary>
        /// <UpdateBy>hulingbo</UpdateBy>
        /// <UpdateTime>20150520</UpdateTime>
        /// <param name="modelPM"></param>
        /// <returns></returns>
        public ResultModel <string> ConfirmTake(OrderPM modelPM)
        {
            #region 验证
            if (string.IsNullOrWhiteSpace(modelPM.Version)) //版本号
            {
                return(ResultModel <string> .Conclude(ConfirmTakeStatus.NoVersion));
            }
            if (modelPM.OrderId <= 0)//订单Id不合法
            {
                return(ResultModel <string> .Conclude(ConfirmTakeStatus.ErrId));
            }
            if (modelPM.ClienterId <= 0)  //骑士Id不合法
            {
                return(ResultModel <string> .Conclude(ConfirmTakeStatus.ClienterIdEmpty));
            }
            #endregion

            try
            {
                iOrderProvider.UpdateTake(modelPM);
                return(ResultModel <string> .Conclude(ConfirmTakeStatus.Success, ""));
            }
            catch (Exception ex)
            {
                LogHelper.LogWriter(" ResultModel<string> ConfirmTake", new { obj = "时间:" + DateTime.Now.ToString() + ex.Message });
                return(ResultModel <string> .Conclude(ConfirmTakeStatus.Failed));
            }
        }
Beispiel #2
0
        public ResultModel <OrderDM> GetDetails(OrderPM modelPM)
        {
            #region 验证
            if (string.IsNullOrWhiteSpace(modelPM.Version)) //版本号
            {
                return(ResultModel <OrderDM> .Conclude(GetOrdersStatus.NoVersion));
            }
            if (modelPM.OrderId < 0)//订单Id不合法
            {
                return(ResultModel <OrderDM> .Conclude(GetOrdersStatus.ErrOderNo));
            }
            if (!iOrderProvider.IsExist(modelPM.OrderId)) //订单不存在
            {
                return(ResultModel <OrderDM> .Conclude(GetOrdersStatus.FailedGetOrders));
            }

            #endregion

            try
            {
                OrderDM orderDM = iOrderProvider.GetDetails(modelPM);
                return(ResultModel <OrderDM> .Conclude(GetOrdersStatus.Success, orderDM));
            }
            catch (Exception ex)
            {
                LogHelper.LogWriter(" ResultModel<OrderDM> GetDetails", new { obj = "时间:" + DateTime.Now.ToString() + ex.Message });
                return(ResultModel <OrderDM> .Conclude(GetOrdersStatus.Failed));
            }
        }
Beispiel #3
0
        public IActionResult MakeOrder()
        {
            ViewBag.CurrentUser = HttpContext.GetCurrentUserFromCookie();

            var order = new OrderPM();

            ViewBag.Services = _mapper.Map <List <ServicePM> >(_serviceManager.ServiceTypesService.GetServices((int)ServicesNames.SPECIAL_EVENT_SERVICES));

            return(View(order));
        }
        public void SetOrderStatus(OrderPM order)
        {
            switch (order.StatusId)
            {
            case (int)OrderStatusNames.New: order.StatusName = "Новый"; break;

            case (int)OrderStatusNames.Rejected: order.StatusName = "Отклонен"; break;

            case (int)OrderStatusNames.Done: order.StatusName = "Выполнен"; break;

            case (int)OrderStatusNames.InProgress: order.StatusName = "Выполняется"; break;
            }
        }
        public IActionResult MakeOrder(OrderPM orderPM, List <int> additionIds)
        {
            var currentUser = HttpContext.GetCurrentUserFromCookie();
            var userName    = _serviceManager.UsersService.GetById(currentUser.UserId).Name;

            orderPM.UserId = currentUser.UserId;

            var orderAdditions = new List <OrderAdditions>();

            foreach (var additionId in additionIds)
            {
                orderAdditions.Add(new OrderAdditions()
                {
                    AdditionId = additionId
                });
            }

            _serviceManager.OrdersService.Save(_mapper.Map <OrderDTO>(orderPM), orderAdditions);

            return(Redirect("ShowClientOrders"));
        }