public override void UpdateContest(Contest t, int tid) { string insert = "UPDATE Contests SET Beginning=?beg,Ending=?end,Name=?name WHERE TID=?tid"; MySqlCommand comm = new MySqlCommand(insert, (MySqlConnection)conn); comm.Parameters.Add("?beg", t.Beginning.ToString("yyyy.MM.dd hh:mm:ss")); comm.Parameters.Add("?end", t.Ending.ToString("yyyy.MM.dd hh:mm:ss")); comm.Parameters.Add("?name", t.Name); comm.Parameters.Add("?tid", tid); MySqlTransaction trans = ((MySqlConnection)conn).BeginTransaction(IsolationLevel.ReadCommitted); comm.Transaction = trans; try { comm.ExecuteScalar(); trans.Commit(); } catch (MySqlException) { trans.Rollback(); } }
public abstract void UpdateContest(Contest t, int tid);
//ћетоды, относ¤щиес¤ к соревновани¤м public abstract int AddContest(Contest t);