Exemple #1
0
 public EditJobWindow(object sender)
     : this()
 {
     if (sender is AssignmentView)
     {
         Job = sender as AssignmentView;
     }
 }
Exemple #2
0
        private void StartDrag(object sender, MouseEventArgs e)
        {
            IsDragging = true;
            AssignmentView dragSource = sender as AssignmentView;

            if (dragSource != null)
            {
                DragDrop.DoDragDrop(dragSource, dragSource, DragDropEffects.Move);
            }
            IsDragging = false;
        }
Exemple #3
0
        private void AssignmentView_Drop(object sender, DragEventArgs e)
        {
            AssignmentView targetAV = sender as AssignmentView;
            AssignmentView sourceAV = e.Data.GetData(typeof(AssignmentView)) as AssignmentView;

            if (targetAV != null & sourceAV != null)
            {
                var target = targetAV.Presenter.Assignment;
                var source = sourceAV.Presenter.Assignment;
                Presenter.MoveAssignment(target, source);
                //AssignmentMovedEvent(target, source);
            }
        }
Exemple #4
0
        private void ScheduleGrid_Drop(object sender, DragEventArgs e)
        {
            AssignmentView sourceAV = e.Data.GetData(typeof(AssignmentView)) as AssignmentView;
            Grid           sg       = sender as Grid;


            if (sg != null && sourceAV != null)
            {
                var source = sourceAV.Presenter.Assignment;
                if (source.EmployeeSchedule != null)
                {
                    source.EmployeeSchedule.RemoveAssignment(source);
                }

                Presenter.EmployeeSchedule.AddAssignment(source);
            }
        }
Exemple #5
0
 public void AddAssignment(AssignmentView assignment)
 {
     ScheduleGrid.Children.Add(assignment);
     Grid.SetRow(assignment, assignment.Presenter.Assignment.StartTime);
     Grid.SetRowSpan(assignment, assignment.Presenter.Assignment.Duration);
 }