private void insertButton_Click(object sender, EventArgs e) { try { IPisnickaGateway pisnickagateway = new PisnickaGateway(); IAlbumGateway albumGateway = new AlbumGateway(); IZanrGateway zanrgateway = new ZanrGateway(); IInterpretGateway interpretgateway = new InterpretGateway(); pisnickagateway.Nazev = nazevBox.Text; pisnickagateway.Delka = delkaBox.Text; zanrgateway.Id = Int32.Parse(zanrBox.Text); interpretgateway.Id = Int32.Parse(interpretBox.Text); albumGateway.Id = Int32.Parse(albumBox.Text); Pisnicka p = new Pisnicka(pisnickagateway); Interpret i = new Interpret(interpretgateway); Zanr z = new Zanr(zanrgateway); Album a = new Album(albumGateway); PisnickaService.InsertPisnicku(p, i, z, a); infoLabel.Text = "pisnicka vložena"; } catch (Exception ex) { infoLabel.Text = "Něco je špatně"; Console.WriteLine(ex); } }
public void InsertZanr(Zanr zanr) { Zanr z = zanr; IZanrGateway zg = new ZanrGateway(); zg.Nazev = z.Nazev; zg.Popis = z.Popis; zg.Insert(); }
public static void InsertPisnicku(Pisnicka pisnicka, Interpret interpret, Zanr zanr, Album album) { Pisnicka p = pisnicka; Zanr z = zanr; Interpret i = interpret; Album a = album; IPisnickaGateway pg = new PisnickaGateway(); IZanrGateway zg = new ZanrGateway(); IAlbumGateway ag = new AlbumGateway(); IInterpretGateway ig = new InterpretGateway(); pg.Insert(); }
private void vlozButton_Click(object sender, EventArgs e) { try { ZanrGateway zanrGateway = new ZanrGateway(); zanrGateway.Nazev = nazevBox.Text; zanrGateway.Popis = popisBox.Text; Zanr z = new Zanr(zanrGateway); zs.InsertZanr(z); infoLabel.Text = "KOmentář vložen"; } catch (Exception ex) { infoLabel.Text = "Něco je špatně"; Console.WriteLine(ex); } }