Exemplo n.º 1
0
        public ActionResult Edit(int id)
        {
            var asset = _assetRepository.Get(id);

            ViewBag.AllocatedUserId = new SelectList(_userRepository.GetAll("Person"), "Id", "Person.Name", asset.AllocatedEmployeeId);
            ViewBag.AssetCategoryId = new SelectList(_assetCategoryRepository.GetAll(), "Id", "Title", asset.AssetCategoryId);
            ViewBag.DepartmentId    = new SelectList(_departmentRepository.GetAll(), "Id", "Title", asset.DepartmentId);
            ViewBag.VendorId        = new SelectList(_vendorRepository.GetAll(), "Id", "Title", asset.VendorId);

            return(View(asset));
        }
Exemplo n.º 2
0
        public async Task <PaginatedList <AssetCategoryDto> > PaginationAsync(SieveModel model, Expression <Func <AssetCategory, bool> > predicate = null)
        {
            var entities = _assetCategoryRepository.GetAll(predicate);
            var count    = await _sieveProcessor.Apply(model, entities, applyPagination : false).CountAsync();

            var result = _sieveProcessor.Apply(model, entities)
                         .ProjectTo <AssetCategoryDto>(_mapper.ConfigurationProvider);
            var pagination = await result.ToListAsync();

            return(new PaginatedList <AssetCategoryDto>(
                       _sieveOptions, model.Page, model.PageSize, count, pagination));
        }
Exemplo n.º 3
0
        public JsonResult Index()
        {
            var apiResult = TryExecute(() => _assetCategoryRepository.GetAll(), "Asset Categories Fetched sucessfully");

            return(Json(apiResult, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 4
0
        public ActionResult Index()
        {
            var assetCategories = _assetCategoryRepository.GetAll();

            return(View(assetCategories.ToList()));
        }