private void _btnInput_Click(object sender, EventArgs e) { DeviceExpense item = new DeviceExpense() { Money = _txtMoneyInput.ToPrice(), Name = _txtNoteInput.Text, Type = Constant.Expense.Input, DateTime = DateTime.Now, }; DeviceExpenseRepository.Instance.Insert(item); ModelHelper.InputMoney(item.Money); ReloadData(); }
public static void OutputMoney(long money, string text = "") { if (!string.IsNullOrWhiteSpace(text)) { DeviceExpense item = new DeviceExpense() { Money = money, Name = text, ExpenseType = ExpenseType.Product, Type = Constant.Expense.Output, DateTime = DateTime.Now, BeforMoney = CurrentDevice.Money, }; DeviceExpenseRepository.Instance.Insert(item); } CurrentDevice.Money -= money; UpdateDevice(); }