Esempio n. 1
0
        public async Task <ActionResult <IEnumerable <BrandViewModel> > > Index()
        {
            IEnumerable <BrandViewModel> getAllBrands = _iMapper.Map <IEnumerable <BrandViewModel> >
                                                            (await _iBrandManager.GetAll());

            return(View(getAllBrands));
        }
Esempio n. 2
0
        public IViewComponentResult Invoke()
        {
            ICollection <Brand> brands = _iBrandManager.GetAll()
                                         .Where(b => b.Featured == true && b.Status == true).ToList();

            return(View(brands));
        }
Esempio n. 3
0
        public async Task <ActionResult <IEnumerable <BrandApi> > > GetAll()
        {
            var brands = await _brandManager.GetAll();

            var response = _mapper.Map <IEnumerable <BrandApi> >(brands);

            return(Ok(response));
        }
Esempio n. 4
0
        public IActionResult GetAll()
        {
            var result = _brandManager.GetAll();

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Esempio n. 5
0
        public IViewComponentResult Invoke()
        {
            ICollection <Brand> getBrands = _iBrandManager.GetAll()
                                            .Where(b => b.Status == true).ToList();

            if (getBrands == null)
            {
                getBrands = new List <Brand>();
            }

            return(View(getBrands));
        }
        public ActionResult Details(int?id)
        {
            if (Session["username"] == null)
            {
                return(RedirectToAction("HomePage", "Home"));
            }

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var result = from asset in assetManager.GetAll().Where(c => c.Id == id)
                         join brand in brandManager.GetAll()
                         on asset.BrandId equals brand.Id
                         select new
            {
                id          = asset.Id,
                name        = asset.Name,
                code        = asset.Code,
                price       = asset.Price,
                serialno    = asset.SerialNo,
                description = asset.Description,
                brandname   = brand.Name
            };
            AssetDetailsVM assetDetailsVm = new AssetDetailsVM();

            foreach (var t in result)
            {
                assetDetailsVm.Id          = t.id;
                assetDetailsVm.Name        = t.name;
                assetDetailsVm.Code        = t.code;
                assetDetailsVm.Price       = t.price;
                assetDetailsVm.SerialNo    = t.serialno;
                assetDetailsVm.Description = t.description;
                assetDetailsVm.BrandName   = t.brandname;
            }
            if (assetDetailsVm == null)
            {
                return(HttpNotFound());
            }


            return(View(assetDetailsVm));
        }
        public IViewComponentResult Invoke()
        {
            ICollection <Brand> getFeaturedbrands = _iBrandManager.GetAll()
                                                    .Where(b => b.Featured == true && b.Status == true).ToList();

            ICollection <BrandPhoto> getFeaturedBrandPhoto = _iBrandPhotoManager.GetAll()
                                                             .Where(bp => bp.Featured == true && bp.Status == true).ToList();

            if (getFeaturedbrands == null)
            {
                getFeaturedbrands = new List <Brand>();
            }

            if (getFeaturedBrandPhoto == null)
            {
                getFeaturedBrandPhoto = new List <BrandPhoto>();
            }

            ViewBag.BrandPhotos = getFeaturedBrandPhoto;
            return(View(getFeaturedbrands));
        }
 public async Task <IActionResult> GetAll() => Ok(await _brandManager.GetAll());
Esempio n. 9
0
 public async Task <IActionResult> Create()
 {
     ViewBag.SubCategories = _iMapper.Map <ICollection <CategoryCreateViewModel> >(await _iCategoryManager.GetAll());
     ViewBag.Brands        = _iMapper.Map <ICollection <CreateBrandViewModel> >(await _iBrandManager.GetAll());
     return(View());
 }