Exemple #1
0
        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));
        }
Exemple #2
0
        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));
        }
Exemple #3
0
        // 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));
        }