public IEnumerable <Warehouse> GetWarehouses(Int64?id) { if (id == null || id <= 0) { return(warehouseRepository.GetAll()); } else { return(warehouseRepository.GetAll().Where(o => o.ID == id)); } }
public IActionResult Index() { var warehouseListitng = _warehouseRepository.GetAll() .Select(x => new WarehouseIndexViewModel { Id = x.Id, Name = x.Name, Address = x.Address, Vendor = x.Vendor }); return(View(warehouseListitng)); }
public IList <WarehouseDto> GetAll() { var warehouses = _warehouseRespository.GetAll(); var warehouse = _warehouseLogic.GetAll(warehouses); return(MapperWarehouse.GetWarehouseDto(warehouse)); }
public StockReportDto GetStockReport(string productType, string productId) { var warehouse = _warehouseRespository.GetAll(); var stock = _stockLogic.GetStockReport(warehouse, productType, productId); return(stock); }
public GetAllWarehousesOutput GetAllWarehouses() { var warehouse = _WarehouseRepository.GetAll().OrderBy(b => b.CreationTime); return(new GetAllWarehousesOutput { Warehouses = Mapper.Map <List <WarehouseDto> >(warehouse) }); }
public IActionResult Update(int id) { inventoryItems inventory = _repository.FindWithWarehouse(a => a.inventoryItemsId == id).FirstOrDefault(); inventoryItems inventory1 = _repository.FindWithEmployee(a => a.inventoryItemsId == id).FirstOrDefault(); if (inventory == null) { return(NotFound()); } if (inventory1 == null) { return(NotFound()); } var InventoryVM = new InventoryViewModel { Inventory = inventory, Warehouses = _warehouseRepository.GetAll(), Employee = _employeeRepository.GetAll() }; return(View(InventoryVM)); }
public async Task RollbackAsync(string tenantId) { var subscriptions = await _subscriptionRepository.GetAll().Where(x => x.TenantId == tenantId).ToListAsync(); _subscriptionRepository.Delete(subscriptions); await _subscriptionRepository.CommitAsync(); var companySettings = await _companySettingsRepository.GetAll().Where(x => x.TenantId == tenantId).ToListAsync(); _companySettingsRepository.Delete(companySettings); await _companySettingsRepository.CommitAsync(); var companies = await _companyRepository.GetAll().Where(x => x.TenantId == tenantId).ToListAsync(); _companyRepository.Delete(companies); await _companyRepository.CommitAsync(); var branches = await _branchRepository.GetAll().Where(x => x.TenantId == tenantId).ToListAsync(); _branchRepository.Delete(branches); await _branchRepository.CommitAsync(); var warehouses = await _warehouseRepository.GetAll().Where(x => x.TenantId == tenantId).ToListAsync(); _warehouseRepository.Delete(warehouses); await _warehouseRepository.CommitAsync(); #region Security var users = _userService.GetUsersByTenantId(tenantId); foreach (var user in users) { await _userService.DeleteUserAsync(user); } #endregion var tenants = await _tenantRepository.GetAll().Where(x => x.Id == tenantId).ToListAsync(); _tenantRepository.Delete(tenants); await _tenantRepository.CommitAsync(); }
public IActionResult Get(int?page, string search) { try { var predicate = PredicateBuilder.True <Warehouse>(); predicate = predicate.And(x => x.Deleted == false); if (!string.IsNullOrEmpty(search)) { predicate = predicate.And(x => (x.Name.Contains(search) || x.Descripcion.Contains(search))); } var model = warehouseRepository.GetAll(page, predicate); var outputmodel = new WarehouseViewModel() { PaginationInfo = new PaginationViewModel() { HasNextPage = model.HasNextPage, HasPreviousPage = model.HasPreviousPage, PageIndex = model.PageIndex, TotalPages = model.TotalPages, TRecords = model.TRecords }, Items = model.Select(x => new WarehouseDto() { WarehouseId = x.Id, Name = x.Name, Description = x.Descripcion, Location = x.Location }).ToList() }; return(Ok(outputmodel)); } catch (Exception e) { throw e; } }
public IActionResult List() { if (!_repository.Any()) { return(View("Empty")); } List <WarehouseViewModel> warehouseVM = new List <WarehouseViewModel>(); var warehouses = _repository.GetAll(); foreach (var warehouse in warehouses) { warehouseVM.Add(new WarehouseViewModel { Warehouse = warehouse, }); } return(View(warehouseVM)); }
public IActionResult Get() { try { var predicate = PredicateBuilder.True <Warehouse>(); predicate = predicate.And(x => x.Deleted == false); var model = warehouseRepository.GetAll(1, predicate, 1000); var outputmodel = model.ToList().Select(u => new SelectListItem { Text = u.Name, Value = u.Id.ToString() }); return(Ok(outputmodel)); } catch (Exception e) { throw e; } }
/// <summary> /// 得到所有仓库列表 /// </summary> /// <returns></returns> public List <WareHouse> GetAllWareHouse() { return(_warehouseRepository.GetAll().AsNoTracking().ToList()); }
public IEnumerable <WarehouseDTO> GetAllWarehouses() { return(repository.GetAll()); }
public IEnumerable <Warehouse> GetAll() { return(_warehouseRepository.GetAll()); }
public async Task <List <Warehouse> > GetAllWarehouse() { var warehouses = await _repoWarehouse.GetAll().ToListAsync(); return(warehouses); }
public IList <Warehouse> GetAll() { return(_repository.GetAll()); }
public async Task <IEnumerable <WarehouseItemDto> > Get() { var warehouseItems = await _warehouseRepository.GetAll(); return(warehouseItems.Select(WarehouseMapper.MapToWarehouseItemDto)); }