Example #1
0
 private void insertVerbToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Rijec r = new Rijec();
     r.Tekst = "biti";
     InsertVerbRegularRoot inp = new InsertVerbRegularRoot(r);
     inp.Show();
 }
Example #2
0
        private void insertVerbToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Rijec r = new Rijec();

            r.Tekst = "biti";
            InsertVerbRegularRoot inp = new InsertVerbRegularRoot(r);

            inp.Show();
        }
Example #3
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (ch_root.Checked)
     {
         if (c_type.SelectedIndex == 0 || c_type.SelectedIndex == 2 || c_type.SelectedIndex == 5)
         {
             Rijec r = new Rijec();
             r.Tekst = t_word.Text;
             InsertNounsPronouns inp = new InsertNounsPronouns(r);
             inp.Show();
         }
         if (c_type.SelectedIndex == 1)
         {
             Rijec r = new Rijec();
             r.Tekst = t_word.Text;
             InsertVerbRegularRoot irr = new InsertVerbRegularRoot(r);
             irr.Show();
         }
     }
     try {
         OdbcConnection connection = new OdbcConnection();
         connection.ConnectionString = "DSN=PostgreSQL35W;UID=masterwordcounter;PWD=masterwordcounter";
         connection.Open();
         string      q          = "INSERT INTO words(id, word, root, type, irregular) VALUES(nextval('words_id_seq'), ?, ?, ?, false); ";
         OdbcCommand insertText = new OdbcCommand(q, connection);
         Rijec       t          = (Rijec)(c_root.SelectedItem);
         insertText.Parameters.Add("@word", OdbcType.Text).Value = t_word.Text;
         if (ch_root.Checked)
         {
             insertText.Parameters.Add("@root", OdbcType.Int).Value = null;
         }
         else
         {
             insertText.Parameters.Add("@root", OdbcType.Int).Value = t.Id;
         }
         insertText.Parameters.Add("@type", OdbcType.Int).Value = c_type.SelectedIndex + 1;
         if (ch_regular.Checked)
         {
             insertText.Parameters.Add("@irregular", OdbcType.Int).Value = 1;
         }
         else
         {
             insertText.Parameters.Add("@irregular", OdbcType.Int).Value = 0;
         }
         insertText.ExecuteNonQuery();
         brojUnesenihRijeci++;
         t_word.Text   = filtrirana_lista_rijeci[brojUnesenihRijeci].Tekst;
         l_InList.Text = brojUnesenihRijeci + 1 + "/" + filtrirana_lista_rijeci.Count.ToString();
         connection.Close();
     }
     catch (Exception er)
     {
         MessageBox.Show(er.Message);
     }
 }
 private void button1_Click(object sender, EventArgs e)
 {
     if(ch_root.Checked) {
         if (c_type.SelectedIndex == 0 || c_type.SelectedIndex == 2 || c_type.SelectedIndex == 5)
         {
             Rijec r = new Rijec();
             r.Tekst = t_word.Text;
             InsertNounsPronouns inp = new InsertNounsPronouns(r);
             inp.Show();
         }
         if (c_type.SelectedIndex == 1)
         {
             Rijec r = new Rijec();
             r.Tekst = t_word.Text;
             InsertVerbRegularRoot irr = new InsertVerbRegularRoot(r);
             irr.Show();
         }
     }
     try {
         OdbcConnection connection = new OdbcConnection();
         connection.ConnectionString = "DSN=PostgreSQL35W;UID=masterwordcounter;PWD=masterwordcounter";
         connection.Open();
         string q = "INSERT INTO words(id, word, root, type, irregular) VALUES(nextval('words_id_seq'), ?, ?, ?, false); ";
         OdbcCommand insertText = new OdbcCommand(q, connection);
         Rijec t = (Rijec)(c_root.SelectedItem);
         insertText.Parameters.Add("@word", OdbcType.Text).Value = t_word.Text;
         if(ch_root.Checked)
             insertText.Parameters.Add("@root", OdbcType.Int).Value = null;
         else
             insertText.Parameters.Add("@root", OdbcType.Int).Value = t.Id;
         insertText.Parameters.Add("@type", OdbcType.Int).Value = c_type.SelectedIndex+1;
         if (ch_regular.Checked)
             insertText.Parameters.Add("@irregular", OdbcType.Int).Value = 1;
         else
             insertText.Parameters.Add("@irregular", OdbcType.Int).Value = 0;
         insertText.ExecuteNonQuery();
         brojUnesenihRijeci++;
         t_word.Text = filtrirana_lista_rijeci[brojUnesenihRijeci].Tekst;
         l_InList.Text = brojUnesenihRijeci + 1 + "/"+filtrirana_lista_rijeci.Count.ToString();
         connection.Close();
     }
     catch (Exception er)
     {
         MessageBox.Show(er.Message);
     }
 }