示例#1
0
        private void FillCboTrucks()
        {
            if (this._job.Truck != null)
            {
                this.cboTrucks.Items.Add(this._job.Truck);
                this.cboTrucks.SelectedIndex = 0;
            }

            var assignedVehicles = new AssignedVehicle(new UnitOfWork()).GetAll(this._planningId);
            var jobs = new Job(new UnitOfWork()).GetAll(this._planningId, this.dteJobDate.DateTime.Date);

            foreach (Job job in jobs)
            {
                var result = assignedVehicles.Where(x => x.TruckName == job.Truck);
                assignedVehicles.Remove(result.ToList()[0]);
            }

            foreach (AssignedVehicle assignedVehicle in assignedVehicles)
            {
                //TODO: Wat moet getoond worden?
                this.cboTrucks.Items.Add(assignedVehicle.TruckName);
                if (assignedVehicle.TruckName == this._job.Truck)
                    this.cboTrucks.SelectedIndex = this.cboTrucks.Items.Count - 1;
            }
        }