Ejemplo n.º 1
0
 private void PopulateTaskList()
 {
     lsbxActiveTasks.DataSource = null;
     lsbxActiveTasks.DataSource = Task.GetAllUnFinishedTasks();
     //Tech Feedback tab
     cbxSchedueledTask.DisplayMember = "DisplayMember";
     cbxSchedueledTask.Items.Clear();
     cbxSchedueledTask.Items.AddRange(TechnicianTask.GetUnfinishedTechTasks().ToArray());
 }
Ejemplo n.º 2
0
        private void cbxSchedueledTask_SelectedIndexChanged(object sender, EventArgs e)
        {
            techTaskToModify = (TechnicianTask)cbxSchedueledTask.SelectedItem;

            lblTaskServiceRequest.Text = techTaskToModify.Task.ServiceRequest.ToString();

            PopulateTask();
            //Change DateTimePicker controls to select the day the tech is suppose to arrive, makes sure that the correct Date is already selected.
            dtpActualTimeArrived.Value = techTaskToModify.TimeToArrive;
            dtpActualTimeDep.Value     = techTaskToModify.TimeToArrive;
        }
Ejemplo n.º 3
0
        private void lsbxTasks_SelectedIndexChanged(object sender, EventArgs e)
        {
            Task taskToModify = (Task)lsbxActiveTasks.SelectedItem;

            techTaskToModify = AllTechnicianTasks.Find(tt => tt.Task.TaskID == taskToModify?.TaskID);
            if (!(techTaskToModify is null))
            {
                txtCurrentTech.Text = techTaskToModify.Technician.Person.FullName;
            }

            PopulateTask(); //quality of life
            btnReAssignTech.Enabled = true;
        }
Ejemplo n.º 4
0
        private void btnCreateJob_Click(object sender, EventArgs e)
        {
            Task           aTask    = new Task(txtTaskTitle.Text, txtTaskDescription.Text, txtTaskType.Text, rtbNotes.Text, currentRequest, DateTime.Now, false); //New task created
            TechnicianTask techTask = new TechnicianTask(aTask, currentTech, dtpDeparture.Value, dtpArival.Value);                                                //New Tech Task

            AllUnfinishedTasks.Add(aTask);                                                                                                                        //reduce database calls
            AllTechnicianTasks.Add(techTask);                                                                                                                     //reduce database calls

            techTask.Save();                                                                                                                                      //actually put in database

            PopulateUnclaimedClientServiceRequests();
            PopulateTaskList();

            MessageBox.Show("Task Created and Assigned", "Success");
        }