Пример #1
0
        /*
         * Developer: Rizwan Ali
         * Date: 8-25-19
         * Action:Get all tags from category option table for All Sub Category
         * URL: categoryoption/GetTagsSubCategoryWise/
         * Input: none
         * output:  List of All Tags and Categories
         */
        public async Task <IActionResult> Index()
        {
            CategoryOptionPage categoryOption = new CategoryOptionPage();

            ViewBag.SubCats = await _BadgerApiHelper.GenericGetAsync <IEnumerable <Categories> >("/CategoryOption/SubCategoryAll/");

            categoryOption = await _BadgerApiHelper.GenericGetAsync <CategoryOptionPage>("/CategoryOption/CategoryOptionPage/");

            ViewBag.selected = 0;
            return(View(categoryOption));
        }
Пример #2
0
        public async Task <CategoryOptionPage> GetCategoryOptionTypeWise(string id)
        {
            CategoryOptionPage categoryOption = new CategoryOptionPage();

            try
            {
                //categoryOption.AllColors = await _CategoryRepo.GetAllColors();
                categoryOption.AllTags = await _CategoryRepo.GetAllTagsTypeWise(id);
            }
            catch (Exception ex)
            {
                var logger = _loggerFactory.CreateLogger("internal_error_log");
                logger.LogInformation("Problem happened in getting data for selecting category option with message" + ex.Message);
            }
            return(categoryOption);
        }
Пример #3
0
        /*
         * Developer: Rizwan Ali
         * Date: 8-25-19
         * Action:Get all tags from category option table for specific or All Sub Category
         * URL: categoryoption/GetTagsSubCategoryWise/
         * Input: SubCategoryID
         * output: List of All Tags (Specific SubCategory) and Categories
         */
        public async Task <IActionResult> GetTagsSubCategoryWise(string id)
        {
            CategoryOptionPage categoryOption = new CategoryOptionPage();

            if (id == "0")
            {
                ViewBag.SubCats = await _BadgerApiHelper.GenericGetAsync <IEnumerable <Categories> >("/CategoryOption/SubCategoryAll/");

                categoryOption = await _BadgerApiHelper.GenericGetAsync <CategoryOptionPage>("/CategoryOption/CategoryOptionPage/");

                ViewBag.selected = 0;
            }
            else
            {
                ViewBag.SubCats = await _BadgerApiHelper.GenericGetAsync <IEnumerable <Categories> >("/CategoryOption/SubCategoryAll/");

                ViewBag.selected = Convert.ToInt32(id);
                categoryOption   = await _BadgerApiHelper.GenericGetAsync <CategoryOptionPage>("/CategoryOption/CategoryOptionPageTypeWise/" + id);

                var arr = categoryOption.AllTags.Where(p => p.isChecked == "checked").Select(p => p.attribute_id).Distinct().ToList();
                ViewBag.tags = JsonConvert.SerializeObject(arr);
            }
            return(PartialView("Index", categoryOption));
        }