Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var reminderItem1 = new ReminderItem(DateTimeOffset.Parse("13:45"), "first reminder");
            var reminderItem2 = new ReminderItem(DateTimeOffset.Parse("12:45"), "second reminder");

            reminderItem1.WriteProperties();
            reminderItem2.WriteProperties();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            const string connectionStringTemplate =
                "Data Source={0};" +
                "Initial Catalog={1};" +
                "Integrated Security=true";

            string conenctionString = string.Format(connectionStringTemplate, @"localhost\SQLEXPRESS", "Storage");

            var repository = new SqlStorage(conenctionString);

            #region testing

            var reminder1 = new ReminderItemRestricted
            {
                ContactId = "Tom",
                Date      = DateTimeOffset.Now,
                Message   = "hi tommy",
                Status    = (ReminderItemStatus)1
            };

            var newid = repository.Add(reminder1);
            Console.WriteLine(newid);

            ReminderItem reminder = repository.Get(newid);
            Console.WriteLine(reminder.ContactId);

            var list = repository.Get(ReminderItemStatus.Ready);

            int m = 0;
            foreach (var rem in list)
            {
                ++m;
            }
            Console.WriteLine(m);

            repository.UpdateStatus(newid, ReminderItemStatus.Failed);

            reminder = repository.Get(newid);
            Console.WriteLine(reminder.Status);

            List <Guid> ids = new List <Guid>
            {
                Guid.Parse("D19F4EF4-3C36-453C-8384-76B27ACF8C92"),
                Guid.Parse("67E41C35-B81E-4CC4-9BE3-77B34AE4865F"),
                Guid.Parse("27283CA6-295E-42F3-B6D6-7C2003B6CA9A"),
                Guid.Parse("A31EA458-43B0-47E6-850D-7C36ADC40EB1"),
                Guid.Parse("D8D495B9-D907-4456-8E47-8FB270F48060"),
            };

            repository.UpdateStatus(ids, ReminderItemStatus.Awaiting);

            #endregion
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            var reminderItem = new ReminderItem(new DateTime(2019, 10, 29, 16, 52, 30), "Good morning! Time to get up!")
            {
            };

            reminderItem.WriteProperties();
            var reminderItem1 = new ReminderItem(new DateTime(2099, 12, 02, 16, 52, 30), "Good morning! Time to get up!")
            {
            };

            reminderItem1.WriteProperties();

            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            ReminderItem reminder = new ReminderItem();

            reminder.AlarmDate    = DateTimeOffset.Parse("2019-04-02 12:30");
            reminder.AlarmMessage = "Important meeting";
            reminder.WriteProperties();

            ReminderItem reminder1 = new ReminderItem();

            reminder1.AlarmDate    = DateTimeOffset.Parse("2019-03-27 19:40");
            reminder1.AlarmMessage = "Don't forget potatoes in the oven!";
            reminder1.WriteProperties();

            Console.ReadLine();
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            var reminders = new ReminderItem[]
            {
                new ReminderItem(DateTimeOffset.Now.AddMinutes(10), "First reminder"),
                new PhoneReminderItem(DateTimeOffset.Now.AddHours(-10), "Second reminder", "8(999)999-99-99"),
                new ChatReminderItem(DateTimeOffset.Now.AddDays(1), "Third reminder", "New chat", "Admin")
            };

            foreach (var reminder in reminders)
            {
                Console.WriteLine("____");
                reminder.WriteProperties();
                Console.WriteLine("____");
            }
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            ReminderItem reminder      = new ReminderItem(DateTimeOffset.Parse("04-04-2019 5:00"), "Wake up");
            ReminderItem phoneReminder = new PhoneReminderItem(DateTimeOffset.Parse("05-02-2019 7:00"), "Call employer", "+7(912)8084532");
            ReminderItem chatReminder  = new ChatReminderItem(DateTimeOffset.Parse("09-02-2019 12:30"), "Ask about project", "Nd1280", "Alex");

            var listReminder = new List <ReminderItem>
            {
                reminder,
                phoneReminder,
                chatReminder
            };

            foreach (var remind in listReminder)
            {
                remind.WriteProperties();
            }

            Console.ReadLine();
        }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            Console.WriteLine("Please write current information: \n " +
                              "year, month, day,--- hours, minutes, seconds");
            Console.WriteLine("year");
            var year = Int32.Parse(Console.ReadLine());

            Console.WriteLine("month");
            var month = Int32.Parse(Console.ReadLine());

            Console.WriteLine("day");
            var day = Int32.Parse(Console.ReadLine());

            Console.WriteLine("------------");
            Console.WriteLine("hours");
            var hours = Int32.Parse(Console.ReadLine());

            Console.WriteLine("minutes");
            var minutes = Int32.Parse(Console.ReadLine());

            Console.WriteLine("seconds");
            var seconds = Int32.Parse(Console.ReadLine());


            DateTime dat = new DateTime(year, month, day, hours, minutes, seconds, DateTimeKind.Utc);

            Console.WriteLine("Write massange");
            string massange = Console.ReadLine();

            var First  = new ReminderItem(dat, massange);
            var Second = new ReminderItem(dat, massange);

            Console.WriteLine("First progg");
            First.WriteProperties();
            Console.WriteLine("Second progg");
            Second.WriteProperties();
            Console.ReadKey();
        }