Пример #1
0
 private void Load_Mails(MailClient client)
 {
     if (!client.IsConnected)
     {
         return;
     }
     Loads++;
     string[][] Mails = client.Load_Mail_List();
     if (Mails != null)
     {
         m_dbConnection.Open();
         foreach (string[] Mail in Mails)
         {
             SQLiteCommand insertSQL = new SQLiteCommand("INSERT INTO MailList (MessageId, Receiver, Sender, Date, Subject, Container) VALUES ('" + Mail[0] + "','" + client.Client_Mail + "','" + Mail[1] + "','" + Mail[2] + "','" + Mail[3] + "','Inbox')", m_dbConnection);
             try
             {
                 insertSQL.ExecuteNonQuery();
             }
             catch
             { }
         }
         m_dbConnection.Close();
     }
     App.Current.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate()
     {
         client.MailListMap_Selected(client.HeadUser.SelectedItem, new RoutedEventArgs());
     }));
     Loads--;
 }
 private void Load_Mails(MailClient client)
 {
     if (!client.IsConnected) return;
     Loads++;
     string[][] Mails = client.Load_Mail_List();
     if (Mails != null)
     {
         m_dbConnection.Open();
         foreach (string[] Mail in Mails)
         {
             SQLiteCommand insertSQL = new SQLiteCommand("INSERT INTO MailList (MessageId, Receiver, Sender, Date, Subject, Container) VALUES ('" + Mail[0] + "','" + client.Client_Mail + "','" + Mail[1] + "','" + Mail[2] + "','" + Mail[3] + "','Inbox')", m_dbConnection);
             try
             {
                 insertSQL.ExecuteNonQuery();
             }
             catch
             { }
         }
         m_dbConnection.Close();
     }
     App.Current.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate()
     {
         client.MailListMap_Selected(client.HeadUser.SelectedItem, new RoutedEventArgs());
     }));
     Loads--;
 }