public int checkyuyue(long lid) { long userid = (long)Session["LoginUserId"]; long guideid = GuideLineSvc.GetGid(lid); var guide = GuideSvc.GetById(guideid); if (guide != null) { if (guide.Users_Id == userid) { return(1); } if (guide.isappointment) { return(2); } } else { return(4); } long[] oid = OrderUserSvc.GetById(userid); var tids = OrderSvc.GetByTids(oid); foreach (var item in tids) { if (lid == item) { return(3); } } return(0); }
/// <summary> /// 个人中心 /// </summary> /// <returns></returns> public ActionResult Center() { var user = UserSvc.GetById((long)UserHelper.GetUserId(HttpContext)); var ids = OrderUserSvc.GetById(user.Id).LastOrDefault(); var orders = OrderSvc.GetById(ids); UserOrderInfo info = new UserOrderInfo(); info.user = user; info.orders = orders; ViewBag.phonenum = user.PhoneNum; ViewBag.userid = UserHelper.GetUserId(HttpContext); ViewBag.IsGuide = new UserService().IsGuide((long)Session["LoginUserId"]); return(View(info)); }
/// <summary> /// 我的订单 /// </summary> /// <returns></returns> public ActionResult MyOrder(long userid) { var user = UserSvc.GetById((long)userid); var ids = OrderUserSvc.GetById(user.Id); var orders = OrderSvc.GetByIds(ids); MyOrderViewModel model = new MyOrderViewModel(); model.orders = orders; var guide = GuideSvc.GetByUid(userid); model.isguide = false; if (guide != null) { model.isguide = true; } ViewBag.phonenum = user.PhoneNum; return(View(model)); }