//Add money to the account private void button4_Click(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(AddMBox.Text) && !string.IsNullOrWhiteSpace(textBox4.Text)) { string accID = AddMBox.Text; if (redis.Get($"account:{accID}:holder") != null) { if (Encoding.UTF8.GetString(redis.Get($"account:{accID}:holder")) == UserSession.GetUser().ID) { label11.Text = UserSession.GetUser().ID; SetBalanceInfo(accID); ShowAccounts(); textBox3.Text = AddMBox.Text; } else { label11.Text = AddMBox.Text + "Is not your account"; } } else { label11.Text = "Account doesn't exist"; } } }
private static string GetRedisValue(IRedisNativeClient client, string key) { var redisValue = client.Get(key); return(redisValue != null ? Encoding.UTF8.GetString(redisValue) : "no found"); }