Пример #1
0
 void IDropTarget.DragOver(IDropInfo dropInfo)
 {
     if (AuthenticationService.IsPlanner)
     {
         if (dropInfo.Data is BookedOrderViewModel)
         {
             BookedOrderViewModel source = dropInfo.Data as BookedOrderViewModel;
             if ((source.ReactQual == ReactType || source.ReactQual == "DUAL") && source.IsPlannable)
             {
                 dropInfo.Effects    = DragDropEffects.Copy;
                 dropInfo.NotHandled = false;
             }
         }
         if (dropInfo.Data is TaskViewModel)
         {
             TaskViewModel source = dropInfo.Data as TaskViewModel;
             dropInfo.Effects    = DragDropEffects.Move;
             dropInfo.NotHandled = false;
         }
         if (dropInfo.Data is ReactorViewModel)
         {
             ReactorViewModel reactor = dropInfo.Data as ReactorViewModel;
             if (reactor.ReactType == this.ReactType)
             {
                 dropInfo.Effects    = DragDropEffects.Move;
                 dropInfo.NotHandled = false;
             }
         }
     }
 }
Пример #2
0
 public void Load(List <Task> tasks)
 {
     if (!IsLoading)
     {
         IsLoading = true;
         var timeNow = DateTime.Now;
         StatusMessageService.Message = "Loading Reactor " + this.Caption;
         Tasks.AddRange(
             from task in tasks
             where task.IsDeleted == false
             //where (task.IsDeleted == false && (task.Start >= DateTime.Now || task.End > DateTime.Now))
             orderby task.TaskIndex, task.Start, task.DateCreated
             select _factory.Create(this, task)
             );
         foreach (var task in Tasks.Where(t => t.TaskType == "O"))
         {
             if (task.BookedOrderID.HasValue)
             {
                 BookedOrderViewModel order = Orders[task.BookedOrderID.Value];
                 task.AttachedOrder = order;
                 if (task.TaskIndex == 0)
                 {
                     task.Start = timeNow;
                 }
             }
         }
         ;
         StatusMessageService.Message = this.Caption + " loaded.";
         IsLoading = false;
     }
 }
Пример #3
0
 public AttachedTask(TaskViewModel task, BookedOrderViewModel order)
 {
     Task  = task;
     Order = order;
     _key  = order.OrderID;
 }