Пример #1
0
        public void LoadActivities()
        {
            SqlTaskActivitiesProvider s          = new SqlTaskActivitiesProvider();
            Collection <TaskActivity> activities = s.LoadActivities(DateTime.Today);

            Console.WriteLine("{0} records read from the Activities table.", activities.Count);
        }
        public void SaveActivities()
        {
            Random rnd = new Random(DateTime.Now.Millisecond);
            Collection<TaskActivity> activities = new Collection<TaskActivity>();
            for (int n = 0; n < 10; n++)
            {
                TaskActivity ta = new TaskActivity(TaskDescription.Empty, "test user");
                ta.StartDate = DateTime.Now.AddMinutes(-(n * rnd.Next(20)));
                ta.EndDate = DateTime.Now.AddMinutes(n * rnd.Next(20));
                ta.Remarks = "Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition".Substring(0, rnd.Next(50));
                ta.CrosstabTaskDescription = TaskDescription.Empty;
                activities.Add(ta);
            }

            SqlTaskActivitiesProvider s = new SqlTaskActivitiesProvider();
            s.SaveActivities(activities);
            Console.WriteLine("10 records written to the Activities table.");
        }
Пример #3
0
        public void SaveActivities()
        {
            Random rnd = new Random(DateTime.Now.Millisecond);
            Collection <TaskActivity> activities = new Collection <TaskActivity>();

            for (int n = 0; n < 10; n++)
            {
                TaskActivity ta = new TaskActivity(TaskDescription.Empty, "test user");
                ta.StartDate = DateTime.Now.AddMinutes(-(n * rnd.Next(20)));
                ta.EndDate   = DateTime.Now.AddMinutes(n * rnd.Next(20));
                ta.Remarks   = "Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition".Substring(0, rnd.Next(50));
                ta.CrosstabTaskDescription = TaskDescription.Empty;
                activities.Add(ta);
            }

            SqlTaskActivitiesProvider s = new SqlTaskActivitiesProvider();

            s.SaveActivities(activities);
            Console.WriteLine("10 records written to the Activities table.");
        }
 public void LoadActivities()
 {
     SqlTaskActivitiesProvider s = new SqlTaskActivitiesProvider();
     Collection<TaskActivity> activities = s.LoadActivities(DateTime.Today);
     Console.WriteLine("{0} records read from the Activities table.", activities.Count);
 }