Beispiel #1
0
 private void FetchBase()
 {
     for (int i = Pasports.Count - 1; i >= 0; i--) // удаление закрытых паспортов из списка
     {
         if (String.IsNullOrWhiteSpace(Pasports[i].Text))
         {
             Pasports.RemoveAt(i);
         }
     }
     if (mustReload && !backgroundBaseReload.IsBusy)
     {
         backgroundBaseReload.RunWorkerAsync(reloadPtName);
     }
     if (!backgroundFetch.IsBusy)
     {
         IDictionary <string, List <Draw> > fetchList =
             new Dictionary <string, List <Draw> >(fetchlist.Count);
         foreach (KeyValuePair <string, List <Draw> > item in fetchlist)
         {
             fetchList.Add(item.Key, item.Value);
         }
         backgroundFetch.RunWorkerAsync(fetchList);
     }
     blink = !blink;
 }
Beispiel #2
0
 public bool addDocument(Pasports pasport)
 {
     try
     {
         entities.Pasports.Add(pasport);
         entities.SaveChanges();
     }
     catch
     {
         return(false);
     }
     return(true);
 }