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