private void list_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { SqlConnection conn = new SqlConnection(SqlConn.ConnectionString.defaultString); if (list.SelectedItems.ToString() == "") { } else { conn.Open(); // int i = GetIdT(list.SelectedItem.ToString()); int ind = GetIdT(list.SelectedItem.ToString()); UserTest t = new UserTest(ind); t.Show(); conn.Close(); this.Close(); // showTests(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public TestForm() { InitializeComponent(); ur = new UserTest(test); count_quet = ur.getQuestionCount(); Print_quest(q_id); q_id++; }
private void Button1_Click(object sender, EventArgs e) { if (textBox3.Text.ToString() == "") { MessageBox.Show("Выберите файл!", "Error"); } else { UserTest test = new UserTest(textBox3.Text.ToString()); label1.Visible = false; button1.Visible = false; button2.Visible = false; textBox3.Visible = false; label2.Visible = true; textBox1.Visible = true; textBox2.Visible = true; label3.Visible = true; label4.Visible = true; label5.Visible = true; button3.Visible = true; } }
private void MainWindow_Loaded(object sender, RoutedEventArgs e) { var testUser1 = new UserTest(); testUser1.Name = "Пользователь 1"; testUser1.Geolocations = new[] { new GeolocationInfo(new Geolocation(55.806588, 37.694551, true), "huawei nova 2i") { DateTime = new DateTime(2017, 12, 27, 12, 15, 0) }, new GeolocationInfo(new Geolocation(55.770220, 37.743989, false), "huawei nova 2i") { DateTime = new DateTime(2017, 12, 27, 15, 15, 0) }, new GeolocationInfo(new Geolocation(55.754734, 37.759095, true), "huawei nova 2i") { DateTime = new DateTime(2017, 12, 27, 18, 15, 0) }, new GeolocationInfo(new Geolocation(55.738468, 37.774202, false), "huawei nova 2i") { DateTime = new DateTime(2017, 12, 27, 20, 15, 0) }, new GeolocationInfo(new Geolocation(55.719093, 37.789308, true), "huawei nova 2i") { DateTime = new DateTime(2017, 12, 28, 2, 15, 0) }, new GeolocationInfo(new Geolocation(55.707464, 37.798921, false), "huawei nova 2i") { DateTime = new DateTime(2017, 12, 28, 3, 15, 0) }, new GeolocationInfo(new Geolocation(55.709790, 37.819520, true), "huawei nova 2i") { DateTime = new DateTime(2017, 12, 28, 5, 15, 0) }, new GeolocationInfo(new Geolocation(55.818187, 37.432252, true), "xiaomi") { DateTime = new DateTime(2017, 12, 27, 12, 15, 0) }, new GeolocationInfo(new Geolocation(55.806588, 37.452851, false), "xiaomi") { DateTime = new DateTime(2017, 12, 27, 15, 15, 0) }, new GeolocationInfo(new Geolocation(55.800400, 37.478944, true), "xiaomi") { DateTime = new DateTime(2017, 12, 27, 18, 15, 0) }, new GeolocationInfo(new Geolocation(55.789569, 37.510530, false), "xiaomi") { DateTime = new DateTime(2017, 12, 27, 20, 15, 0) }, new GeolocationInfo(new Geolocation(55.779509, 37.527009, true), "xiaomi") { DateTime = new DateTime(2017, 12, 28, 2, 15, 0) }, new GeolocationInfo(new Geolocation(55.764027, 37.553102, false), "xiaomi") { DateTime = DateTime.Now.AddHours(-2) }, new GeolocationInfo(new Geolocation(55.750862, 37.588807, true), "xiaomi") { DateTime = DateTime.Now.AddHours(-1) } }; var action = new UserInLocationAction(); action.SetNeedTargets(() => new[] { testUser1 }); while (true) { action.UserInitializeWith(null, true); MessageBox.Show(action.GetValue(null)); } }