Exemplo n.º 1
0
        internal static ComplaintActivityFeedViewModel MapActivityFeed(ActivityFeed activityFeed)
        {
            var result = new ComplaintActivityFeedViewModel();
            result.StartDate = activityFeed.StartDate;

            foreach (var section in activityFeed.Sections)
                result.Sections.Add(Mappers.MapActivityFeedSection(section));

            return result;
        }
        private ComplaintActivityFeedViewModel TryGetActivityFeed(int id)
        {
            var model = new ComplaintActivityFeedViewModel();

            try
            {
                model = GetActivityFeed(id);
            }
            catch (ForbiddenException) { AddModelStateError(GlobalStrings.Forbidden); }
            catch (CaseDoesNotExistException) { AddModelStateError(GlobalStrings.CaseDoesNotExist); }
            catch (Exception) { AddModelStateError(GlobalStrings.SomethingWentWrong); }

            return model;
        }