private void LoadSearchShiduch() { SqlDataReader reader = People.ReadAll(0, false, false, false, false, true, MyPeople); KeyValueClass item; item = new KeyValueClass(); item.Text = ""; item.Value = "-1"; txtSearchShiduch.Items.Add(item); while (reader.Read()) { item = new KeyValueClass(); string text = (string)reader["FirstName"] + " " + (string)reader["LastName"]; text += " " + reader["YeshivaGorSeminary"].ToString(); text += " " + reader["City"].ToString(); text += " " + reader["Street"].ToString(); item.Text = text; item.Value = reader["ID"].ToString(); txtSearchShiduch.Items.Add(item); } reader.Close(); //else // lblSearchShiduch.Visible = true; }
public bool LoadData(bool reset = false) { ListNameColumnPeople = new List <KeyValueClass>(); ListNameColumnPeople.Add(new KeyValueClass("Status", 0)); ListNameColumnPeople.Add(new KeyValueClass("Tz", 0)); ListNameColumnPeople.Add(new KeyValueClass("HealthStatus", 0)); List <People> lst = new List <People>(); SqlDataReader myreader; myreader = People.ReadAll(0, false, true); while (myreader.Read()) { People p = new People(); PeopleManipulations.ReaderToPeople(ref p, ref myreader, PeopleManipulations.RtpFor.ForSearch); lst.Add(p); } olstpeople.BeginUpdate(); olstpeople.SetObjects(lst); olstpeople.EndUpdate(); myreader.Close(); DBFunction.CloseConnections(); formloadmsg.Close(); return(true); }
private void tabControl1_Selected(object sender, TabControlEventArgs e) { if (isFirstLoad) { // LoadShadcanim(); isFirstLoad = false; } if (e.TabPage == tabPage2) { dtActivityDatefrom.Value = DateTime.Now.AddDays(-7); LoadTab2(dtActivityDatefrom.Value, dtActivityDateto.Value); } else if (e.TabPage == tabPage3 && Tab3 == false) { //e.TabPage.BackgroundImage = Properties.Resources.bg; Tab3 = true; People p = new People(); SqlDataReader reader; reader = People.ReadAll(0, false, false, true); lstmyclients.BeginUpdate(); while (reader.Read()) { PeopleManipulations.ReaderToPeople(ref p, ref reader, PeopleManipulations.RtpFor.ForSearch); LoadResultToList(ref p, lstmyclients); } lstmyclients.EndUpdate(); reader.Close(); } else if (e.TabPage == tabPage9 && Tab9 == false) { if (cmb_matchclient.Items.Count == 1) { cmb_matchclient.Items.Add(new KeyValueClass("", 1000)); return; } cmb_matchclient.Items.Clear(); picmatch.Visible = true; ThreadPool.QueueUserWorkItem(new WaitCallback(LoadTab9)); } }