public ActionResult Edit(int id, Liminstrumentrating model) { try { InitRepos(true, false); model.Subjecttypes = subjtypesRepo.GetById(model.SubjectTypeId); model.Ratings = ratingsRepo.GetById(model.RatingId); model.Instruments = instrRepo.GetById(model.InstrumentId); limRepo.Update(model); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Create(Liminstrumentrating model) { try { // TODO: Add insert logic here InitRepos(true, false); model.Subjecttypes = subjtypesRepo.GetById(model.SubjectTypeId); model.Ratings = ratingsRepo.GetById(model.RatingId); model.Instruments = instrRepo.GetById(model.InstrumentId); limRepo.Create(model); return(RedirectToAction("Index")); } catch { return(View()); } }