public AddSubReportForm(IUnitOfWork unitOfWork, IShowListForCities showListForCities,IShowListForDrivers showListForDrivers, IShowListForFreights showListForFreights) : base(unitOfWork) { _paths = unitOfWork.Set<Path>(); _drivers = unitOfWork.Set<Driver>(); _freights = unitOfWork.Set<Freight>(); _showListForCities = showListForCities; _showListForDrivers = showListForDrivers; _showListForFreights = showListForFreights; InitializeComponent(); _defaultControl = pathCombo; pathCombo.Items.Clear(); _pathList = _paths.Where(x => x.ActiveState).ToList(); foreach (var tmp in _pathList.Select(path => $"{path.SourceCity} - {path.DestinationCity} :[{path.Id}]")) pathCombo.Items.Add(tmp); driverCombo.Items.Clear(); _driverList = _drivers.Where(x => x.ActiveState).ToList(); foreach (var tmp in _driverList.Select(driver => $"{driver.Name} {driver.Family} - {driver.Plaque} :[{driver.Id}]")) driverCombo.Items.Add(tmp); freightCombo.Items.Clear(); _freightList = _freights.Where(x => x.ActiveState).ToList(); foreach (var tmp in _freightList) freightCombo.Items.Add($"{tmp.Name} :[{tmp.Id}]"); }
public frmMain( IShowListForCities showListForCities, IShowListForDrivers showListForDrivers, IShowListForFreights showListForFreights, IShowListForReports showListForReports, IShowListForSubReports showListForSubReports, IShowListForPeople showListForPeople, IShowListForTransferForms showListForTransferForms, IShowListForCheckBanks showListForCheckBanks, ILock lLock ) { _showListForCities = showListForCities; _showListForDrivers = showListForDrivers; _showListForFreights = showListForFreights; _showListForReports = showListForReports; _showListForSubReports = showListForSubReports; _showListForPeople = showListForPeople; _showListForTransferForms = showListForTransferForms; _showListForCheckBanks = showListForCheckBanks; _lLock = lLock; _dateTime = DateTime.Now.AddMinutes(-1); InitializeComponent(); CriudEvent += frmMain_CriudEvent; Activated += (s, e) => messageCenterGroup.Visible = false; _digitalImages = new Image[] { Properties.Resources.num0, Properties.Resources.num1, Properties.Resources.num2, Properties.Resources.num3, Properties.Resources.num4, Properties.Resources.num5, Properties.Resources.num6, Properties.Resources.num7, Properties.Resources.num8, Properties.Resources.num9, }; }