Example #1
0
        public ActionResult List(string ChannelName)
        {
            List <Comment> Comments = _commentService.GetActive();

            Dictionary <string, string> comments = new Dictionary <string, string>();

            TubeRehber.Model.Entities.Channel channel = _channelService.GetChannelByChannelName(ChannelName);

            string ChannelID = channel.ID.ToString();


            foreach (var item in Comments)
            {
                if (item.ChannelID.ToString() == ChannelID)
                {
                    TubeRehber.Model.Entities.Member member = _memberService.GetByID(item.MemberID);


                    comments.Add(item.comment, member.UserName);
                }
            }
            TempData["Yorumlar"] = comments;

            return(View());
        }
Example #2
0
        public ActionResult Add(TubeRehber.Model.Entities.Comment data, string ChannelName)
        {
            if (data.comment != null)
            {
                TubeRehber.Model.Entities.Member currentUser = _memberService.GetuserByUserName(HttpContext.User.Identity.Name);
                data.MemberID = currentUser.ID;
                TubeRehber.Model.Entities.Channel channel = _channelService.GetChannelByChannelName(ChannelName);
                data.ChannelID = channel.ID;


                _commentService.Add(data);
                _commentService.Save();
            }
            return(RedirectToAction("Index"));
        }
        public ActionResult Add(TubeRehber.Model.Entities.Channel data, TubeRehber.Model.Entities.Category data2)
        {
            CategoryName = data2.CategoryName;


            data.Status = TubeRehber.Core.Entity.Enum.Status.Active;
            TubeRehber.Model.Entities.Category category = _categoryService.GetCategoryByCategoryName(CategoryName);
            data.CategoryID = category.ID;



            _channelService.Add(data);
            _channelService.Save();



            return(RedirectToAction("Index"));
        }