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