コード例 #1
0
        private static TotalTask CreateRealTask(int[] taskIds)
        {
            var res = new TotalTask();


            return(res);
        }
コード例 #2
0
        public static TotalTask LoadTotalTask(int[] taskIds, List <OptVehicle> vehicles)
        {
            using (var db = new ChistoDatabase())
            {
                // Технологические операции
                var operationQuery =
                    from to in db.Operations
                    where taskIds.Contains(to.TaskId)
                    select new
                {
                    to.Task.CompanyId,
                    to.TemplateOperation.VehicleTypeId,
                    to.TemplateOperation.Speed,
                };

                var operations = operationQuery.ToList();
                var opers      = operations.Select(op => new TechOper
                {
                    CompanyID = op.CompanyId,
                    Speed     = Convert.ToDouble(op.Speed),
                    Vehicle   = vehicles.FirstOrDefault(x => x.VehicleTypeId == op.VehicleTypeId),
                }).ToList();

                var task = new TotalTask
                {
                    Vehicles = vehicles,
                    Opers    = opers,
                };

                var companies = LoadCompanies(null);
                task.Locations = companies.Select(c => new Location
                {
                    LocationName = c.Name,
                    Opers        = opers.Where(o => o.CompanyID == c.Id).ToList(),
                    Square       = (double)c.Square,
                }).ToList();

                return(task);
            }
        }
コード例 #3
0
ファイル: FormMain.cs プロジェクト: yallie/chistoda
        private TotalTask CreateTest()
        {
            var task = TotalTask.CreateTestTask();

            return(task);
        }
コード例 #4
0
ファイル: FormMain.cs プロジェクト: yallie/chistoda
 private void LoadTask()
 {
     _task = LoadTest(); //CreateTest();
     UpdateSolution();
 }
コード例 #5
0
 private static void LoadRealVehicles(TotalTask task)
 {
 }