Esempio n. 1
0
        public int Insert(Gol g)
        {
            using (db.GetConnection())
            {
                db.Connect();
                OracleCommand command = db.CreateCommand(insert);
                command.Parameters.AddWithValue(":Hrac", g.Hrac.HracId);

                var zap     = new ZapasyTable();
                int maximum = zap.PosledniZapas();
                command.Parameters.AddWithValue(":Zapas", maximum);

                //command.Parameters.AddWithValue(":Zapas", g.Zapas.ZapasId);

                int ret = db.ExecuteNonQuery(command);
                return(ret);
            }
        }
Esempio n. 2
0
        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);
            }
        }