Advertisement
Guest User

Seeeeeeeeeeeeeeeeed

a guest
Mar 31st, 2019
750
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 32.61 KB | None | 0 0
  1. using Microsoft.EntityFrameworkCore;
  2. using Microsoft.Extensions.DependencyInjection;
  3. using YappiesTesting.Models;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Threading.Tasks;
  8.  
  9. namespace YappiesTesting.Data
  10. {
  11.     public static class YTSeedData
  12.     {
  13.         public static void Initialize(IServiceProvider serviceProvider)
  14.         {
  15.             using (var context = new yappiesTestingContext(
  16.                 serviceProvider.GetRequiredService<DbContextOptions<yappiesTestingContext>>()))
  17.             {
  18.                 //Program Supervisors
  19.                 if (!context.ProgramSupervisors.Any())
  20.                 {
  21.                     context.ProgramSupervisors.AddRange(
  22.                     new ProgramSupervisor
  23.                     {
  24.                         FirstName = "Michael",
  25.                         LastName = "Morris",
  26.                         Email = "mmorris@yahoo.com",
  27.                         Phone = 2895039392
  28.                     },
  29.  
  30.                     new ProgramSupervisor
  31.                     {
  32.                         FirstName = "Rick",
  33.                         LastName = "Rossy",
  34.                         Email = "rickyrossy@gmail.com",
  35.                         Phone = 9053849384
  36.                     },
  37.  
  38.                     new ProgramSupervisor
  39.                     {
  40.                         FirstName = "Stephen",
  41.                         LastName = "Johnson",
  42.                         Email = "sjohnson@hotmail.com",
  43.                         Phone = 2899119111
  44.                     },
  45.  
  46.                     new ProgramSupervisor
  47.                     {
  48.                         FirstName = "Eric",
  49.                         LastName = "Ribeye",
  50.                         Email = "speaker22@outlook.com",
  51.                         Phone = 2896669898
  52.                     },
  53.  
  54.                     new ProgramSupervisor
  55.                     {
  56.                         FirstName = "Felix",
  57.                         LastName = "Medil",
  58.                         Email = "fmedil@gmail.com",
  59.                         Phone = 2894903929
  60.                     },
  61.  
  62.                     new ProgramSupervisor
  63.                     {
  64.                         FirstName = "Adam",
  65.                         LastName = "Singer",
  66.                         Email = "pianolover@hotmail.com",
  67.                         Phone = 9059492999
  68.                     },
  69.  
  70.                     new ProgramSupervisor
  71.                     {
  72.                         FirstName = "Ken",
  73.                         LastName = "Dall",
  74.                         Email = "kdall1@hotmail.com",
  75.                         Phone = 2899054929
  76.                     },
  77.  
  78.                     new ProgramSupervisor
  79.                     {
  80.                         FirstName = "Dave",
  81.                         LastName = "Borris",
  82.                         Email = "dborris@gmail.com",
  83.                         Phone = 9042942999
  84.                     });
  85.                     context.SaveChanges();
  86.                 }
  87.                 //Programs
  88.                 if (!context.Programs.Any())
  89.                 {
  90.                     context.Programs.AddRange(
  91.                     new Models.Program
  92.                     {
  93.                         ProgramName = "Adult Lane Swims",
  94.                         ProgramDescription = "Participants may pay daily or purchase a pass. Enjoy a relaxing swim or work on strokes during this adult only pool time. (1-hour swim)",
  95.                         ProgramJoinCode = "AAAAAAAAAA",
  96.                         ProgramSupervisorID = context.ProgramSupervisors.FirstOrDefault(p => p.LastName == "Morris").ID
  97.                     },
  98.                     new Models.Program
  99.                     {
  100.                         ProgramName = "Swimmer 1-6",
  101.                         ProgramDescription = "Our swimmer program makes sure children learn how to swim before they get in too deep. Swimmer progressions accommodate 5-12 years old children and youth including absolute beginners as well as swimmers who want to build on the basics. We stress lots of in-water practice to develop solid swimming strokes and skills. We incorporate Water Smart education at all levels. (45-minute lesson)",
  102.                         ProgramJoinCode = "BBBBBBBBBB",
  103.                         ProgramSupervisorID = context.ProgramSupervisors.FirstOrDefault(p => p.LastName == "Rossy").ID
  104.                     },
  105.                     new Models.Program
  106.                     {
  107.                         ProgramName = "Ball Hockey",
  108.                         ProgramDescription = "They shoot, they score! What a way to learn Canada's favourite past time. Your child will develop coordination, teamwork and game strategy while making friends and having fun. Skills are enhanced through drills and games.",
  109.                         ProgramJoinCode = "CCCCCCCCCC",
  110.                         ProgramSupervisorID = context.ProgramSupervisors.FirstOrDefault(p => p.LastName == "Johnson").ID
  111.                     },
  112.                     new Models.Program
  113.                     {
  114.                         ProgramName = "Basketball",
  115.                         ProgramDescription = "Come and dribble your cares away with this fun introduction to an exciting sport. Skills of the game are taught and reinforced through drills and practices. Slam dunk!",
  116.                         ProgramJoinCode = "DDDDDDDDDD",
  117.                         ProgramSupervisorID = context.ProgramSupervisors.FirstOrDefault(p => p.LastName == "Ribeye").ID
  118.                     },
  119.                     new Models.Program
  120.                     {
  121.                         ProgramName = "Gymnastics 9-12 yrs",
  122.                         ProgramDescription = "The recreational gymnastics classes are designed to teach children the basics of the sport with emphasis on skill building and fun. Certified instructors will be working with the children on coo-ordination, balance and flexibility while keeping safety in mind. children will participate in the following disciplines, floor, low beam, mini trampoline and vault.",
  123.                         ProgramJoinCode = "EEEEEEEEEE",
  124.                         ProgramSupervisorID = context.ProgramSupervisors.FirstOrDefault(p => p.LastName == "Medil").ID
  125.                     },
  126.                     new Models.Program
  127.                     {
  128.                         ProgramName = "Fort Erie Teen Zone",
  129.                         ProgramDescription = "The Teen Zone is open for youth ages 13-19 years. Many activities are planned by youth themselves. Youth can access computers and assistance with resume writing or job searching, open gym time, games room, computer labs and out trips. Themed nights like a coffee house, and movie nights are organized throughout the year. Fort Erie Centre - 20 Lewis Street Tuesdays and Thursdays 7:00 PM-9:00 PM",
  130.                         ProgramJoinCode = "FFFFFFFFFF",
  131.                         ProgramSupervisorID = context.ProgramSupervisors.FirstOrDefault(p => p.LastName == "Singer").ID
  132.                     },
  133.                     new Models.Program
  134.                     {
  135.                         ProgramName = "JR Dance",
  136.                         ProgramDescription = "This program is an introduction to the world of dance for your child. The children will explore the fundamentals of ballet in a safe and nurturing environment. This program focuses on movement, co-ordination and spatial awareness. The emphasis of the program is on having fun.",
  137.                         ProgramJoinCode = "GGGGGGGGGG",
  138.                         ProgramSupervisorID = context.ProgramSupervisors.FirstOrDefault(p => p.LastName == "Dall").ID
  139.                     },
  140.                     new Models.Program
  141.                     {
  142.                         ProgramName = "Bronze Star",
  143.                         ProgramDescription = "Bronze Star is the pre-bronze medallion training standard and excellent preparation for success in Bronze Medallion. Participants develop problem solving and decision making skills as individuals and in partners. Participants will learn CPR and develop Water Smart, confidence and the lifesaving skills needed to be a lifeguard.",
  144.                         ProgramJoinCode = "HHHHHHHHHH",
  145.                         ProgramSupervisorID = context.ProgramSupervisors.FirstOrDefault(p => p.LastName == "Borris").ID
  146.                     });
  147.                     context.SaveChanges();
  148.                 }
  149.                 //Parent
  150.                 if (!context.Parents.Any())
  151.                 {
  152.                     context.Parents.AddRange(
  153.                         new Parent
  154.                         {
  155.                             FirstName = "Steve",
  156.                             LastName = "Buscemi",
  157.                             Email = "stevebuscemi@yahoo.com",
  158.                             Phone = 2894923456
  159.                         },
  160.  
  161.                         new Parent
  162.                         {
  163.                             FirstName = "Kenny",
  164.                             LastName = "Rogers",
  165.                             Email = "kennyrogers@gmail.com",
  166.                             Phone = 9056578976
  167.                         },
  168.  
  169.                         new Parent
  170.                         {
  171.                             FirstName = "Robert",
  172.                             LastName = "De Niro",
  173.                             Email = "taxidriver@hotmail.com",
  174.                             Phone = 2895849054
  175.                         },
  176.  
  177.                         new Parent
  178.                         {
  179.                             FirstName = "Alec",
  180.                             LastName = "Baldwin",
  181.                             Email = "alecbalwinny@yahoo.com",
  182.                             Phone = 9056754534
  183.                         },
  184.  
  185.                         new Parent
  186.                         {
  187.                             FirstName = "Tracy",
  188.                             LastName = "Morgan",
  189.                             Email = "tracymorgan@outlook.com",
  190.                             Phone = 9054788989
  191.                         },
  192.  
  193.                         new Parent
  194.                         {
  195.                             FirstName = "Michael",
  196.                             LastName = "Scott",
  197.                             Email = "theoffice@outlook.com",
  198.                             Phone = 2893895465
  199.                         },
  200.  
  201.                         new Parent
  202.                         {
  203.                             FirstName = "Rob",
  204.                             LastName = "Stark",
  205.                             Email = "rstark@gmail.com",
  206.                             Phone = 2896758789
  207.                         },
  208.  
  209.                         new Parent
  210.                         {
  211.                             FirstName = "Kevin",
  212.                             LastName = "Hart",
  213.                             Email = "hartK@hotmail.com",
  214.                             Phone = 5048765675
  215.                         });
  216.                     context.SaveChanges();
  217.                 }
  218.  
  219.                 //Parent Programs
  220.                 if (!context.Programs_Parents.Any())
  221.                 {
  222.                     for (int i = 1; i <= 8; i++)
  223.                     {
  224.                         Random random = new Random();
  225.                         int num = random.Next(1, 8);
  226.                         for (int j = 1; j <= num; j++)
  227.                         {
  228.                             context.Add(
  229.                                 new Program_Parent
  230.                                 {
  231.                                     ProgramID = i,
  232.                                     ParentID = j
  233.                                 }
  234.                             );
  235.                         }
  236.                     }
  237.                     context.SaveChanges();
  238.                 }
  239.  
  240.                 // Activity
  241.                 if (!context.Activities.Any())
  242.                 {
  243.                     context.Activities.AddRange(
  244.                         // adult swimming lane
  245.                         new Activity
  246.                         {
  247.                             Title = "Women's Free Swim 1",
  248.                             Description = "Session for the women's divsion of the program, be sure to come prepared as usual.",
  249.                             Date = DateTime.Now.AddDays(4),
  250.                             ProgramID = 1
  251.                         },
  252.                         new Activity
  253.                         {
  254.                             Title = "Women's Free Swim 2",
  255.                             Description = "Session for the women's divsion of the program, be sure to come prepared as usual.",
  256.                             Date = DateTime.Now.AddDays(8),
  257.                             ProgramID = 1
  258.                         },
  259.                         new Activity
  260.                         {
  261.                             Title = "Women's Free Swim 3",
  262.                             Description = "Session for the women's divsion of the program, be sure to come prepared as usual.",
  263.                             Date = DateTime.Now.AddDays(12),
  264.                             ProgramID = 1
  265.                         },
  266.                         new Activity
  267.                         {
  268.                             Title = "Women's Free Swim 4",
  269.                             Description = "Session for the women's divsion of the program, be sure to come prepared as usual.",
  270.                             Date = DateTime.Now.AddDays(16),
  271.                             ProgramID = 1
  272.                         },
  273.                         new Activity
  274.                         {
  275.                             Title = "Women's Free Swim 5",
  276.                             Description = "Session for the women's divsion of the program, be sure to come prepared as usual.",
  277.                             Date = DateTime.Now.AddDays(20),
  278.                             ProgramID = 1
  279.                         },
  280.                         new Activity
  281.                         {
  282.                             Title = "Men's Free Swim 1",
  283.                             Description = "Session for the men's divsion of the program, be sure to come prepared as usual.",
  284.                             Date = DateTime.Now.AddDays(2),
  285.                             ProgramID = 1
  286.                         },
  287.                         new Activity
  288.                         {
  289.                             Title = "Men's Free Swim 2",
  290.                             Description = "Session for the men's divsion of the program, be sure to come prepared as usual.",
  291.                             Date = DateTime.Now.AddDays(6),
  292.                             ProgramID = 1
  293.                         },
  294.                         new Activity
  295.                         {
  296.                             Title = "Men's Free Swim 3",
  297.                             Description = "Session for the men's divsion of the program, be sure to come prepared as usual.",
  298.                             Date = DateTime.Now.AddDays(10),
  299.                             ProgramID = 1
  300.                         },
  301.                         new Activity
  302.                         {
  303.                             Title = "Men's Free Swim 4",
  304.                             Description = "Session for the men's divsion of the program, be sure to come prepared as usual.",
  305.                             Date = DateTime.Now.AddDays(14),
  306.                             ProgramID = 1
  307.                         },
  308.                         new Activity
  309.                         {
  310.                             Title = "Men's Free Swim 5",
  311.                             Description = "Session for the men's divsion of the program, be sure to come prepared as usual.",
  312.                             Date = DateTime.Now.AddDays(18),
  313.                             ProgramID = 1
  314.                         },
  315.                         // swimmer 1-6
  316.                         new Activity
  317.                         {
  318.                             Title = "Junior Division Lesson 1",
  319.                             Description = "Lesson for the junior divsion of the program, be sure to come prepared as usual.",
  320.                             Date = DateTime.Now.AddDays(1),
  321.                             ProgramID = 1
  322.                         },
  323.                         new Activity
  324.                         {
  325.                             Title = "Junior Division Lesson 2",
  326.                             Description = "Lesson for the junior divsion of the program, be sure to come prepared as usual.",
  327.                             Date = DateTime.Now.AddDays(3),
  328.                             ProgramID = 1
  329.                         },
  330.                         new Activity
  331.                         {
  332.                             Title = "Junior Division Lesson 3",
  333.                             Description = "Lesson for the junior divsion of the program, be sure to come prepared as usual.",
  334.                             Date = DateTime.Now.AddDays(5),
  335.                             ProgramID = 1
  336.                         },
  337.                         new Activity
  338.                         {
  339.                             Title = "Junior Division Lesson 4",
  340.                             Description = "Lesson for the junior divsion of the program, be sure to come prepared as usual.",
  341.                             Date = DateTime.Now.AddDays(7),
  342.                             ProgramID = 1
  343.                         },
  344.                         // ball hockey
  345.                         new Activity
  346.                         {
  347.                             Title = "Game 1 of Juniors",
  348.                             Description = "Game for the junior ball hockey players, good luck everyone and be sure to come prepared!",
  349.                             Date = DateTime.Now.AddDays(3),
  350.                             ProgramID = 2
  351.                         },
  352.                         new Activity
  353.                         {
  354.                             Title = "Game 2 of Juniors",
  355.                             Description = "Game for the junior ball hockey players, good luck everyone and be sure to come prepared!",
  356.                             Date = DateTime.Now.AddDays(6),
  357.                             ProgramID = 2
  358.                         },
  359.                         new Activity
  360.                         {
  361.                             Title = "Game 1 of Seniors",
  362.                             Description = "Game for the senior ball hockey players, good luck everyone and be sure to come prepared!",
  363.                             Date = DateTime.Now.AddDays(4),
  364.                             ProgramID = 2
  365.                         },
  366.                         new Activity
  367.                         {
  368.                             Title = "Game 2 of Seniors",
  369.                             Description = "Game for the senior ball hockey players, good luck everyone and be sure to come prepared!",
  370.                             Date = DateTime.Now.AddDays(7),
  371.                             ProgramID = 2
  372.                         },
  373.                         // basketball
  374.                         new Activity
  375.                         {
  376.                             Title = "Game 1 of Juniors",
  377.                             Description = "Game for the junior basketball players, good luck everyone and be sure to come prepared!",
  378.                             Date = DateTime.Now.AddDays(2),
  379.                             ProgramID = 3
  380.                         },
  381.                         new Activity
  382.                         {
  383.                             Title = "Game 2 of Juniors",
  384.                             Description = "Game for the junior basketball players, good luck everyone and be sure to come prepared!",
  385.                             Date = DateTime.Now.AddDays(9),
  386.                             ProgramID = 3
  387.                         },
  388.                         new Activity
  389.                         {
  390.                             Title = "Game 3 of Juniors",
  391.                             Description = "Game for the junior basketball players, good luck everyone and be sure to come prepared!",
  392.                             Date = DateTime.Now.AddDays(16),
  393.                             ProgramID = 3
  394.                         },
  395.                         new Activity
  396.                         {
  397.                             Title = "Game 1 of Seniors",
  398.                             Description = "Game for the senior basketball players, good luck everyone and be sure to come prepared!",
  399.                             Date = DateTime.Now.AddDays(4),
  400.                             ProgramID = 3
  401.                         },
  402.                         new Activity
  403.                         {
  404.                             Title = "Game 1 of Seniors",
  405.                             Description = "Game for the senior basketball players, good luck everyone and be sure to come prepared!",
  406.                             Date = DateTime.Now.AddDays(11),
  407.                             ProgramID = 3
  408.                         },
  409.                         new Activity
  410.                         {
  411.                             Title = "Game 1 of Seniors",
  412.                             Description = "Game for the senior basketball players, good luck everyone and be sure to come prepared!",
  413.                             Date = DateTime.Now.AddDays(18),
  414.                             ProgramID = 3
  415.                         },
  416.                         // gymnastics 9-12 yrs
  417.                         new Activity
  418.                         {
  419.                             Title = "Lesson 1 - Basics",
  420.                             Description = "Covering basic beginnings, come with the proper change of clothes to get a bit chalky.",
  421.                             Date = DateTime.Now.AddDays(2),
  422.                             ProgramID = 4
  423.                         },
  424.                         new Activity
  425.                         {
  426.                             Title = "Lesson 2 - The Cartwheel",
  427.                             Description = "Covering how to cartwheel, come with the proper change of clothes to get a bit chalky.",
  428.                             Date = DateTime.Now.AddDays(9),
  429.                             ProgramID = 4
  430.                         },
  431.                         new Activity
  432.                         {
  433.                             Title = "Lesson 1 - Standing Triple Twist Double Backflips",
  434.                             Description = "Covering unrealistic gymnastical abilities for 9-12 year olds to learn, come with the proper change of clothes to get a bit chalky.",
  435.                             Date = DateTime.Now.AddDays(16),
  436.                             ProgramID = 4
  437.                         },
  438.                         // fort erie teen zone
  439.                         new Activity
  440.                         {
  441.                             Title = "Spring Blast!!",
  442.                             Description = "Get ready for an extremely fun night with the teen zone!",
  443.                             Date = DateTime.Now.AddDays(5),
  444.                             ProgramID = 5
  445.                         },
  446.                         // jr dance
  447.                         new Activity
  448.                         {
  449.                             Title = "Modern Dance",
  450.                             Description = "Modern style at a modern pace.",
  451.                             Date = DateTime.Now.AddDays(3),
  452.                             ProgramID = 6
  453.                         },
  454.                         new Activity
  455.                         {
  456.                             Title = "Line-style Dance",
  457.                             Description = "Line dancing, country style.",
  458.                             Date = DateTime.Now.AddDays(10),
  459.                             ProgramID = 6
  460.                         },
  461.                         new Activity
  462.                         {
  463.                             Title = "Dance For Fun",
  464.                             Description = "Let's blow off some steam everyone, had a stressful couple weeks.",
  465.                             Date = DateTime.Now.AddDays(17),
  466.                             ProgramID = 6
  467.                         },
  468.                         // bronze star
  469.                         new Activity
  470.                         {
  471.                             Title = "Bronze Star Level Training 1",
  472.                             Description = "Bronze Star Training",
  473.                             Date = DateTime.Now.AddDays(3),
  474.                             ProgramID = 7
  475.                         });
  476.                     context.SaveChanges();
  477.                 }
  478.                 if (!context.Announcements.Any())
  479.                 {
  480.                     context.Announcements.AddRange(
  481.                         // adult swimming lane
  482.                         new Announcement
  483.                         {
  484.                             Title = "Women's Free Swim 1",
  485.                             Body = "Posted the times, please refer to the activities schedule on the program page!",
  486.                             ProgramID = 1,
  487.                             CreatedOn = DateTime.Now.AddDays(-5)
  488.                         },
  489.                         new Announcement
  490.                         {
  491.                             Title = "Men's Free Swim 1",
  492.                             Body = "Decided on a time for this week, get in touch if it doesn't work for you.",
  493.                             ProgramID = 1,
  494.                             CreatedOn = DateTime.Now.AddDays(-7)
  495.                         },
  496.                         // swimmer 1-6
  497.                         new Announcement
  498.                         {
  499.                             Title = "Be prepared for our first lesson!",
  500.                             Body = "Don't forget to bring all of the required equipment, and you might want to bring a change of clothes + towels for after the swim!",
  501.                             ProgramID = 2,
  502.                             CreatedOn = DateTime.Now.AddDays(-1)
  503.                         },
  504.                         new Announcement
  505.                         {
  506.                             Title = "Lost Wallet at Pool",
  507.                             Body = "There was a wallet found at the pool last event. If you have a black leather wallet with a pink lace hanging off of it, talk to the pool owners please.",
  508.                             ProgramID = 2,
  509.                             CreatedOn = DateTime.Now.AddDays(-3)
  510.                         },
  511.                         // ball hockey
  512.                         new Announcement
  513.                         {
  514.                             Title = "Cancellation",
  515.                             Body = "Ball Hockey this Friday is cancelled due to sickness, my appologies everyone!",
  516.                             ProgramID = 3,
  517.                             CreatedOn = DateTime.Now.AddDays(-4)
  518.                         },
  519.                         new Announcement
  520.                         {
  521.                             Title = "Your child forget their stick?",
  522.                             Body = "Someone forgot their ball hockey stick last game. It is a green CCM stick.",
  523.                             ProgramID = 3,
  524.                             CreatedOn = DateTime.Now.AddDays(-9)
  525.                         },
  526.                         // basketball
  527.                         new Announcement
  528.                         {
  529.                             Title = "Game next wednesday!",
  530.                             Body = "Don't forget that there is a game next wednesday, parents are more than welcome to come watch if you'd like!",
  531.                             ProgramID = 4,
  532.                             CreatedOn = DateTime.Now.AddDays(-1)
  533.                         },
  534.                         new Announcement
  535.                         {
  536.                             Title = "Fundraiser for tournament!",
  537.                             Body = "Just a reminder that the fundraising event will be held this saturday at 1pm. Let's try to raise some money for this torunament!",
  538.                             ProgramID = 4,
  539.                             CreatedOn = DateTime.Now.AddDays(-2)
  540.                         },
  541.                         // Gymnastics 9-12
  542.                         new Announcement
  543.                         {
  544.                             Title = "Gymnastics Practice moved",
  545.                             Body = "Practice has been moved to next Tuesday this week!",
  546.                             ProgramID = 5,
  547.                             CreatedOn = DateTime.Now.AddDays(-3)
  548.                         },
  549.                         new Announcement
  550.                         {
  551.                             Title = "Competition",
  552.                             Body = "Reminder that the competition is going to be held this saturday!",
  553.                             ProgramID = 5,
  554.                             CreatedOn = DateTime.Now.AddDays(-5)
  555.                         },
  556.                         // Fort Erie Teen Zone
  557.                         new Announcement
  558.                         {
  559.                             Title = "Magic Day!",
  560.                             Body = "This weeks Teen Zone will be magic themed! With a special appearance from Jimmy Chaotic!",
  561.                             ProgramID = 6,
  562.                             CreatedOn = DateTime.Now.AddDays(-4)
  563.                         },
  564.                         new Announcement
  565.                         {
  566.                             Title = "Cancelled",
  567.                             Body = "Hello Everyone, this weeks Teen Zone will unfortunately have to be cancelled due to unforseen circumstances.",
  568.                             ProgramID = 6,
  569.                             CreatedOn = DateTime.Now.AddDays(-11)
  570.                         },
  571.                         // JR Dance
  572.                         new Announcement
  573.                         {
  574.                             Title = "Best date for recital",
  575.                             Body = "Just wondering what the best time of day is to have the recital so that the most parents can make it!",
  576.                             ProgramID = 7,
  577.                             CreatedOn = DateTime.Now.AddDays(-5)
  578.                         },
  579.                         new Announcement
  580.                         {
  581.                             Title = "Dance Day",
  582.                             Body = "Parents are welcome to come to next weeks Dance Day, everyone will be dancing!",
  583.                             ProgramID = 7,
  584.                             CreatedOn = DateTime.Now.AddDays(-9)
  585.                         },
  586.                         // Bronze Star
  587.                         new Announcement
  588.                         {
  589.                             Title = "Lost phone",
  590.                             Body = "Someone forgot their phone last week. It will be at reception",
  591.                             ProgramID = 8,
  592.                             CreatedOn = DateTime.Now.AddDays(-2)
  593.                         },
  594.                         new Announcement
  595.                         {
  596.                             Title = "Potential change of date",
  597.                             Body = "We will maybe be changing the weekly dates. I will keep you guys posted with any updates.",
  598.                             ProgramID = 8,
  599.                             CreatedOn = DateTime.Now.AddDays(-6)
  600.                         },
  601.                         // global testing
  602.                         new Announcement
  603.                         {
  604.                             Title = "Global Announcement Test",
  605.                             Body = "This will be going out to all parents and activities",
  606.                             CreatedOn = DateTime.Now.AddDays(-2)
  607.                         },
  608.                         new Announcement
  609.                         {
  610.                             Title = "Open pool this Saturday!",
  611.                             Body = "The pool at the Niagara Falls Location will be open to all this Saturday. You are all welcome to come!",
  612.                             CreatedOn = DateTime.Now.AddDays(-2)
  613.                         });
  614.                     context.SaveChanges();
  615.                 }
  616.                 if (!context.Children.Any())
  617.                 {
  618.                     context.Children.AddRange(
  619.                         new Child
  620.                         {
  621.                             FirstName = "Sally",
  622.                             LastName = "Driver",
  623.                             ParentID = 3
  624.                         },
  625.  
  626.                         new Child
  627.                         {
  628.                             FirstName = "Tom",
  629.                             LastName = "Driver",
  630.                             ParentID = 3
  631.                         });
  632.                     context.SaveChanges();
  633.                 }
  634.                 if (!context.Programs_Children.Any())
  635.                 {
  636.                     context.Programs_Children.AddRange(
  637.                         new Program_Child
  638.                         {
  639.                             ChildID = 1,
  640.                             ProgramID = 2
  641.                         });
  642.                     context.SaveChanges();
  643.                 }
  644.             }
  645.         }
  646.     }
  647. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement