Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        public void TestMethod3()
        {
            CommentManager cm = new CommentManager();

            //cm.Relase(new Domain.DTO.CommentDTO()
            //{
            //    Content = "游戏内容的同时开发新的领域。这样玩家们就能在享受和支持游戏和制作者的同时让其能获得长足的发展",
            //    DemandId = Guid.Parse("34c35b45-09d1-4be3-8d96-27618b32a00c"),
            //    MaxPrice = 50.0f,
            //    MinPrice = 20.0f,
            //    Title = "佛了",
            //    UserId = Guid.Parse("d575d2d9-3a22-4465-9fe3-259ab0391988")
            //});
            Assert.IsNotNull(cm.GetAllComment(Guid.Parse("d2326cb9-12c5-4236-a496-6f320fcbf1ea")).Count > 0);
            //if(cm.GetAllComment(Guid.Parse()).Count > 0);
        }
Ejemplo n.º 4
0
        public ActionResult CreateOrder()
        {
            string          id             = Request.QueryString["CommentId"].ToString();
            Guid            commentGuid    = Guid.Parse(id);
            IOrderManager   orderManager   = new OrderManager();
            ICommentManager commentManager = new CommentManager();
            CommentDTO      commentDTO     = commentManager.GetComment(commentGuid);

            orderManager.Relase(new OrderDTO()
            {
                CommentId  = commentDTO.CommentId,
                CreateTime = commentDTO.CreateTime,
                DemandId   = commentDTO.DemandId,
                OrderState = 100000,
                UserId     = commentDTO.UserId
            });
            return(RedirectToAction("SucessResult", "Home"));
        }
Ejemplo n.º 5
0
        public ActionResult RelaseComment(string comment_title, string comment_MinPrice, string comment_MaxPrice, string comment_content, string comment_UserId, string comment_DemandId)
        {
            ICommentManager commentManager = new CommentManager();

            commentManager.Relase(new CommentDTO()
            {
                Content  = comment_content,
                MaxPrice = Convert.ToSingle(comment_MaxPrice),
                MinPrice = Convert.ToSingle(comment_MinPrice),
                Title    = comment_title,
                UserId   = Guid.Parse(Session["UserId"].ToString()),
                DemandId = Guid.Parse(comment_DemandId)
            });
            IReplyManager replyManager = new ReplyManager();



            return(RedirectToAction("SucessResult", "Home"));
        }
Ejemplo n.º 6
0
        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));
        }