Example #1
0
        public void DataSync(ServiceReference1.TrainPlan tp)
        {
            if (tp != null)
            {
                switch (tp.trainingGroupState)
                {
                case ServiceReference1.TrainningGroupState.Started:
                    dateTime = tp.StartedTime;
                    SetLabelStartTimeValue();
                    LoadGroupF();
                    StartGroupF();
                    break;

                case ServiceReference1.TrainningGroupState.Pause:
                    dateTime = tp.StartedTime;
                    SetLabelStartTimeValue();
                    LoadGroupF();
                    PauseGroupF();
                    break;

                case ServiceReference1.TrainningGroupState.Stop:
                    dateTime = tp.StartedTime;
                    SetLabelStartTimeValue();
                    LoadGroupF();
                    StopGroupF();
                    break;

                default:
                    //LoadGroupF();
                    break;
                }
            }
        }
Example #2
0
        private bool SendDataToWcf()
        {
            bool success = false;
            //Dictionary<string, Dictionary<ServiceReference1.PlanType, string>> lg = new Dictionary<string, Dictionary<ServiceReference1.PlanType, string>>();
            //string strGroupName = GroupName;
            //Dictionary<ServiceReference1.PlanType, string> dt_plane = new Dictionary<ServiceReference1.PlanType, string>();
            //string strTm = GetFlightplan(comboBox3.Text);
            //if (strTm == "")
            //{
            //    MessageBox.Show("没有飞行计划");
            //    return success;
            //}
            //dt_plane.Add(ServiceReference1.PlanType.FLIGHT, strTm);
            //strTm = "";
            //strTm = GetConditionCommandInfo(ThreadBase.trainPlans.Find(oct => oct.trainingPlanName.Equals(comboBox3.Text)).trainingPlanId);
            //dt_plane.Add(ServiceReference1.PlanType.CONDITIONCOMMAND, strTm);
            //lg.Add(strGroupName, dt_plane);

            var trainPlan = ThreadBase.trainPlans.Find(oct => oct.trainingPlanName.Equals(comboBox3.Text));

            ServiceReference1.TrainPlan trainGroupPlan = new ServiceReference1.TrainPlan();
            trainGroupPlan.trainPlanGroupID   = GroupName;
            trainGroupPlan.trainPlanGroupName = GroupName;
            trainGroupPlan.trainPlanID        = (trainPlan?.trainingPlanId ?? 0).ToString();
            trainGroupPlan.trainPlanName      = trainPlan.trainingPlanName;
            //trainGroupPlan.airPortId = trainPlan.airportId.ToString();
            //update on 20200331 给机场id
            var airport = ThreadBase.airportInfoBases.Find(o => o.airportName.Equals(comboBox1.Text.Trim()));

            if (airport != null)
            {
                trainGroupPlan.airPortId = airport.airportId.ToString();
            }
            //
            Form_Main.service.createTrainningGroupByTrainingIdAsync(trainGroupPlan);//.createTrainningGroupAsync(lg);
            success = true;
            return(success);
        }