コード例 #1
0
        //
        // GET: /ManageSizeAttributes/

        public ActionResult Index(String an, String en, int PageSize = PAGE_SIZE, int page = 1, Sorts sb = Sorts.IdUp, long Id = 0)
        {
            List <OptionManagerDTO> optionsDTOs    = _manageProductService.GetAllOptions();
            List <SizeAttributeDTO> AttributesDTOs = _manageSizeAttributeService.Filter(an, en, Id, sb);
            //List<SizeAttributeDTO> AttributesDTOs = new List<SizeAttributeDTO>();
            SizeAttributeIndexManagerVM sizeAttributes = new SizeAttributeIndexManagerVM
            {
                SizeAttributes = AttributesDTOs.ToPagedList(page, PageSize),
                filters        = new OptionFiltersDTO
                {
                    ArabicName  = an,
                    EnglishName = en,
                    PageNum     = page,
                    PageSize    = PageSize,
                    Id          = Id,
                    SortBy      = sb
                }
            };

            /* Mapper.Initialize(c => c.CreateMap<OptionValueManagerDTO, OptionValueManagerVM>());
             * Mapper.Initialize(c => c.CreateMap<OptionManagerDTO, OptionManagerVM>().ForMember(dest => dest.OptionValues, opt =>
             * opt.MapFrom(src => Mapper.Map<List<OptionValueManagerDTO>, List<OptionValueManagerVM>>(src.OptionValues))));
             *
             * List<OptionManagerVM> options = Mapper.Map<List<OptionManagerDTO>, List<OptionManagerVM>>(optionsDTOs);*/

            return(View(sizeAttributes));
        }