示例#1
0
        public EventsController(ServicePerksDBContext context)
        {
            _context = context;

            if (_context.Events.Count() == 0)
            {
                _context.Events.Add(new Events {
                    Id               = "event1",
                    EventName        = "Park Cleanup",
                    EventPoints      = 200,
                    EventDate        = new DateTime(2018, 3, 31),
                    StartTime        = "3:00",
                    EndTime          = "5:00",
                    EventLocation    = "Stevens Park, Hoboken, NJ 07030",
                    EventLat         = 40.741532f,
                    EventLong        = -74.027737f,
                    EventDescription = "Come help cleanup Stevens Park this coming Saturday from 3 to 5pm!",
                    Registered       = 7
                });
                _context.Events.Add(new Events {
                    Id               = "event2",
                    EventName        = "Homeless Shelter",
                    EventPoints      = 100,
                    EventDate        = new DateTime(2018, 4, 1),
                    StartTime        = "1:00",
                    EndTime          = "2:00",
                    EventLocation    = "The Hoboken Shelter, Hoboken, NJ 07030",
                    EventLat         = 40.740368f,
                    EventLong        = -74.031174f,
                    EventDescription = "Help make and serve lunch to help support our homeless this Sunday from 1-2pm at the Hoboken Shelter.",
                    Registered       = 3
                });
                _context.Events.Add(new Events {
                    Id               = "event3",
                    EventName        = "Boys and Girls Club",
                    EventPoints      = 200,
                    EventDate        = new DateTime(2018, 4, 3),
                    StartTime        = "6:00",
                    EndTime          = "8:00",
                    EventLocation    = "Boys and Girls Club-Hudson County, Hoboken, NJ 07030",
                    EventLat         = 40.740291f,
                    EventLong        = -74.037631f,
                    EventDescription = "Come help do whatever it is people do when they volunteer their time at the Boys and Girls Club of Hudson County!",
                    Registered       = 12
                });
                _context.SaveChanges();
            }
        }
示例#2
0
        public UsersController(ServicePerksDBContext context)
        {
            _context = context;

            if (_context.Users.Count() == 0)
            {
                _context.Users.Add(new Users {
                    Id              = "user1",
                    Email           = "*****@*****.**",
                    Password        = "******",
                    FirstName       = "Matthew",
                    LastName        = "Aquiles",
                    Type            = 1,
                    TotalPoints     = 55000,
                    PointsAvailable = 1200,
                    Saved           = 55
                });
                _context.Users.Add(new Users {
                    Id              = "user2",
                    Email           = "*****@*****.**",
                    Password        = "******",
                    FirstName       = "Scott",
                    LastName        = "Russel",
                    Type            = 1,
                    TotalPoints     = 40000,
                    PointsAvailable = 2500,
                    Saved           = 45
                });
                _context.Users.Add(new Users {
                    Id              = "user3",
                    Email           = "*****@*****.**",
                    Password        = "******",
                    FirstName       = "Thomas",
                    LastName        = "Falsone",
                    Type            = 01,
                    TotalPoints     = 5000,
                    PointsAvailable = 700,
                    Saved           = 12
                });
                _context.SaveChanges();
            }
        }
        public RegisteredController(ServicePerksDBContext context)
        {
            _context = context;

            if (_context.Registered.Count() == 0)
            {
                _context.Registered.Add(new Registered {
                    Id        = "reg2",
                    EventCode = "event2",
                    UserEmail = "*****@*****.**",
                    Attended  = false
                });
                _context.Registered.Add(new Registered {
                    Id        = "reg3",
                    EventCode = "event3",
                    UserEmail = "*****@*****.**",
                    Attended  = false
                });
                _context.SaveChanges();
            }
        }
示例#4
0
        public RedeemedController(ServicePerksDBContext context)
        {
            _context = context;

            if (_context.Redeemed.Count() == 0)
            {
                _context.Redeemed.Add(new Redeemed {
                    Id        = "red2",
                    OfferCode = "vendor2",
                    UserEmail = "*****@*****.**",
                    Used      = false
                });
                _context.Redeemed.Add(new Redeemed {
                    Id        = "red3",
                    OfferCode = "vendor3",
                    UserEmail = "*****@*****.**",
                    Used      = false
                });
                _context.SaveChanges();
            }
        }
示例#5
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ServicePerksDBContext context)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            //DbInitializer.Initialize(context);

            app.UseStaticFiles();
            app.UseSpaStaticFiles();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller}/{action=Index}/{id?}");
            });

            app.UseSpa(spa =>
            {
                // To learn more about options for serving an Angular SPA from ASP.NET Core,
                // see https://go.microsoft.com/fwlink/?linkid=864501

                spa.Options.SourcePath = "ClientApp";

                if (env.IsDevelopment())
                {
                    spa.UseAngularCliServer(npmScript: "start");
                }
            });
        }
        public VendorsController(ServicePerksDBContext context)
        {
            _context = context;

            if (_context.Vendors.Count() == 0)
            {
                _context.Vendors.Add(new Vendors {
                    Id           = "vendor1",
                    Name         = "Benny Tudino's",
                    Offer        = "Free Slice of Pizza",
                    OfferCode    = "free123",
                    RedeemPoints = 500,
                    Expiration   = new DateTime(2018, 4, 15),
                    Value        = 4
                });
                _context.Vendors.Add(new Vendors {
                    Id           = "vendor2",
                    Name         = "Tally-Ho",
                    Offer        = "2 Hour Happy Hour",
                    OfferCode    = "happy2hour",
                    RedeemPoints = 3000,
                    Expiration   = new DateTime(2018, 5, 1),
                    Value        = 30
                });
                _context.Vendors.Add(new Vendors {
                    Id           = "vendor3",
                    Name         = "Pokebowl",
                    Offer        = "20% off order of $10 or more",
                    OfferCode    = "20perc10",
                    RedeemPoints = 500,
                    Expiration   = new DateTime(2018, 4, 1),
                    Value        = 5
                });
                _context.Vendors.Add(new Vendors {
                    Id           = "vendor4",
                    Name         = "Pierce Dining Hall",
                    Offer        = "One Free Meal Swipe",
                    OfferCode    = "freeswipe1",
                    RedeemPoints = 1000,
                    Expiration   = new DateTime(2018, 4, 30),
                    Value        = 10
                });
                _context.Vendors.Add(new Vendors {
                    Id           = "vendor5",
                    Name         = "Q'Doba",
                    Offer        = "Free side with meal purchase",
                    OfferCode    = "freeside1",
                    RedeemPoints = 400,
                    Expiration   = new DateTime(2018, 4, 20),
                    Value        = 4
                });
                _context.Vendors.Add(new Vendors {
                    Id           = "vendor6",
                    Name         = "Stevens School Store",
                    Offer        = "20% off purchase",
                    OfferCode    = "20percbooks",
                    RedeemPoints = 500,
                    Expiration   = new DateTime(2018, 6, 1),
                    Value        = 5
                });
                _context.SaveChanges();
            }
        }