using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace JtkManagerClient {
    public partial class GuestAddForm : Form {
        public double Cash { get; private set; } = 0.0;
        public GuestAddForm() {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e) {
            if (double.TryParse(cashTextBox.Text, out var cash) && cash > 0.0) {
                Cash = cash;
                DialogResult = DialogResult.OK;
                Close();
            } else {
                MessageBox.Show("올바른 값을 입력하세요!", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }

        private void GuestAddForm_FormClosing(object sender, FormClosingEventArgs e) {
            if (e.CloseReason == CloseReason.None) {
                e.Cancel = true;
            }
        }

        private void button2_Click(object sender, EventArgs e) {
            Close();
        }
    }
}
