示例#1
0
        // GET: RegisteredClient/Details/5
        public ActionResult Details(int id)
        {
            RegisteredClientViewModel model;

            try
            {
                model = _mapper.Map <RegisteredClientViewModel>(_registeredClientService.GetById(id));
            }
            catch (Exception ex)
            {
                _logger.Error(ex);
                if (ex.InnerException != null && ex.InnerException.Source.Equals(GeneralMessages.ExceptionSource))
                {
                    ModelState.AddModelError(string.Empty, ex.Message);
                }
                else
                {
                    ModelState.AddModelError(string.Empty, GeneralMessages.UnexpectedError);
                }
                return(View());
            }

            return(View(model));
        }