コード例 #1
0
        public SqlCalendar()
        {
            #region Calendar
            ClassTerm t1 = new ClassTerm();
            t1.TermId         = 1;
            t1.CalendarDay    = new ClassCalendarDay();
            t1.CalendarDoctor = new ClassCalendarDoctor();
            t1.CalendarDoctor.CalendarDoctorId = 1;
            t1.CalendarDay.CalendarDayId       = 1;
            t1.StartTime        = new TimeSpan(12, 0, 0);
            t1.EndTime          = new TimeSpan(18, 0, 0);
            t1.Date             = new DateTime(2000, 3, 5);
            t1.Doctor           = new ClassDoctor();
            t1.Doctor.Doctor_id = 1;
            t1.IsWorkingDay     = true;



            ListTerm.Add(t1);


            ClassTerm t2 = new ClassTerm();
            t2.TermId      = 2;
            t2.CalendarDay = new ClassCalendarDay();
            t2.CalendarDay.CalendarDayId       = 5;
            t2.CalendarDoctor                  = new ClassCalendarDoctor();
            t2.CalendarDoctor.CalendarDoctorId = 2;
            t2.StartTime        = new TimeSpan(8, 0, 0);
            t2.EndTime          = new TimeSpan(15, 0, 0);
            t2.Date             = new DateTime(2000, 3, 7);
            t2.Doctor           = new ClassDoctor();
            t2.Doctor.Doctor_id = 2;
            t2.IsWorkingDay     = true;

            ListTerm.Add(t2);



            ClassCalendarDoctor c1 = new ClassCalendarDoctor();
            c1.CalendarDoctorId    = 1;
            c1.Doctor              = new ClassDoctor();
            c1.Doctor.Doctor_id    = 5;
            c1.Calendar            = new ClassCalendar();
            c1.Calendar.CalendarId = 4;

            ClassCalendarDoctor c2 = new ClassCalendarDoctor();
            c2.CalendarDoctorId    = 4;
            c2.Doctor              = new ClassDoctor();
            c2.Doctor.Doctor_id    = 6;
            c2.Calendar            = new ClassCalendar();
            c2.Calendar.CalendarId = 3;

            ListCalendarForDoctor = new List <ClassCalendarDoctor>()
            {
                c1, c2
            };



            #endregion
        }
コード例 #2
0
        public SqlCalendar()
        {
            #region Office
            ClassOffice o1 = new ClassOffice();
            o1.OfficeId     = 1;
            o1.OfficeNumber = 100;

            ClassOffice o2 = new ClassOffice();
            o1.OfficeId     = 2;
            o1.OfficeNumber = 200;
            ListOffice      = new List <ClassOffice>()
            {
                o1, o2
            };
            #endregion

            #region Status
            ClassStatus s1 = new ClassStatus();
            s1.StatusId = 1;
            s1.Status   = "New";
            ClassStatus s2 = new ClassStatus();
            s2.StatusId = 2;
            s2.Status   = "Shared for doctors";
            ClassStatus s3 = new ClassStatus();
            s3.StatusId = 3;
            s3.Status   = "During verification";
            ClassStatus s4 = new ClassStatus();
            s4.StatusId = 4;
            s4.Status   = "Verified";
            ClassStatus s5 = new ClassStatus();
            s5.StatusId = 5;
            s5.Status   = "Waiting for administrator acceptance";
            ClassStatus s6 = new ClassStatus();
            s6.StatusId = 6;
            s6.Status   = "During verification by the doctor";
            ClassStatus s7 = new ClassStatus();
            s7.StatusId = 7;
            s7.Status   = "Accepted by the doctor";
            ListStatus  = new List <ClassStatus>()
            {
                s1, s2, s3, s4, s5, s6, s7
            };
            #endregion

            #region Doctor
            ClassDoctor dct1 = new ClassDoctor();
            dct1.Active       = true;
            dct1.Doctor_id    = 1;
            dct1.Name         = "Jan";
            dct1.Surname      = "Nowak";
            dct1.OfficeNumber = 100;
            ClassDoctor dct2 = new ClassDoctor();
            dct2.Active       = true;
            dct2.Doctor_id    = 2;
            dct2.Name         = "Tomasz";
            dct2.Surname      = "Kowalski";
            dct2.OfficeNumber = 200;
            ListDoctor        = new List <ClassDoctor>()
            {
                dct1, dct2
            };
            #endregion

            #region FixedTerms
            ClassFixedTerms ft1 = new ClassFixedTerms();
            ft1.Day      = 2;
            ft1.Start    = new TimeSpan(8, 0, 0);
            ft1.End      = new TimeSpan(12, 0, 0);
            ft1.DoctorId = 1;

            ClassFixedTerms ft2 = new ClassFixedTerms();
            ft2.Day        = 3;
            ft2.Start      = new TimeSpan(13, 0, 0);
            ft2.End        = new TimeSpan(15, 0, 0);
            ft2.DoctorId   = 2;
            ListFixedTerms = new List <ClassFixedTerms>()
            {
                ft1, ft2
            };
            #endregion

            #region Calendar
            ClassCalendar c1 = new ClassCalendar();
            c1.Year            = 2000;
            c1.Month           = 2;
            c1.CalendarId      = 1;
            c1.Status          = new ClassStatus();
            c1.Status.StatusId = 1;
            ListCalendar.Add(c1);

            ClassCalendar c2 = new ClassCalendar();
            c2.Year            = 2000;
            c2.Month           = 3;
            c2.CalendarId      = 2;
            c2.Status          = new ClassStatus();
            c2.Status.StatusId = 3;
            ListCalendar.Add(c2);

            ClassCalendar c3 = new ClassCalendar();
            c3.Year            = 2000;
            c3.Month           = 4;
            c3.CalendarId      = 3;
            c3.Status          = new ClassStatus();
            c3.Status.StatusId = 1;
            ListCalendar.Add(c3);

            #endregion

            #region Calendar Doctor
            ClassCalendarDoctor cd1 = new ClassCalendarDoctor();
            cd1.Calendar            = new ClassCalendar();
            cd1.Calendar.CalendarId = 2;
            cd1.CalendarDoctorId    = 1;
            cd1.Doctor           = new ClassDoctor();
            cd1.Doctor.Doctor_id = 1;
            cd1.Status           = new ClassStatus();
            cd1.Status.StatusId  = 7;
            ListCalendarDoctor.Add(cd1);

            ClassCalendarDoctor cd2 = new ClassCalendarDoctor();
            cd2.Calendar            = new ClassCalendar();
            cd2.Calendar.CalendarId = 2;
            cd2.CalendarDoctorId    = 2;
            cd2.Doctor           = new ClassDoctor();
            cd2.Doctor.Doctor_id = 2;
            cd2.Status           = new ClassStatus();
            cd2.Status.StatusId  = 7;
            ListCalendarDoctor.Add(cd2);
            #endregion

            #region Calendar Day
            ClassCalendarDay d1 = new ClassCalendarDay();
            d1.Calendar            = new ClassCalendar();
            d1.Calendar.CalendarId = 1;
            d1.CalendarDayId       = 1;
            d1.Day       = 1;
            d1.StartTime = new TimeSpan(7, 0, 0);
            d1.EndTime   = new TimeSpan(20, 0, 0);
            ListCalendarDay.Add(d1);

            ClassCalendarDay d2 = new ClassCalendarDay();
            d2.Calendar            = new ClassCalendar();
            d2.Calendar.CalendarId = 1;
            d2.CalendarDayId       = 2;
            d2.Day       = 2;
            d2.StartTime = new TimeSpan(7, 0, 0);
            d2.EndTime   = new TimeSpan(20, 0, 0);
            ListCalendarDay.Add(d2);

            ClassCalendarDay d3 = new ClassCalendarDay();
            d3.Calendar            = new ClassCalendar();
            d3.Calendar.CalendarId = 2;
            d3.CalendarDayId       = 3;
            d3.Day       = 1;
            d3.StartTime = new TimeSpan(7, 0, 0);
            d3.EndTime   = new TimeSpan(20, 0, 0);
            ListCalendarDay.Add(d3);

            ClassCalendarDay d4 = new ClassCalendarDay();
            d4.Calendar            = new ClassCalendar();
            d4.Calendar.CalendarId = 2;
            d4.CalendarDayId       = 4;
            d4.Day       = 7;
            d4.StartTime = new TimeSpan(7, 0, 0);
            d4.EndTime   = new TimeSpan(20, 0, 0);
            ListCalendarDay.Add(d4);

            #endregion

            #region Term
            ClassTerm t1 = new ClassTerm();
            t1.TermId              = 1;
            t1.CalendarDay         = new ClassCalendarDay();
            t1.CalendarDay         = d3;
            t1.CalendarDoctor      = cd1;
            t1.Date                = new DateTime(2000, 3, 1);
            t1.Doctor              = dct1;
            t1.StartTime           = new TimeSpan(8, 0, 0);
            t1.EndTime             = new TimeSpan(12, 0, 0);
            t1.Office              = new ClassOffice();
            t1.Office.OfficeNumber = 100;
            ListTerm.Add(t1);

            ClassTerm t2 = new ClassTerm();
            t2.TermId              = 2;
            t2.CalendarDay         = new ClassCalendarDay();
            t2.CalendarDay         = d4;
            t2.CalendarDoctor      = cd2;
            t2.Date                = new DateTime(2000, 3, 7);
            t2.Doctor              = dct2;
            t2.StartTime           = new TimeSpan(13, 0, 0);
            t2.EndTime             = new TimeSpan(15, 0, 0);
            t2.Office              = new ClassOffice();
            t2.Office.OfficeNumber = 200;
            ListTerm.Add(t2);
            #endregion
        }