protected void btn_sit_here_Click(object sender, EventArgs e) { HedgeemerrorPopup my_popup_message = new HedgeemerrorPopup(); my_popup_message.p_detailed_message_str = ""; my_popup_message.p_is_visible = false; //log event object is created //HedgeEmLogEvent my_log_event = new HedgeEmLogEvent(); xxx - this does not work Kiran/Simon - 25th March 2014 //my_log_event.p_method_name = "btn_sit_here_Click"; log.Info("btn_sit_here_Click of Cashier Page is called"); double acc_balance = 0; if (lbl_account_balance.Text != "") { acc_balance = Convert.ToDouble(lbl_account_balance.Text); } double amount_to_deposit = 0; if (txt_deposit.Text != "") { amount_to_deposit = Convert.ToDouble(txt_deposit.Text); } double final_player_balance = 0.0; try { if (amount_to_deposit <= 0) { lbl_msg.Visible = true; lbl_deposit_status.Text = "Enter the Amoount greater than 0"; lbl_deposit_status.Visible = true; } else { final_player_balance = acc_balance + amount_to_deposit; service.f_set_player_balance(playerid, final_player_balance); lbl_deposit_status.Text = "Deposited successfully"; lbl_deposit_status.Visible = true; lbl_account_balance.Text = Math.Round(service.f_get_player_account_balance(playerid), 2).ToString(); lbl_seat_balance.Text = Math.Round(service.f_get_player_seat_balance(tableid, 0, playerid), 2).ToString(); txt_deposit.Text = "0"; int xxx_my_HC_session_id_not_used_yet = 666999; int my_HC_seat_id = 0; HedgeEmGenericAcknowledgement my_generic_ack = new HedgeEmGenericAcknowledgement(); my_generic_ack = (HedgeEmGenericAcknowledgement)f_get_object_from_json_call_to_server("ws_sit_at_table_new/" + p_session_current_table_id + "," + 10 + "," + p_session_current_table_id + "," + p_session_current_seat_id + "," + p_session_player_id + "," + amount_to_deposit, typeof(HedgeEmGenericAcknowledgement)); if (my_generic_ack.p_error_message != null) { if (my_generic_ack.p_error_message != "") { throw new Exception(my_generic_ack.p_error_message); } } //my_log.p_message = String.Format("Successfully retrieved gamestate from server. Table ID [{0}], State [{1}]", _global_game_state_object.p_table_id, _global_game_state_object.p_current_state_enum.ToString()); //log.Debug(my_log.ToString()); } } catch (Exception ex) { //my_log_event.p_message = "Exception caught - " + ex.Message; //log.Error(_xxx_log_event.ToString()); string my_error_popup = "Error in btn_sit_here_Click of Cashier Page " + ex.Message.ToString(); //ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", my_error_popup, true); my_popup_message.p_detailed_message_str = my_error_popup.ToString(); Place_Holder_Popup_Message.Controls.Add(my_popup_message); log.Error("Error in btn_sit_here_Click of Cashier Page", new Exception(ex.Message)); } }
private void f_create_personal_hedgeem_table_for_player(int player_id, string username) { //HedgeEmLogEvent _xxx_log_event = new HedgeEmLogEvent(); //my_log_event.p_method_name = "f_create_personal_hedgeem_table_for_player"; log.Debug("f_create_personal_hedgeem_table_for_player is called"); try { // Define the parameters that you wish to set when you create this Hedge'Em table Double my_target_rtp = 97; int my_number_of_hands_to_be_played_at_this_table = 4; int my_number_of_seats_at_this_table = 1; int my_initial_investment = 10000; // xxx this value needs to be revisited. String my_table_name = ""; my_table_name = String.Format("{0}_Personal", username); bool my_is_jackpot_enabled = false; enum_theme my_default_theme = enum_theme.ONLINE; // See if a table exist for this test // _current_table_object_string = service.f_get_hedgeem_table_by_table_name(my_table_name); // If a table does NOT exist, create one // if (_current_table_object_string == "") { // Create a new table based on the simulation parameters defined above. //_current_table_object = (HedgeEMTable) int xxx_my_HC_session_id_not_used_yet = 666; int my_HC_seat_id = 0; int my_buy_in = Convert.ToInt32(25); HedgeEmTableSummary my_hedgeem_table_summary = new HedgeEmTableSummary(); my_hedgeem_table_summary = (HedgeEmTableSummary)f_get_object_from_json_call_to_server("ws_create_hedgeem_table/" + my_target_rtp + "," + my_number_of_hands_to_be_played_at_this_table + "," + my_number_of_seats_at_this_table + "," + my_initial_investment + "," + my_table_name + "," + my_is_jackpot_enabled + "," + my_default_theme + "," + (int)xxxHC_a_opening_balance + "," + player_id + "," + xxx_my_HC_session_id_not_used_yet + "," + my_HC_seat_id + "," + my_buy_in, typeof(HedgeEmTableSummary)); // service.f_create_table(my_target_rtp, // my_number_of_hands_to_be_played_at_this_table, // my_number_of_seats_at_this_table, // my_initial_investment, // my_table_name, // my_is_jackpot_enabled, // my_default_theme, (int)xxxHC_a_opening_balance, player_id, xxx_my_HC_session_id_not_used_yet, my_HC_seat_id, my_buy_in); int a_table_id = my_hedgeem_table_summary.p_table_id; HedgeEmGenericAcknowledgement my_generic_ack = new HedgeEmGenericAcknowledgement(); my_generic_ack = (HedgeEmGenericAcknowledgement)f_get_object_from_json_call_to_server("ws_sit_at_table/" + xxx_my_HC_session_id_not_used_yet + "," + 10 + "," + a_table_id + "," + my_HC_seat_id + "," + player_id, typeof(HedgeEmGenericAcknowledgement)); } } catch (Exception ex) { string my_error_popup = "alert('Error in method [f_create_personal_hedgeem_table_for_player] - " + ex.Message.ToString() + "');"; ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", my_error_popup, true); log.Error("Error in f_create_personal_hedgeem_table_for_player", new Exception(ex.Message)); //my_log_event.p_message = "Exception caught - " + ex.Message; //log.Error(_xxx_log_event.ToString()); } }
/// <summary> /// This should be renamed btn_leave_table_Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btn_leave_table_Click(object sender, EventArgs e) { // Create a 'log event' object to audit execution HedgeEmLogEvent my_log_event = new HedgeEmLogEvent(); my_log_event.p_method_name = System.Reflection.MethodBase.GetCurrentMethod().ToString(); my_log_event.p_message = "Method Entered."; my_log_event.p_player_id = p_session_player_id; my_log_event.p_table_id = p_session_personal_table_id; log.Debug(my_log_event.ToString()); HedgeEmGenericAcknowledgement my_generic_ack = new HedgeEmGenericAcknowledgement(); my_generic_ack = (HedgeEmGenericAcknowledgement)f_get_object_from_json_call_to_server("ws_leave_table/" + p_session_current_table_id + "," + 10 + "," + p_session_current_table_id + "," + p_session_current_seat_id + "," + p_session_player_id, typeof(HedgeEmGenericAcknowledgement)); if (my_generic_ack.p_error_message != null) { if (my_generic_ack.p_error_message != "") { throw new Exception(my_generic_ack.p_error_message); } } Response.Redirect("frm_facebook_canvas.aspx?signout=true"); //log.Warn("This should call server leave table function"); }