Exemple #1
0
        public ActionResult Send(GenericModel <HealthReviewModel> viewModel)
        {
            viewModel.Header = Resources.ResultsHeader;

            try
            {
                var success = HealthReviewProvider.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 <HealthReviewModel>();

            viewModel.Header = Resources.ResultsHeader;

            try
            {
                var success = HealthReviewProvider.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: Allergies/Edit/5
        public ActionResult Get(string id)
        {
            var viewModel = new GenericModel <HealthReviewModel>();

            try
            {
                var data = HealthReviewProvider.Get(Helpers.GetAuthenticator(), id);

                viewModel.Data = data;

                viewModel.Header = Resources.ResultsHeader;

                viewModel.ResultMessage = data != null ? string.Empty : string.Format(Resources.DataNotFound, id);
            }
            catch (Exception ex)
            {
                viewModel.ErrorMessage = ex.GetBaseException().Message;
            }
            return(View("Index", viewModel));
        }