Пример #1
0
        /// <summary>
        /// 添加订单
        /// </summary>
        /// <param name="OrderData"></param>
        /// <returns></returns>
        public int AddOrders(PlaceOrder OrderData)
        {
            Order order = new Order();
            //var query = (from c in HouseAppEntities.Order
            //             orderby c.UserID descending
            //             select c);
            //u1.UserID = query.First<User>().UserID + 1;
            //order.OrderID ;
            order.CreaterID = OrderData.CreaterID ;
            order.CreateDateTime = DateTime.Now;
            order.ProductName = OrderData.ProductName;
            order.ProductWeight = OrderData.ProductWeight;
            order.Remarks = OrderData.Remarks;
            order.SenderName = OrderData.SenderName;
            order.SenderPhone = OrderData.SenderPhone;
            order.SenderAddress = OrderData.SenderAddress;
            order.ReceiverName = OrderData.ReceiverName;
            order.ReceiverPhone = OrderData.ReceiverPhone;
            order.ReceiverAddress = OrderData.ReceiverAddress;
            order.State = 0;                                   //刚下单,状态为"0"
            order.PointX = OrderData.PointX;
            order.PointY = OrderData.PointY;
            order.PointX2 = OrderData.PointX2;
            order.PointY2 = OrderData.PointY2;
            order.Street = OrderData.Street;

            HouseAppEntities.Order.Add(order);
            int effect = -1;
            effect = HouseAppEntities.SaveChanges();
            return effect;
        }
Пример #2
0
 /// <summary>
 /// 得到订单
 /// </summary>
 /// <param name="ID"></param>
 /// <returns></returns>
 public Order GetOrderByOrderID(int ID)
 {
     var query = (from c in HouseAppEntities.Order
                  where c.OrderID == ID
                  select c);
     Order order = new Order();
     order = query.First();
     return order;
 }
Пример #3
0
        public string GetOrder(string userData)
        {
            JavaScriptSerializer jsonSerializer = new JavaScriptSerializer();
            int orderID = jsonSerializer.Deserialize<int>(userData);

            BackstageBusiness backstage = new BackstageBusiness();

            WebService ws = new WebService();
            Order order = new Order();

            if (myHeader != null && ws.VerifyUser(myHeader.UserName, myHeader.Password))
            {
                order = backstage.GetOrderByOrderID(orderID);
            }
            else
            {
                return jsonSerializer.Serialize("loginfalse");
            }
            return jsonSerializer.Serialize(order);
        }