예제 #1
0
        // GET: Admin/Category
        public ActionResult Index()
        {
            var res       = _categoryMasterService.GetCategoryList().ToList();
            var viewModel = AutoMapper.Mapper.Map <List <CategoryMaster>, List <CategoryViewModel> >(res);

            return(View(viewModel));
        }
예제 #2
0
        public ActionResult GetSubCategory(string Id)
        {
            SubCategoryViewModel model;

            if (!string.IsNullOrEmpty(Id))
            {
                var res = _subCategoryService.GetSubCategory(Convert.ToDecimal(Id));
                model = AutoMapper.Mapper.Map <SubCategoryMaster, SubCategoryViewModel>(res);
            }
            else
            {
                model = new SubCategoryViewModel();
            }
            ViewBag.CategoryList = _categoryMasterService.GetCategoryList();
            return(PartialView("AddEditSubCategory", model));
        }