Example #1
0
        public void addCash(string label, double price, double tax)
        {
            double toCashbox = price + (tax / 100) * price;

            cashbox.addToCash(price, tax);
            CashboxForm form = new CashboxForm(label, toCashbox);

            form.ShowDialog();
        }
Example #2
0
        private void Register_Click(object sender, EventArgs e)
        {
            if (CheckInput())
            {
                User user = new User((_idCount + 1), LoginBox.Text);

                using (StreamWriter sw = new StreamWriter(_dbPath + "users.txt", true, Encoding.Default))
                {
                    sw.WriteLine($"{user.Id} {user.Username} {PasswordBox.Text}");
                }

                using (StreamWriter sw = new StreamWriter($"{_dbPath}countofusers.txt", false, Encoding.Default))
                {
                    sw.Write(_idCount + 1);
                }

                this.Hide();
                CashboxForm cashboxForm = new CashboxForm(user);

                cashboxForm.Show();
            }
        }