Exemple #1
0
        public string Post()
        {
            DatabaseManeger        db      = new DatabaseManeger();
            IShitterTwitterMessage message = db.GetMessageToTweet();

            TwitterManeger tm = new TwitterManeger();

            tm.sendTweet(message.Message);


            return(message.Message);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            maneger = new DatabaseManeger();
            Twitter = new TwitterManeger();

            while (true)
            {
                Console.Clear();
                Console.WriteLine("************************************");
                Console.WriteLine("Shitter Twitter Menu:");
                Console.WriteLine("************************************");
                Console.WriteLine();
                Console.WriteLine("1) Add Message");
                Console.WriteLine("2) Read Messages");
                Console.WriteLine("3) Tweet it");
                Console.WriteLine("4) Delete Message");
                Console.WriteLine("5) Exit");
                Console.WriteLine(": ");
                var chocie = Console.ReadLine();
                int choiceint;
                if (int.TryParse(chocie, out choiceint))
                {
                    switch (choiceint)
                    {
                    case 1:
                        maneger.AddMessage(MakeMessage());
                        break;

                    case 2:
                        var read = maneger.GetAllShitterMessages();
                        ReadMessages(read);
                        break;

                    case 3:
                        Tweetit();
                        break;

                    case 5:
                        return;

                    default:
                        Console.WriteLine("invalid");

                        break;
                    }
                }
            }
        }