Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
 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("Введите данные");
     }
 }
Ejemplo n.º 3
0
 public AddQuestion()
 {
     InitializeComponent();
     IDTest = DB.GetId("select top 1 * from Tests order by id desc");
 }