Exemplo n.º 1
0
        public void SetControl(ICommentControlView cc, int j)
        {
            cc.AuthorNameField = comments[j].AuthorName;

            if (comments[j].AuthorIsSeller)
            {
                cc.AuthorType = cc.Seller;
            }
            else
            {
                cc.AuthorType = cc.Buyer;
            }

            cc.CommentField = comments[j].Comment;
            cc.DateField    = comments[j].Date.ToString("dd.MM.yyyy hh:mm");
            cc.AuctionField = comments[j].AuctionTitle;

            cc.AuthorNameNavUrl += comments[j].AuthorId;
            cc.AuctionNavUrl    += comments[j].AuctionId;
        }
Exemplo n.º 2
0
        public void LoadControls(ListView listView)
        {
            var commentControls = new List <CommentControl>();

            for (int i = 0; i < presenter.GetCommentsNum(); i++)
            {
                commentControls.Add(new CommentControl());
            }
            listView.DataSource = commentControls;
            listView.DataBind();

            int j = 0;

            foreach (var item in listView.Items)
            {
                ICommentControlView cc = (ICommentControlView)item.FindControl("CommentControl");
                cc.AuthorNameNavUrl = (HttpContext.Current.Handler as Page).ResolveUrl("~/PublicPages/User/UserProfile?id=");
                cc.AuctionNavUrl    = (HttpContext.Current.Handler as Page).ResolveUrl("~/PublicPages/Auction/AuctionPage?id=");
                presenter.SetControl(cc, j);
                j++;
            }
        }
Exemplo n.º 3
0
 public CommentControlPresenter(ICommentControlView view)
 {
     this.view = view;
 }