void UpdatePrice(int session_game_group_game_id, int prize_id, long prize) { if (prize_data.Rows.Count == 0) { // no rows, this must be written as the default session value (even if it's a day override) save_default: dsn.ExecuteNonQuery("insert into " + Names.schedule_prefix + "price_schedule (prize_level_id,session_game_group_game_id,session_number,session_macro_id,amount,session_id) values (" + prize_id + "," + session_game_group_game_id + ",0" + "," + session_macro[SessionMacroTable.PrimaryKey] + "," + (int)(prize) + "," + session[SessionTable.PrimaryKey] + ")" ); } else { DataRow[] rows = prize_data.Select("prize_level_id=" + prize_id + " and session_game_group_game_id=" + session_game_group_game_id ); if (rows.Length == 0) { // no other information about this, again, save this as the default. dsn.ExecuteNonQuery("insert into " + Names.schedule_prefix + "price_schedule (prize_level_id,session_game_group_game_id,session_number,session_macro_id,amount,session_id) values (" + prize_id + "," + session_game_group_game_id + ",0" + "," + session_macro[SessionMacroTable.PrimaryKey] + "," + (int)(prize) + "," + session[SessionTable.PrimaryKey] + ")" ); } else { // need to evaluate what sort of infomration this is, and whether it's the same... if (checkBox1.Checked) { // specific session override.... if (rows[0]["session_prize"].GetType() == typeof(DBNull)) { dsn.ExecuteNonQuery("insert into " + Names.schedule_prefix + "price_schedule (prize_level_id,session_game_group_game_id,session_number,session_macro_id,amount,session_id) values (" + prize_id + "," + session_game_group_game_id + "," + session_macro_session[SessionDayMacroSessionTable.NumberColumn] + "," + session_macro[SessionMacroTable.PrimaryKey] + "," + (int)(prize) + "," + session[SessionTable.PrimaryKey] + ")" ); } else { if (day_of_week_type == 0) { if (rows[0]["day_prize"].GetType() == typeof(DBNull)) { } else { // already is a day override... dsn.ExecuteNonQuery("insert into " + Names.schedule_prefix + "price_schedule (prize_level_id,session_game_group_game_id,session_number,session_macro_id,amount,session_id) values (" + prize_id + "," + session_game_group_game_id + "," + session_macro_session[SessionDayMacroSessionTable.NumberColumn] + "," + session_macro[SessionMacroTable.PrimaryKey] + "," + (int)(prize) + "," + session[SessionTable.PrimaryKey] + ")" ); } } } } else { } } } }