private void Start_Click(object sender, RoutedEventArgs e) { int id_t = DB.GetId("select top 1 * from Tests"); DB.TestID = Convert.ToInt32(id_t); TestWindow window = new TestWindow(); window.Show(); Close(); }
private void Next_Click(object sender, RoutedEventArgs e) { if (Name.Text.Length > 0 && AnswersCount.Text.Length > 0 && Score.Text.Length > 0) { if (DB.Command($"insert into Questions values({IDTest}, '{Name.Text}', {Score.Text})")) { int id = DB.GetId($"select id from Questions where name='{Name.Text}'"); addAnswers window = new addAnswers(Convert.ToInt32(AnswersCount.Text), id); window.Show(); Close(); } } else { MessageBox.Show("Введите данные"); } }
public AddQuestion() { InitializeComponent(); IDTest = DB.GetId("select top 1 * from Tests order by id desc"); }