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; }
public bool addDocument(Pasports pasport) { try { entities.Pasports.Add(pasport); entities.SaveChanges(); } catch { return(false); } return(true); }