Пример #1
0
        /// <summary>
        /// Se déclenche après le clic sur le bouton Addtask
        /// Va lancer le processus pour ajouter une tâche à une journée
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonAddTask_Click_1(object sender, EventArgs e)
        {
            int      jour    = listCalendar.SelectedNode.Index;
            TaskForm AddTask = new TaskForm(Astronauts, Categories, "adding", PlanningMission.Calendar[jour], Map, this.xOrigin, this.yOrigin);



            if (AddTask.ShowDialog() == DialogResult.OK)
            {
                Activity         newAct       = AddTask.ActivitySend;
                List <Astronaut> AstronautNew = AddTask.SelectedAstronaut;
                int    Duration        = AddTask.MinuteDurationSend;
                int    startHour       = AddTask.MinuteStartSend;
                string DescriptionTask = AddTask.Description;
                int    XPosition       = AddTask.xMap;
                int    YPosition       = AddTask.yMap;


                Task newTask = new Task(newAct, AstronautNew, Duration, startHour, DescriptionTask, XPosition, YPosition);
                int  numDay  = listCalendar.SelectedNode.Index;
                PlanningMission.Calendar[numDay].AddTask(newTask);
                this.majDayPlanning();
            }
        }
        /// <summary>
        /// Se déclenche après le clic sur le bouton Addtask
        /// Va lancer le processus pour ajouter une tâche à une journée
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonAddTask_Click_1(object sender, EventArgs e)
        {
            int jour = listCalendar.SelectedNode.Index;
            TaskForm AddTask = new TaskForm(Astronauts, Categories, "adding", PlanningMission.Calendar[jour],Map, this.xOrigin, this.yOrigin);

            if(AddTask.ShowDialog() == DialogResult.OK)
            {
                Activity newAct = AddTask.ActivitySend;
                List<Astronaut> AstronautNew = AddTask.SelectedAstronaut;
                int Duration = AddTask.MinuteDurationSend;
                int startHour = AddTask.MinuteStartSend;
                string DescriptionTask = AddTask.Description;
                int XPosition = AddTask.xMap;
                int YPosition = AddTask.yMap;

                Task newTask = new Task(newAct, AstronautNew, Duration, startHour,DescriptionTask,XPosition,YPosition);
                int numDay = listCalendar.SelectedNode.Index;
                PlanningMission.Calendar[numDay].AddTask(newTask);
                this.majDayPlanning();

            }
        }