Пример #1
0
        public ActionResult GetCategoryUserMapping(string Id)
        {
            CategoryMappingModel model;

            // var res="";

            if (!string.IsNullOrEmpty(Id))
            {
                var Tablelst = _subCategoryService.GetCategoryUserMappingList();
                var res      = _subCategoryService.GetCategoryUserMapping(Convert.ToDecimal(Id));
                model = new CategoryMappingModel
                {
                    ID                   = Convert.ToInt32(res.ID),
                    UserID               = res.UserID ?? 0,
                    FirstName            = res.UserFirstName,
                    LastName             = res.UserLastName,
                    CategoryId           = res.CategoryID ?? 0,
                    CategoryName         = res.CategoryName,
                    Logintbllst          = Tablelst.Item1,
                    SubCategoryMasterlst = Tablelst.Item2
                };
                //model = AutoMapper.Mapper.Map<CategoryUserMapping, CategoryMappingModel>(res);
            }
            else
            {
                model = new CategoryMappingModel();
                //model = new CategoryMappingModel();
            }
            return(Json(RenderRazorViewToString("AddEditCategoryMapp", model), JsonRequestBehavior.AllowGet));

            //ViewBag.CategoryList = _categoryMasterService.GetCategoryList();
            //return RedirectToAction("CategoryUserMappingList", model);
        }