public void Edit(DaycareCenter center)
 {
     var original = this.FindCenter(center.Id);
     original.CenterName = center.CenterName;
     original.CenterAddress.StreetAddress = center.CenterAddress.StreetAddress;
     original.CenterAddress.City = center.CenterAddress.City;
     original.CenterAddress.State = center.CenterAddress.State;
     original.CenterAddress.ZipCode = center.CenterAddress.ZipCode;
     original.TelephoneNumber = center.TelephoneNumber;
     original.ContactPerson = center.ContactPerson;
     original.Email = center.Email;
     original.Website = center.Website;
     original.TotalCapacity = center.TotalCapacity;
     original.NumberOfOpenings = center.NumberOfOpenings;
     original.WaitingListSize = center.WaitingListSize;
     original.WaitingListOpenings = center.WaitingListOpenings;
     original.ReligiousAffiliation = center.ReligiousAffiliation;
     _db.SaveChanges();
 }
 public IHttpActionResult Post(DaycareCenter center)
 {
     if (center == null)
     {
         return BadRequest("Missing Daycare Center Post");
     }
     if (!ModelState.IsValid)
     {
         return BadRequest(ModelState);
     }
     if (center.Id == 0)
     {
         _daycareService.AddCenter(center);
         return Created("/Centers" + center.Id, center);
     }
     else
     {
         _daycareService.EditCenter(center);
         return Ok(center);
     }
 }
 public IEnumerable<DaycareCenter> Filter(DaycareCenter.BizTypes type)
 {
     return _daycareService.FilterCenters(type);
 }
 public void Insert(DaycareCenter center)
 {
     _db.Centers.Add(center);
     _db.SaveChanges();
 }
 public IList<DaycareCenter> FilterCenters(DaycareCenter.BizTypes type)
 {
     return _repo.Query<DaycareCenter>().Where(c=>c.CenterType == type).ToList();
 }
 public void AddCenter(DaycareCenter center)
 {
     _repo.Add(center);
     _repo.SaveChanges();
 }