Ejemplo n.º 1
0
        public List <News> getNews()
        {
            List <News> newsList = new List <News>();

            foreach (New n in bl.getNews())
            {
                if (n != null)
                {
                    newsList.Add(new News(n));
                }
            }
            return(newsList);
        }
Ejemplo n.º 2
0
        private void TreeView1_Load(object sender, EventArgs e)
        {
            listNews     = new List <New>(dbAccess.getNews());
            listArticles = new List <Article>(dbAccess.getArticles());

            TreeNodeCollection newsNodes     = TreeView1.FindNode("News.Root").ChildNodes;
            TreeNodeCollection articlesNodes = TreeView1.FindNode("Articles.Root").ChildNodes;

            newsNodes.Clear();
            foreach (New news in listNews)
            {
                TreeNode newNode = new TreeNode(news.Title);
                TreeNode nodeTxt = new TreeNode(news.Text);
                nodeTxt.SelectAction = TreeNodeSelectAction.None;
                newNode.ChildNodes.Add(nodeTxt);
                newNode.SelectAction = TreeNodeSelectAction.None;
                newsNodes.Add(newNode);
            }

            articlesNodes.Clear();
            foreach (Article article in listArticles)
            {
                TreeNode newNode = new TreeNode(article.Title);
                TreeNode nodeTxt = new TreeNode(article.Text);
                nodeTxt.SelectAction = TreeNodeSelectAction.None;
                newNode.ChildNodes.Add(nodeTxt);
                newNode.SelectAction = TreeNodeSelectAction.None;
                articlesNodes.Add(newNode);
            }
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            blAccess bl = new blAccess();

            Console.Out.WriteLine("Please enter your login :"******"Please enter your password :"******"Only journalist are authorized");
                }
            }
            else
            {
                Console.Out.WriteLine("Could not find a user with such credentials...");
            }
            Console.In.ReadLine();
        }