public PartnershipNight GetPartnershipNightByDate(DateTime date, BvLocation loc)
 {
     var db = new CapstoneDbContext();
     return (from pnight in db.PartnershipNights.Include("Charity").Include("BVLocation")
             where pnight.Date == date && pnight.BVLocation == loc
             select pnight).FirstOrDefault();
 }
Exemplo n.º 2
0
 public List<PartnershipNight> GetPartnershipNights(BvLocation l)
 {
     var db = new CapstoneDbContext();
     List<PartnershipNight> partnershipnights = (from c in db.PartnershipNights.Include("BvLocation").Include("Charity")
                                  where c.BVLocation.BvLocationId == l.BvLocationId
                                  select c).ToList<PartnershipNight>();
     return partnershipnights;
 }
Exemplo n.º 3
0
 public ActionResult EditLoc(BvLocation l)
 {
     if (ModelState.IsValid)
     {
         lRepo.SaveBvLocation(l);
         TempData["message"] = string.Format("{0} has been saved", l.BvLocationId);
         return RedirectToAction("AdminLocIndex");
     }
     else
     {
         return View(l);
     }
 }
Exemplo n.º 4
0
 public ActionResult Index()
 {
     //data to get db up and running -- delete when done
     //add a location
     BvLocation loc1 = new BvLocation { Address = "333 N Main St", City = "BobVille", BvStoreNum = "BV99", Phone = "839-839-8393", Zip = "88898" };
     lRepo.AddBvLocation(loc1);
     //add a user
     User u1 = new User { UserFName = "Bob", UserLName = "Bobberson", AccessLevel = 1, BvLocation = loc1, Password = "******", UserEmail = "*****@*****.**", PhoneNumber = "541-389-8293" };
     uRepo.AddUser(u1);
     //add a charity
     Charity c1 = new Charity { Address = "8939 S Seventh", City = "CharityVille", FederalTaxId = "893018XS", Name = "HopeForBob", Phone = "893-829-8393", TypeOfCharity = "Helpful", Zip = "83928" };
     cRepo.AddCharity(c1);
     //add a partnership night
     PartnershipNight pn1 = new PartnershipNight { AfterTheEventFinished = false, AmountRaised = 0, BeforeTheEventFinished = true, BVLocation = loc1, Charity = c1, CheckRequestFinished = false, Comments = "blah blah", Date = DateTime.Parse("05/30/2014") };
     pnRepo.AddPartnershipNight(pn1);
     //add stats
     StatsInfo s1 = new StatsInfo { AmountOfTotalSalesToCharity = 25.88M, CashDonations = 19.83M, GuestCount = 10, TotalSales = 100.00M, partnershipNight = pn1};
     sRepo.AddStatsInfo(s1);
     return View();
 }
Exemplo n.º 5
0
        public void SaveBvLocation(BvLocation l)
        {
            var db = new CapstoneDbContext();
            if (l.BvLocationId == 0)
                db.BvLocations.Add(l);
            else
            {
                BvLocation dbEntry = db.BvLocations.Find(l.BvLocationId);
                if (dbEntry != null)
                {
                    dbEntry.Address = l.Address;
                    dbEntry.BvStoreNum = l.BvStoreNum;
                    dbEntry.City = l.City;
                    dbEntry.Phone = l.Phone;
                    dbEntry.Zip = l.Zip;
                }

            }
            db.SaveChanges();
        }
 public IQueryable<PartnershipNight> GetPartnershipNightsByLoc(BvLocation loc)
 {
     throw new NotImplementedException();
 }
 public IQueryable<PartnershipNight> GetPartnershipNightsByDateRange(DateTime firstDate, DateTime lastDate, BvLocation loc)
 {
     throw new NotImplementedException();
 }
 public PartnershipNight GetPartnershipNightByDate(DateTime date, BvLocation loc)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 9
0
 public void AddBvLocation(BvLocation bvLocation)
 {
     var db = new CapstoneDbContext();
     db.BvLocations.Add(bvLocation);
     db.SaveChanges(); ;
 }