Ejemplo n.º 1
0
 public StockGenerationModel GetStockGenerationModel(Warehouse warehouse)
 {
     return new StockGenerationModel
     {
         WarehouseId = warehouse.Id
     };
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
 public bool AnyStock(Warehouse warehouse)
 {
     return _session.QueryOver<WarehouseStock>().Where(stock => stock.Warehouse.Id == warehouse.Id).Any();
 }
Ejemplo n.º 5
0
 public void Delete(Warehouse warehouse)
 {
     _session.Transact(session => session.Delete(warehouse));
 }
Ejemplo n.º 6
0
 public void Update(Warehouse warehouse)
 {
     _session.Transact(session => session.Update(warehouse));
 }
Ejemplo n.º 7
0
 public void Add(Warehouse warehouse)
 {
     _session.Transact(session => session.Save(warehouse));
 }