public JsonResult CategoryList()
        {
            List <CategoryDetail> categoryDetailResult = new List <CategoryDetail>();

            #region Authorize
            var authorizeMenuAccessResult = AuthorizeMenuAccess(LookupKey.Menu.InventoryMenuId);
            if (!authorizeMenuAccessResult.IsSuccess)
            {
                return(Json(new
                {
                    isSuccess = authorizeMenuAccessResult.IsSuccess,
                    messageAlert = authorizeMenuAccessResult.MessageAlert,
                    CategoryDetailsResult = categoryDetailResult
                }, JsonRequestBehavior.AllowGet));
            }
            #endregion

            var currentUserId = Session[LookupKey.SessionVariables.UserId].IsNull() ? 0 : Convert.ToInt64(Session[LookupKey.SessionVariables.UserId]);
            categoryDetailResult = _categoryServices.GetAll().ToList();
            var response = new
            {
                CategoryDetailsResult = categoryDetailResult,
                isSuccess             = true,
                messageAlert          = ""
            };
            return(Json(response, JsonRequestBehavior.AllowGet));
        }
        public IActionResult Index()
        {
            CategoryViewModel model = new CategoryViewModel();

            model.categories = _categoryServices.GetAll();
            return(View(model));
        }
        public IActionResult ProductEdit(int?id) //gelen idye göre sorgular gelen idye göre bilgiyi göstericezb
        {
            if (id == null)
            {
                return(NotFound());
            }
            var entity = _productServices.GetByIdWithCategories((int)id); //bunla gittim ürünü buldum entity içine atadım
            var model  = new ProductModel()                               //buradada entity içinden modele atıyorum
            {
                ProductId   = entity.ProductId,
                Name        = entity.Name,
                Url         = entity.Url,
                Author      = entity.Author,
                Pages       = entity.Pages,
                Description = entity.Description,
                ImageUrl    = entity.ImageUrl,
                IsApproved  = entity.IsApproved,
                IsHome      = entity.IsHome,
                categories  = entity.ProductCategories.Select(i => i.Categories).ToList()//seçilmiş olan ürünle ilişkili kategorileri bir listeye çevirip categories içine attım
            };

            //categorieste sadece o idye ait ürünü aldım şimdi ise tüm kategori bilgilerini alacağım
            ViewBag.Category = _categoryServices.GetAll();
            return(View(model));
        }
        public ActionResult <List <CategoryViewModel> > GetAll()
        {
            var resultService = _categoryServices.GetAll();


            return(_mapper.Map <List <CategoryViewModel> >(resultService));
        }
Пример #5
0
 public IViewComponentResult Invoke()
 {
     if (RouteData.Values["category"] != null)
     {
         ViewBag.SelectedCategory = RouteData?.Values["category"];
     }
     return(View(_categoryServices.GetAll()));
 }
 public IViewComponentResult Invoke()
 {
     if (RouteData.Values["action"].ToString() == "List")
     {
         ViewBag.SelectedCategory = RouteData?.Values["id"];
     }
     return(View(_categoryServices.GetAll()));//metodu categorylerimi getirir
 }
        public IActionResult Index()
        {
            CategoryListViewModel categoryListViewModel = new CategoryListViewModel()
            {
                Categories = _categoryServices.GetAll()
            };

            return(View(categoryListViewModel));
        }
Пример #8
0
        private IResult CheckIfCategoryCount()
        {
            var result = _categoryServices.GetAll();

            if (result.Data.Count >= 8)
            {
                return(new ErrorResults("Category Sayısı 15'i geçemez"));
            }
            return(new SuccessResult());
        }
Пример #9
0
        public IActionResult GetAll()
        {
            var result = _categoryServices.GetAll();

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result.Message));
        }
Пример #10
0
        private IResult CheckIfCategoryLimitExceded()
        {
            var result = _categoryServices.GetAll();

            if (result.Data.Count > 15)
            {
                return(new ErrorResult(Messages.CategoryLimitExceded));
            }

            return(new SuccessResult());
        }
Пример #11
0
        public async Task <IActionResult> FormInsUp(int id)
        {
            var pro = await _productServices.GetById(id);

            var category = await _categoryServices.GetAll();

            ViewBag.Category = category.Select(x => new SelectListItem {
                Text = x.Name, Value = x.Id.ToString(), Selected = (x.Id == pro.CategoryId),
            }).ToList();
            return(PartialView("_FormInsUp", pro));
        }
Пример #12
0
        public PartialViewResult _Footer()
        {
            var categories = _category.GetAll();

            return(PartialView(categories));
        }
Пример #13
0
 public IActionResult ArticleCreateAdmin()
 {
     ViewBag.Categories = _categoryServices.GetAll();
     ViewBag.Authors    = _authorServices.GetAll();
     return(View());
 }
Пример #14
0
 public HttpResponseMessage Get()
 {
     return(ToJson(_categoryServices.GetAll().ToList()));
 }
Пример #15
0
 public PartialViewResult Category()
 {
     ViewBag.LstCategory = _category.GetAll();
     return(PartialView("_Category"));
 }
Пример #16
0
 public PartialViewResult Footer()
 {
     ViewBag.LstCategory = _category.GetAll();
     return(PartialView("_Footer"));
 }
        public IResponseDTO GetPage(int pageNumber = 0, int pageSize = 0)
        {
            var result = ServicesCategory.GetAll(pageNumber, pageSize);

            return(result);
        }
Пример #18
0
 public IActionResult ProductCreate()
 {
     ViewBag.Categories = _categoryServices.GetAll();
     return(View());
 }
Пример #19
0
 // GET: Admin/Products/Create
 public ActionResult Create()
 {
     ViewBag.CategoryID = new SelectList(_category.GetAll(), "CategoryID", "CategoryName");
     return(View());
 }
Пример #20
0
        public PartialViewResult Menu()
        {
            var danhmuc = _categoryServices.GetAll();

            return(PartialView(danhmuc));
        }
Пример #21
0
        public async Task <IActionResult> GetAll()
        {
            List <Category> ca = await _categoryServices.GetAll();

            return(PartialView("_List", ca));
        }
Пример #22
0
        public IActionResult GetCatagory()
        {
            var result = _categoryServices.GetAll();

            return(PartialView("_List", result.Result));
        }