示例#1
0
        /// <summary>
        /// GetContentPageCategory
        /// </summary>
        /// <param name="contentPageCategoryId"></param>
        /// <returns></returns>
        public ServiceResponse <ContentPageCategoryDC> GetContentPageCategory(int contentPageCategoryId)
        {
            ServiceResponse <ContentPageCategoryDC> contentPageCategoryResponse = new ServiceResponse <ContentPageCategoryDC>();

            try
            {
                SetContext();
                ContentPageCategory contentPageCategoryResult = _contentManager.GetContentPageCategory(contentPageCategoryId);
                contentPageCategoryResponse.Result = Mapper.Map <ContentPageCategory, ContentPageCategoryDC>(contentPageCategoryResult);
            }
            catch (Exception ex)
            {
                HandleError(ex, contentPageCategoryResponse);
            }
            return(contentPageCategoryResponse);
        }
示例#2
0
        /// <summary>
        /// SaveContentPageCategory
        /// </summary>
        /// <param name="contentPageCategory"></param>
        /// <returns></returns>
        public ServiceResponse <int> SaveContentPageCategory(ContentPageCategoryDC contentPageCategory)
        {
            ServiceResponse <int> contentPageCategoryResponse = new ServiceResponse <int>();

            try
            {
                SetContext();
                ContentPageCategory contentPageCategoryModel = Mapper.Map <ContentPageCategoryDC, ContentPageCategory>(contentPageCategory);
                _contentManager.SaveContentPageCategory(contentPageCategoryModel);
                contentPageCategoryResponse.Result = contentPageCategoryModel.ContentPageCategoryId;
            }
            catch (Exception ex)
            {
                HandleError(ex, contentPageCategoryResponse);
            }
            return(contentPageCategoryResponse);
        }
示例#3
0
        /// <summary>
        /// GetContentPages
        /// </summary>
        /// <param name="contentPageCategoryId"></param>
        /// <returns></returns>
        public ServiceResponse <ContentPageCategoryDC> GetContentPages(int contentPageCategoryId)
        {
            ServiceResponse <ContentPageCategoryDC> ContentPagesResponse = new ServiceResponse <ContentPageCategoryDC>();

            try
            {
                SetContext();
                ContentPageCategory ContentPageCategory = _contentManager.GetContentPages(contentPageCategoryId);
                ContentPagesResponse.Result = Mapper.Map <ContentPageCategory, ContentPageCategoryDC>(ContentPageCategory);
                ContentPagesResponse.Result.ContentPages = new List <ContentPageDC>();
                ContentPageCategory.ContentPages.ToList().ForEach(result =>
                {
                    ContentPagesResponse.Result.ContentPages.Add(Mapper.Map <ContentPage, ContentPageDC>(result));
                });
            }
            catch (Exception ex)
            {
                HandleError(ex, ContentPagesResponse);
            }
            return(ContentPagesResponse);
        }