Ejemplo n.º 1
0
        private void button4_Click(object sender, EventArgs e)
        {
            DataBaseConnector db = new DataBaseConnector();


            foreach (var p in PageContents)
            {
                BindingModel.Page page = new BindingModel.Page(p.PlaceInGroup, p.Number, p.Name, p.Type, p.Model, p.YoutubeLink1, p.YoutubeLink2, p.GameLink1, p.GameLink2, p.Id);
                db.ChangeData(page);
            }
            CleareAll();
            // button2.Enabled = true;
        }
Ejemplo n.º 2
0
        private void InsertElements()
        {
            DataBaseConnector db = new DataBaseConnector();

            Book.NameBook = textBox1.Text;
            db.InsertNewBook(Book);

            foreach (var p in PageContents)
            {
                BindingModel.Page page = new BindingModel.Page(p.PlaceInGroup, p.Number, p.Name, p.Type, p.Model, p.YoutubeLink1, p.YoutubeLink2, p.GameLink1, p.GameLink2, Book.Id);
                db.InsertPagesInBook(page);
            }
            CleareAll();
            button2.Enabled = true;
        }
Ejemplo n.º 3
0
 public void ChangeData(BindingModel.Page page)
 {
     DbConnection.Open();
     using (MySqlCommand command = new MySqlCommand("ChangeLink", DbConnection)
     {
         CommandType = CommandType.StoredProcedure
     })
     {
         command.Parameters.AddWithValue("@id", page.BookId);
         command.Parameters.AddWithValue("@Typ", page.Type);
         command.Parameters.AddWithValue("@Model", page.Model);
         command.Parameters.AddWithValue("@Link", page.GameLink1);
         command.ExecuteNonQuery();
     }
     DbConnection.Close();
 }
Ejemplo n.º 4
0
 public void InsertPagesInBook(BindingModel.Page page)
 {
     DbConnection.Open();
     using (MySqlCommand command = new MySqlCommand("InsertTargetUa", DbConnection)
     {
         CommandType = CommandType.StoredProcedure
     })
     {
         command.Parameters.AddWithValue("@Number", page.Number);
         command.Parameters.AddWithValue("@Name", page.Name);
         command.Parameters.AddWithValue("@Type", page.Type);
         command.Parameters.AddWithValue("@3D", page.Model);
         command.Parameters.AddWithValue("@YT", page.YoutubeLink1);
         command.Parameters.AddWithValue("@YT2", page.YoutubeLink2);
         command.Parameters.AddWithValue("@G", page.GameLink1);
         command.Parameters.AddWithValue("@G2", page.GameLink2);
         command.Parameters.AddWithValue("@AG", page.BookId);
         command.Parameters.AddWithValue("@PinG", page.PlaceInGroup);
         command.ExecuteNonQuery();
     }
     DbConnection.Close();
 }