public void Release(DemandDTO Demand)
 {
     using (IDemandService dmSvc = new DemandService())
     {
         dmSvc.Create(DemandDTOToDemand(Demand));
     }
 }
 public Demand DemandDTOToDemand(DemandDTO Demand)
 {
     return(new Demand()
     {
         Content = Demand.Content,
         IsHidden = Demand.IsHidden,
         Introduction = Demand.Introduction,
         Title = Demand.Title,
         UserId = Demand.UserId
     });
 }
Example #3
0
        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"));
        }
Example #4
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));
        }
 public void Edit(DemandDTO demand)
 {
     throw new NotImplementedException();
 }
 public void ChangeHidden(DemandDTO demand)
 {
     throw new NotImplementedException();
 }