public bool ConfirmWithdrawRMB(WithdrawRMBRecord record, CustomerMySqlTransaction trans) { MySqlCommand mycmd = null; try { string sqlText = "update withdrawrmbrecord set " + "`RMBWithdrawState` = @RMBWithdrawState, `AdminUserName` = @AdminUserName, `AlipayOrderNumber` = @AlipayOrderNumber, `PayTime` = @PayTime, `Message` = @Message " + " where id = @id "; mycmd = trans.CreateCommand(); mycmd.CommandText = sqlText; mycmd.Parameters.AddWithValue("@RMBWithdrawState", (int)record.State); mycmd.Parameters.AddWithValue("@AdminUserName", DESEncrypt.EncryptDES(record.AdminUserName)); mycmd.Parameters.AddWithValue("@AlipayOrderNumber", record.AlipayOrderNumber); mycmd.Parameters.AddWithValue("@PayTime", record.PayTime); mycmd.Parameters.AddWithValue("@Message", record.Message); mycmd.Parameters.AddWithValue("@id", record.id); mycmd.ExecuteNonQuery(); return(true); } finally { if (mycmd != null) { mycmd.Dispose(); } } }
void Client_OnSomebodyWithdrawRMB(WithdrawRMBRecord record) { lock (LockActiveRecords) { ListActiveWithdrawRecords.Add(new WithdrawRMBRecordUIModel(record)); } }
public void RaiseOnSomebodyWithdrawRMB(WithdrawRMBRecord record) { Action <WithdrawRMBRecord> handler = this.OnSomebodyWithdrawRMB; if (null != handler) { handler(record); } }
public WithdrawRMBRecord GetWithdrawRMBRecord(int state, string playerUserName, int withdrawRMB, DateTime createTime) { WithdrawRMBRecord record = null; MySqlConnection myconn = null; try { DataTable dt = new DataTable(); myconn = MyDBHelper.Instance.CreateConnection(); myconn.Open(); MySqlCommand mycmd = myconn.CreateCommand(); string sqlTextA = "select ttt.*, s.UserName as PlayerUserName from " + " (SELECT w.* " + " FROM withdrawrmbrecord w " + " where w.PlayerUserID = (select id from playersimpleinfo where UserName=@UserName ) and w.RMBWithdrawState = @RMBWithdrawState and w.WidthdrawRMB = @WidthdrawRMB and w.CreateTime = @CreateTime " + " ) ttt " + " left join playersimpleinfo s on ttt.PlayerUserID = s.id "; string encrypedUserName = DESEncrypt.EncryptDES(playerUserName); mycmd.Parameters.AddWithValue("@UserName", encrypedUserName); mycmd.Parameters.AddWithValue("@RMBWithdrawState", state); mycmd.Parameters.AddWithValue("@WidthdrawRMB", withdrawRMB); mycmd.Parameters.AddWithValue("@CreateTime", createTime); mycmd.CommandText = sqlTextA; MySqlDataAdapter adapter = new MySqlDataAdapter(mycmd); adapter.Fill(dt); if (dt != null) { var records = MetaDBAdapter <WithdrawRMBRecord> .GetWithdrawRMBRecordListFromDataTable(dt); if (records != null && records.Length != 0) { record = records[0]; } } dt.Clear(); dt.Dispose(); adapter.Dispose(); mycmd.Dispose(); return(record); } finally { MyDBHelper.Instance.DisposeConnection(myconn); } }
public WithdrawRMBRecord GetWithdrawRMBRecordByID(int id) { WithdrawRMBRecord record = null; MySqlConnection myconn = null; try { DataTable dt = new DataTable(); myconn = MyDBHelper.Instance.CreateConnection(); myconn.Open(); MySqlCommand mycmd = myconn.CreateCommand(); string sqlTextA = "select ttt.*, s.UserName as PlayerUserName from " + " (SELECT w.* " + " FROM withdrawrmbrecord w " + " where w.id = @id " + " ) ttt " + " left join playersimpleinfo s on ttt.PlayerUserID = s.id "; mycmd.Parameters.AddWithValue("@id", id); mycmd.CommandText = sqlTextA; MySqlDataAdapter adapter = new MySqlDataAdapter(mycmd); adapter.Fill(dt); if (dt != null) { var records = MetaDBAdapter <WithdrawRMBRecord> .GetWithdrawRMBRecordListFromDataTable(dt); if (records != null && records.Length != 0) { record = records[0]; } } dt.Clear(); dt.Dispose(); adapter.Dispose(); mycmd.Dispose(); return(record); } finally { MyDBHelper.Instance.DisposeConnection(myconn); } }
public bool AddWithdrawRMBRecord(WithdrawRMBRecord record, CustomerMySqlTransaction trans) { MySqlCommand mycmd = null; try { string sqlText = "insert into withdrawrmbrecord " + "(`PlayerUserID`, `AlipayAccount`, `AlipayRealName`, `WidthdrawRMB`, `ValueYuan`,`CreateTime`, `RMBWithdrawState`, `AdminUserName`, `PayTime`) " + " values (@PlayerUserID, @AlipayAccount, @AlipayRealName, @WidthdrawRMB, @ValueYuan, @CreateTime, @RMBWithdrawState, @AdminUserName, @PayTime)"; mycmd = trans.CreateCommand(); mycmd.CommandText = sqlText; mycmd.Parameters.AddWithValue("@PlayerUserID", record.PlayerUserID); mycmd.Parameters.AddWithValue("@AlipayAccount", DESEncrypt.EncryptDES(record.AlipayAccount)); mycmd.Parameters.AddWithValue("@AlipayRealName", DESEncrypt.EncryptDES(record.AlipayRealName)); mycmd.Parameters.AddWithValue("@WidthdrawRMB", record.WidthdrawRMB); mycmd.Parameters.AddWithValue("@ValueYuan", record.ValueYuan); mycmd.Parameters.AddWithValue("@CreateTime", record.CreateTime); mycmd.Parameters.AddWithValue("@RMBWithdrawState", RMBWithdrawState.Waiting); if (string.IsNullOrEmpty(record.AdminUserName)) { mycmd.Parameters.AddWithValue("@AdminUserName", DBNull.Value); } else { mycmd.Parameters.AddWithValue("@AdminUserName", DESEncrypt.EncryptDES(record.AdminUserName)); } if (record.PayTime == null || !record.PayTime.HasValue) { mycmd.Parameters.AddWithValue("@PayTime", DBNull.Value); } else { mycmd.Parameters.AddWithValue("@PayTime", record.PayTime); } mycmd.ExecuteNonQuery(); return(true); } finally { if (mycmd != null) { mycmd.Dispose(); } } }
public void SomebodyWithdrawRMB(string token, WithdrawRMBRecord record) { this.InvokeCallback(token, "SomebodyWithdrawRMB", record); }
public void PayWithdrawRMBRecord(WithdrawRMBRecord record) { this._invoker.Invoke <int>(this._context, "PayWithdrawRMBRecord", this.PayWithdrawRMBRecordCompleted, GlobalData.Token, record); }
public WithdrawRMBRecordUIModel(WithdrawRMBRecord parent) { this.ParentObject = parent; }