Beispiel #1
0
        public OrderDetailForRiderRes(List <OrderTryJoin> viewList)
        {
            var view = viewList.First();

            userAddress         = new userAddress();
            userAddress.address = view.mapAddress;
            userAddress.detail  = view.addrDetail;
            userAddress.name    = view.contactName;
            userAddress.phone   = view.contactPhone;
            listFoods           = new List <fnapi>();
            status = (int)view.status;
            foreach (var item in viewList)
            {
                fnapi food = new fnapi();
                food.foodName  = item.foodName;
                food.amount    = (int)item.amount;
                food.foodPrice = item.foodPrice.ToString();
                food.isMain    = (bool)item.isMain;
                listFoods.Add(food);
            }
            remarks = view.remarks;
            if (view.arrivalTime != null && view.timeArea != null)
            {
                arriveTime = Convert.ToDateTime(view.arrivalTime).ToString("yyyy-MM-dd") + " " + view.timeArea;
            }
            else
            {
                arriveTime = "";
            }
        }
Beispiel #2
0
        public OrderDetailRes(List <OrderTryJoin> viewList)
        {
            var view = viewList.First();

            deposit  = view.deposit.ToString();
            timeArea = view.timeArea;

            if (!string.IsNullOrEmpty(view.riderPhone))
            {
                riderPhone = view.riderPhone;
            }
            else
            {
                riderPhone = "";
            }

            userAddress         = new userAddress();
            userAddress.address = view.mapAddress;
            userAddress.detail  = view.addrDetail;
            userAddress.name    = view.contactName;
            userAddress.phone   = view.contactPhone;
            listFoods           = new List <foodName_Amount_Price_isMain>();
            status = (int)view.status;
            PriceRes price = new PriceRes();

            if (status == 0)
            {
                price.payMoney   = (decimal)view.payMoney;
                price.useCoupon  = (decimal)view.useCoupon;
                price.useBalance = (decimal)view.useBalance;
            }
            priceAll = price;
            foreach (var item in viewList)
            {
                foodName_Amount_Price_isMain food = new foodName_Amount_Price_isMain();
                food.foodName  = item.foodName;
                food.amount    = (int)item.amount;
                food.foodPrice = (decimal)item.foodPrice;
                food.isMain    = (bool)item.isMain;
                listFoods.Add(food);
            }
            remarks = view.remarks;
            if (view.createTime.Value.AddDays(1) > DateTime.Now)
            {
                var a    = (DateTime.Now.Ticks - view.createTime.Value.Ticks) / 10000000;
                var temp = 900 - Convert.ToInt32(a);//-txy 改回900
                restSeconds = temp <= 0 ? -1 : temp;
            }
            else
            {
                restSeconds = -1;
            }
            isActual = (bool)view.isActual;
        }