public ActionResult ConfirmDemand(string id) { //string id = Request.QueryString["OrderId"].ToString(); Guid demandId = Guid.Parse(id); IDemandManager demandManager = new DemandManager(); demandManager.Confirm(demandId); return(RedirectToAction("Index")); }
public ActionResult RelaseDemand(RelaseDemandViewModel model) { Guid userId = Guid.Parse(Session["UserId"].ToString()); DemandDTO demand = new DemandDTO() { Content = model.Content, Introduction = model.Introduction, Title = model.Title, UserId = userId, IsHidden = true }; IDemandManager demandManger = new DemandManager(); demandManger.Release(demand); return(RedirectToAction("SucessResult", "Home")); }
public ActionResult Myaccount() { Guid userId = Guid.Parse(Session["UserId"].ToString()); MyaccountViewModel model = new MyaccountViewModel(); IOrderManager orderManager = new OrderManager(); ICommentManager commentManager = new CommentManager(); IDemandManager demandManager = new DemandManager(); model.orders = orderManager.GetAllOrderByUserId(userId); model.demands = demandManager.GetAllDemandByUserId(userId); model.comments = commentManager.GetAllCommentByUserId(userId); return(View(model)); }
public void TestMethod4() { Guid userId = Guid.Parse(/*Session["UserId"].ToString()*/ "d575d2d9-3a22-4465-9fe3-259ab0391988"); MyaccountViewModel model = new MyaccountViewModel(); IOrderManager orderManager = new OrderManager(); ICommentManager commentManager = new CommentManager(); IDemandManager demandManager = new DemandManager(); model.orders = orderManager.GetAllOrderByUserId(userId); model.demands = demandManager.GetAllDemandByUserId(userId); model.comments = commentManager.GetAllCommentByUserId(userId); Assert.IsNotNull(model.comments); Assert.IsNotNull(model.orders); Assert.IsNotNull(model.demands); }
public void TestMethod2() { DemandManager dm = new DemandManager(); dm.Release(new Domain.DTO.DemandDTO() { Content = "这是2句话,这是3句话,这是4句话,这是5句话,这是6句话,这是6句话,", Title = "这是一句标题", Introduction = "123123", UserId = Guid.Parse("d575d2d9-3a22-4465-9fe3-259ab0391988") }); //foreach (var item in dm.GetAllDemand()) //{ // Assert.AreEqual(Guid.Parse("1e38e6a5-1684-4b2c-95de-196b8bf7690"), item.UserId); //} }
public ActionResult DemandDetail(Guid?id) { if (id == null) { return(RedirectToAction("Index", "Home")); } IDemandManager demandManager = new DemandManager(); DemandDTO demand = demandManager.GetDemand(id.Value); ICommentManager commentManager = new CommentManager(); List <CommentDTO> comments = commentManager.GetAllComment(id.Value); List <ReplyDTO> replys = new List <ReplyDTO>(); foreach (var item in comments) { IReplyManager replyManager1 = new ReplyManager(); replys.Add(replyManager1.GetReply(item.CommentId)); } ViewBag.comment = comments; ViewBag.reply = replys; IReplyManager replyManager = new ReplyManager(); return(View(demand)); }
public ActionResult Index() { IDemandManager demandManager = new DemandManager(); return(View(demandManager.GetAllDemand())); }