Example #1
0
 /// <summary>
 /// 根据买家ID获取该用户的成交记录
 /// </summary>
 /// <returns></returns>
 public ActionResult MyDeals()
 {
     var session = Session["logID"];
        if (session == null)
        {
        return RedirectToAction("Login", "Home");
        }
        else
        {
        int userid = Int32.Parse(session.ToString());
        DealBll bll = new DealBll();
        var list = bll.GetDealsByBuyManId(userid);
        return View(list);
        }
 }
Example #2
0
        /// <summary>
        /// 卖家同意出售给购买人。
        /// </summary>
        /// <returns></returns>
        public ActionResult OKToSale(int id)
        {
            OrderBll orderBll=new OrderBll();
            var order = orderBll.GetOrderById(id);
            DealBll dealBll=new DealBll();
            DealModel newDeal=new DealModel();
            newDeal.BuyManID = order.BuyManID;
            newDeal.CarID = order.CarID;
            newDeal.Price = order.Price;
            newDeal.SaleManID = order.SaleManID;
            newDeal.Time = DateTime.Now;

            dealBll.AddDeal(newDeal);//添加到成交记录

            CarBll carBll = new CarBll();//车辆信息修改为已售
            carBll.ChageCarStatusToSold(order.CarID);

            orderBll.RemoveOrder(id);//从订单记录中删除

            return RedirectToAction("MyOrders", "SaleMan");
        }