Пример #1
0
 public void Release(DemandDTO Demand)
 {
     using (IDemandService dmSvc = new DemandService())
     {
         dmSvc.Create(DemandDTOToDemand(Demand));
     }
 }
Пример #2
0
 public Demand DemandDTOToDemand(DemandDTO Demand)
 {
     return(new Demand()
     {
         Content = Demand.Content,
         IsHidden = Demand.IsHidden,
         Introduction = Demand.Introduction,
         Title = Demand.Title,
         UserId = Demand.UserId
     });
 }
Пример #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"));
        }
Пример #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));
        }
Пример #5
0
 public void Edit(DemandDTO demand)
 {
     throw new NotImplementedException();
 }
Пример #6
0
 public void ChangeHidden(DemandDTO demand)
 {
     throw new NotImplementedException();
 }