예제 #1
0
 partial void DeletedbTweet(dbTweet instance);
예제 #2
0
 partial void InsertdbTweet(dbTweet instance);
예제 #3
0
 partial void UpdatedbTweet(dbTweet instance);
예제 #4
0
        private static void ScheduleTweetAction()
        {
            wl("Sweet, we can do that.");
            w("What do you want to tweet: ");
            string tweettxt = rl();

            while (tweettxt.Length > 140)
            {
                w("Um, that's too long. Try again: ");
                tweettxt = rl();
            }

            if (string.Compare(tweettxt, "random", true) == 0)
            {
                string path = filePath;
                tweettxt = GetRandomLine(ref path);
            }

            w("When do you want this Tweet to go out: ");
            string time = rl();

            DateTime tSchedule;
            while (!DateTime.TryParse(time, out tSchedule))
            {
                w("Um, the program didn't understand that date/time: ");
                time = rl();
            }

            JBird db = new JBird(connection);
            dbTweet tweet = new dbTweet();
            tweet.TweetText = tweettxt;
            tweet.Schedule = tSchedule;
            db.dbTweets.InsertOnSubmit(tweet);
            db.SubmitChanges();

            wl("Done.");
            DisplayMenu();
        }