コード例 #1
0
 public IEnumerable <Warehouse> GetWarehouses(Int64?id)
 {
     if (id == null || id <= 0)
     {
         return(warehouseRepository.GetAll());
     }
     else
     {
         return(warehouseRepository.GetAll().Where(o => o.ID == id));
     }
 }
コード例 #2
0
        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));
        }
コード例 #3
0
ファイル: WarehouseService.cs プロジェクト: VFA91/TestVicente
        public IList <WarehouseDto> GetAll()
        {
            var warehouses = _warehouseRespository.GetAll();
            var warehouse  = _warehouseLogic.GetAll(warehouses);

            return(MapperWarehouse.GetWarehouseDto(warehouse));
        }
コード例 #4
0
        public StockReportDto GetStockReport(string productType, string productId)
        {
            var warehouse = _warehouseRespository.GetAll();
            var stock     = _stockLogic.GetStockReport(warehouse, productType, productId);

            return(stock);
        }
コード例 #5
0
ファイル: WarehouseAppService.cs プロジェクト: thinhtp/SPMS
        public GetAllWarehousesOutput GetAllWarehouses()
        {
            var warehouse = _WarehouseRepository.GetAll().OrderBy(b => b.CreationTime);

            return(new GetAllWarehousesOutput
            {
                Warehouses = Mapper.Map <List <WarehouseDto> >(warehouse)
            });
        }
コード例 #6
0
        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));
        }
コード例 #7
0
        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();
        }
コード例 #8
0
ファイル: WarehouseController.cs プロジェクト: rrc011/Fact
        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;
            }
        }
コード例 #9
0
        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));
        }
コード例 #10
0
ファイル: ProductController.cs プロジェクト: rrc011/Fact
        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;
            }
        }
コード例 #11
0
ファイル: WareHouseService.cs プロジェクト: yexinw/SmoWMS
 /// <summary>
 /// 得到所有仓库列表
 /// </summary>
 /// <returns></returns>
 public List <WareHouse> GetAllWareHouse()
 {
     return(_warehouseRepository.GetAll().AsNoTracking().ToList());
 }
コード例 #12
0
 public IEnumerable <WarehouseDTO> GetAllWarehouses()
 {
     return(repository.GetAll());
 }
コード例 #13
0
 public IEnumerable <Warehouse> GetAll()
 {
     return(_warehouseRepository.GetAll());
 }
コード例 #14
0
        public async Task <List <Warehouse> > GetAllWarehouse()
        {
            var warehouses = await _repoWarehouse.GetAll().ToListAsync();

            return(warehouses);
        }
コード例 #15
0
 public IList <Warehouse> GetAll()
 {
     return(_repository.GetAll());
 }
コード例 #16
0
        public async Task <IEnumerable <WarehouseItemDto> > Get()
        {
            var warehouseItems = await _warehouseRepository.GetAll();

            return(warehouseItems.Select(WarehouseMapper.MapToWarehouseItemDto));
        }