예제 #1
0
        /// <summary>
        /// get details of SocialMedia
        /// </summary>
        /// <param name="id">socialMediaVersion id</param>
        /// <param name="socialMediaId"></param>
        /// <returns></returns>
        private IActionResult DetailsMethod(int id, int socialMediaId, int approvalId = 0)
        {
            SocialMediaViewModel viewModel;
            var socialVersion = _socialMediaVersionRepository.GetBySocialId(socialMediaId);

            if (socialVersion == null || socialVersion.VersionStatusEnum == VersionStatusEnum.Approved || socialVersion.VersionStatusEnum == VersionStatusEnum.Ignored)
            {
                var slider = _socialMediaRepository.Get(socialMediaId);
                if (slider != null)
                {
                    viewModel = slider.MapToSocialViewModel();
                }
                else
                {
                    socialVersion = _socialMediaVersionRepository.GetById(id);
                    viewModel     = socialVersion.MapToSocialViewModel();
                }
            }
            else
            {
                viewModel = socialVersion.MapToSocialViewModel();
            }
            //remove id value from route
            ModelState.Clear();
            viewModel.ApprovalId = approvalId;
            return(View(viewModel));
        }
예제 #2
0
 public Page <SocialMedias> Get(SocialMediaFilter filter)
 {
     filter.Pindex = filter.Pindex.HasValue ? filter.Pindex.Value : 0;
     filter.Psize  = filter.Psize.HasValue ? filter.Psize.Value : 20;
     return(repo.Get(filter));
 }