public ActionResult Create(CenterFreeResource centerfreeresource)
        {
            int centerid = account.GetCurrentUserCenterId();
            if (ModelState.IsValid)
            {
                centerfreeresource.CenterId = centerid;
                repoService.centerResourcesRepo.Insert(centerfreeresource);
                return RedirectToAction("Edit");
            }

            ViewBag.PossibleCenters = repoService.centerRepo.FindAll();
            return View(centerfreeresource);
        }
 public void Update(CenterFreeResource c)
 {
     db.Entry(c).State = EntityState.Modified;
     db.SaveChanges();
 }
 public void Insert(CenterFreeResource c)
 {
     db.CenterFreeResources.Add(c);
     db.SaveChanges();
 }
 public void Delete(CenterFreeResource c)
 {
     db.CenterFreeResources.Remove(c);
     db.SaveChanges();
 }