예제 #1
0
        public async Task <IActionResult> Origins()
        {
            var origins = await _repository.GetAll();

            var viewModel = new OriginsViewModel
            {
                Origins = _mapper.Map <IEnumerable <Origin>, IEnumerable <OriginViewModel> >(origins)
            };

            return(View(viewModel));
        }
예제 #2
0
        public ActionResult Add()
        {
            var cat = GetAllCategories();

            ViewBag.Categories = new SelectList(cat, "Id", "Name");

            var origin = _origin.GetAll();

            ViewBag.Origin = new SelectList(origin, "Id", "Name");

            var brand = _brand.GetAll();

            ViewBag.Brand = new SelectList(brand, "Id", "Name");

            var hashtag = new HashtagController(_tag).GetAll();

            ViewBag.Hashtag = new MultiSelectList(hashtag, "Name", "Name");

            ViewBag.Title = "Thêm sản phẩm";
            return(View(new ProductModel()));
        }
예제 #3
0
        public IEnumerable <Origin> GetAllOrigin()
        {
            var result = _origin.GetAll();

            return(result);
        }
예제 #4
0
        public ActionResult GetAll()
        {
            var data = _origin.GetAll();

            return(Json(data));
        }