예제 #1
0
 public StockGenerationModel GetStockGenerationModel(Warehouse warehouse)
 {
     return new StockGenerationModel
     {
         WarehouseId = warehouse.Id
     };
 }
예제 #2
0
        public List<SelectListItem> GetWarehouseOptions(Warehouse warehouse)
        {
            IList<Warehouse> warehouses = _session.QueryOver<Warehouse>()
                .Where(w => w.Id != warehouse.Id)
                .OrderBy(w => w.Name).Asc
                .Cacheable().List();

            return warehouses.BuildSelectItemList(w => w.Name,
                w => w.Id.ToString(),
                emptyItem: null);
        }
예제 #3
0
        public List<SelectListItem> GetStockGenerationTypeOptions(Warehouse warehouse)
        {
            IList<Warehouse> warehouses = _session.QueryOver<Warehouse>()
                .Where(w => w.Id != warehouse.Id)
                .OrderBy(w => w.Name).Asc
                .Cacheable().List();
            List<StockGenerationType> stockGenerationOptions =
                Enum.GetValues(typeof(StockGenerationType)).Cast<StockGenerationType>().ToList();

            if (!warehouses.Any())
                stockGenerationOptions.RemoveAll(item => item == StockGenerationType.CopyFromWarehouse);
            else
                stockGenerationOptions.RemoveAll(item => item == StockGenerationType.CopyFromSystemValues);

            return stockGenerationOptions.BuildSelectItemList(type => type.ToString().BreakUpString(),
                type => type.ToString(), emptyItem: null);
        }
예제 #4
0
 public bool AnyStock(Warehouse warehouse)
 {
     return _session.QueryOver<WarehouseStock>().Where(stock => stock.Warehouse.Id == warehouse.Id).Any();
 }
예제 #5
0
 public void Delete(Warehouse warehouse)
 {
     _session.Transact(session => session.Delete(warehouse));
 }
예제 #6
0
 public void Update(Warehouse warehouse)
 {
     _session.Transact(session => session.Update(warehouse));
 }
예제 #7
0
 public void Add(Warehouse warehouse)
 {
     _session.Transact(session => session.Save(warehouse));
 }