private int Search(string name, string surname, string city, string sex, string pesel)
 {
     CandidateAdapter can = new CandidateAdapter();
     can.SearchCommand(name, surname, city, sex, pesel);
     can.CreateList();
     dataGrid1.ItemsSource = can.GetList();
     return can.GetList().Count;
 }
 private List<CandidateAdapter> GetCanList()
 {
     CandidateAdapter dataCan = new CandidateAdapter();
     dataCan.SearchCommand();
     dataCan.CreateList();
     return dataCan.GetList();
 }