Example #1
0
        /*
         * void Menu1_MenuItemClick(object sender, MenuEventArgs e)
         * {
         *  MenuItem caller = sender as MenuItem;
         *  Session["ChangedTheme"] = true;
         *
         *  if (e.Item.Parent.Text == "Theme")
         *  {
         *      Session["Theme"] = e.Item.Text;
         *  }
         * }*/

        protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ListBox1.SelectedItem != null)
            {
                Article        item     = dbAccess.getArticle(Int32.Parse(ListBox1.SelectedItem.Value));
                List <Comment> comments = dbAccess.getComments(item.Id);
                ArticleTitle.Text        = item.Title;
                ArticleSubtitle.Text     = item.SubTitle;
                TextBox1.Text            = item.Text;
                TextBoxComments.TextMode = TextBoxMode.MultiLine;

                TextBoxComments.Text = "";
                foreach (Comment itemC in comments)
                {
                    TextBoxComments.Text += itemC.Content;
                    TextBoxComments.Text += "\n\n";
                }
                //ArticleImage.ImageUrl
            }
        }
Example #2
0
        public void sendComment(Commentary commentary, People people, Paper paper)
        {
            Comment commentDb = new Comment();
            User    user      = bl.getUser(people.UserName, people.Password);
            Article article   = bl.getArticle((int)paper.Id);/*
                                                              * user.Id = people.Id;
                                                              * user.FirstName = people.FirstName;
                                                              * user.LastName = people.LastName;
                                                              * user.UserName = people.UserName;
                                                              * user.Password = people.Password;
                                                              * user.Right = people.Right;/*
                                                              * article.Author = paper.Author;
                                                              * article.Id = (int)paper.Id;
                                                              * article.Overview = paper.Overview;
                                                              * article.SubTitle = paper.SubTitle;
                                                              * article.Text = paper.Body;*/

            commentDb.User     = user;
            commentDb.Rating   = commentary.Rating;
            commentDb.Content  = commentary.Content;
            commentDb.Article1 = article;
            bl.addComment(commentDb);
        }