public static Collection <Asistence> Read(OracleDataReader reader) { var data = new Collection <Asistence>(); while (reader.Read()) { int i = -1; var asistence = new Asistence { AsistenceId = reader.GetInt32(++i), Hrac = new Hrac { HracId = reader.GetInt32(++i) }, Zapas = new Zapas { ZapasId = reader.GetInt32(++i) }, Gol = new Gol { GolId = reader.GetInt32(++i) } }; data.Add(asistence); } return(data); }
private void buttAssist_Click(object sender, EventArgs e) { int hrac = Int32.Parse(textAsistHrac.Text); Hrac h = new Hrac() { HracId = hrac }; Asistence a = new Asistence() { Hrac = h }; z.ZapisAsistenci(a); textAsistHrac.Text = ""; }
public int Insert(Asistence a) { using (db.GetConnection()) { db.Connect(); OracleCommand command = db.CreateCommand(insert); command.Parameters.AddWithValue(":Hrac", a.Hrac.HracId); var zap = new ZapasyTable(); int maximumZ = zap.PosledniZapas(); command.Parameters.AddWithValue(":Zapas", maximumZ); //command.Parameters.AddWithValue(":Zapas", a.Zapas.ZapasId); var gol = new GolyTable(); int maximumG = gol.PosledniGol(); command.Parameters.AddWithValue(":Gol", maximumG); //command.Parameters.AddWithValue(":Gol", a.Gol.GolId); int ret = db.ExecuteNonQuery(command); return(ret); } }
public void Pridej(Asistence a) { }
public void ZapisAsistenci(Asistence a) { AsistenceTable asistenceTable = new AsistenceTable(); asistenceTable.Insert(a); }