Exemplo n.º 1
0
 void DeleteChangeoverCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
 {
     if (e.Error == null)
     {
         Changeovers.Remove(SelectedChangeover);
         SelectedChangeover = null;
     }
     else
     {
         ErrorProvider.ShowError(e.Error, Navigator);
     }
     dataClient.DeleteChangeoverCompleted -= DeleteChangeoverCompleted;
     Busy = false;
 }
Exemplo n.º 2
0
 void TransferChangeoverCompleted(object sender, TransferChangeoverCompletedEventArgs e)
 {
     if (e.Error == null)
     {
         if (Works != null)
         {
             Works.Add(e.Result);
         }
         Changeovers.Remove(SelectedChangeover);
         SelectedChangeover = null;
     }
     else
     {
         ErrorProvider.ShowError(e.Error, Navigator);
     }
     dataClient.TransferChangeoverCompleted -= TransferChangeoverCompleted;
     Busy = false;
 }
Exemplo n.º 3
0
 void DeleteDateCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
 {
     if (e.Error == null)
     {
         if (Changeovers.Any(c => c.DateID == Date.ID))
         {
             Changeovers.Remove(Changeovers.FirstOrDefault(c => c.DateID == Date.ID));
         }
         Tree.Years.
         First(c => c.Year == Date.DateContent.Year.ToString()).
         Months.First(c => c.Month == CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Date.DateContent.Month)).
         Days.First(c => c.Day == Date).Remove();
         if (Tree.Years.Count != 0)
         {
             Tree.Years.Last().Months.Last().Days.Last().IsSelected = true;
         }
         else
         {
             Date = null;
             if (Works != null)
             {
                 Works.Clear();
             }
             if (Attendances != null)
             {
                 Attendances.Clear();
             }
         }
     }
     else
     {
         ErrorProvider.ShowError(e.Error, Navigator);
     }
     dataClient.DeleteDateCompleted -= DeleteDateCompleted;
     Busy = false;
 }