public ActionResult Send(GenericModel <ExamFieldMappingModel> viewModel) { viewModel.Header = Resources.ResultsHeader; try { var success = ExamFieldMappingProvider.Save(Helpers.GetAuthenticator(), viewModel.Data); viewModel.ResultMessage = !success ? Resources.UnsuccesfullySaved : Resources.SuccesfullySaved; } catch (Exception ex) { viewModel.ErrorMessage = ex.GetBaseException().Message; } return(View("Index", viewModel)); }
public ActionResult Delete(string id) { var viewModel = new GenericModel <ExamFieldMappingModel>(); viewModel.Header = Resources.ResultsHeader; try { var success = ExamFieldMappingProvider.Delete(Helpers.GetAuthenticator(), id); viewModel.ResultMessage = !success ? Resources.UnsuccesfullyDeleted : Resources.SuccesfullyDeleted; } catch (Exception ex) { viewModel.ErrorMessage = ex.GetBaseException().Message; } return(View("Index", viewModel)); }
// GET: ExamFieldMappings/Edit/5 public ActionResult Get(string id) { var viewModel = new GenericModel <ExamFieldMappingModel>(); try { var data = ExamFieldMappingProvider.Get(Helpers.GetAuthenticator(), id); viewModel.Data = data; viewModel.Header = Resources.ResultsHeader; viewModel.ErrorMessage = data != null ? string.Empty : string.Format(Resources.DataNotFound, id); } catch (Exception ex) { viewModel.ErrorMessage = ex.GetBaseException().Message; } return(View("Index", viewModel)); }