private void ShowRepayForm() { var repayForm = new RepayForm(this.user.Money); var result = this.ShowMultiThreadDialog(repayForm); if (result == DialogResult.OK) { // 部分返済 if (repayForm.RepayPartial) { var repayPartialForm = new RepayPartialOrChargeForm(this.user.Money); result = this.ShowMultiThreadDialog(repayPartialForm); if (result == DialogResult.OK) { if (this.db.RepayOrChargeMoney(this.user.Uid, repayPartialForm.RepayMoney)) { this.user.Money += repayPartialForm.RepayMoney; this.UpdateGUI(); } else { MessageBox.Show("返済に失敗しました。"); } } } // 全額返済 else { if (this.db.RepayOrChargeMoney(this.user.Uid, Math.Abs(this.user.Money))) { this.user.Money = 0; this.UpdateGUI(); } else { MessageBox.Show("返済に失敗しました。"); } } } }
private void ShowChargeForm() { // チャージ var repayPartialForm = new RepayPartialOrChargeForm(); var result = this.ShowMultiThreadDialog(repayPartialForm); if (result == DialogResult.OK) { if (this.db.RepayOrChargeMoney(this.user.Uid, repayPartialForm.RepayMoney)) { this.user.Money += repayPartialForm.RepayMoney; this.UpdateGUI(); } else { MessageBox.Show("チャージに失敗しました。"); } } }