Пример #1
0
        //Insert
        public bool InsertCursus(Cursus Cursis_ID, string Inhoud)
        {
            //throw new System.NotImplementedException();
            bool   resultaat = true;
            string sql;

            //CHECKEN OF DIE GOED IS?
            sql = "insert into bericht(postid, inhoud) values (:postid, :inhoud)";

            try
            {
                Connect();
                MySqlCommand cmd = new MySqlCommand(sql, connection);
                //cmd.Parameters.Add(new MySqlParameter("postid", ));
                //cmd.Parameters.Add(new MySqlParameter("inhoud", ));
                cmd.ExecuteNonQuery();
            }
            catch (MySqlException e)
            {
                resultaat = false;
            }
            finally
            {
                connection.Close();
            }
            return(resultaat);
        }
Пример #2
0
        private void btn_Toevoegen_Click(object sender, EventArgs e)
        {
            //if (string.IsNullOrEmpty(tb_Aantal.Text || tb_ID.Text ||tb_Naam.Text || tb_Om.Text))
            //{
            //    MessageBox.Show("Vul de titel in");
            //    Title = false;

            //}
            //else if (string.IsNullOrEmpty(tbPostText.Text))
            //{
            //    MessageBox.Show("Vul de inhoud in");
            //    Inhoud = false;
            //}

            Cursus cursus = new Cursus(Convert.ToInt32(tb_ID), tb_Naam.Text, Convert.ToInt32(tb_Aantal));

            cursus.Account = admini.currentAccount;
            admini.Add(cursus, tb_Om.Text);
        }
Пример #3
0
 //Insert
 public void Add(Cursus Cursus, string Inhoud)
 {
     DBQuery.InsertCursus(Cursus, Inhoud);
 }