Example #1
0
 public TaskView()
 {
     InitializeComponent();
     Databases.SyncFinished += Databases_SyncFinished;
     ww = new WaitingWindow();
     ww.Show();
 }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (Globals.SyncActive == false)
     {
         string userId = Databases.localModel.RegistrySet.Find("ship_user_id").Value;
         WaitingWindow ww = new WaitingWindow();
         List<Order> _temp = new List<Order>();
         List<Order> _send = new List<Order>();
         foreach (object o in dataGrid.Items)
             if (o is Order)
                 _temp.Add(o as Order);
         foreach (Order o in _temp)
             if (o.NeedToSend)
                 _send.Add(o);
         if (_send.Count > 0)
         {
             try
             {
                 Globals.SyncLock = true;
                 ww.Show();
                 MediaLog.SendPackages(_send);
                 ww.Close();
                 RefreshDataSource();
             }
             catch (Exception ex) { }
             finally { Globals.SyncLock = false; }
         }
     }
 }