private void LoadWallet() { WalletRepo repo = new WalletRepo(); grdWallets.DataSource = null; grdWallets.DataSource = repo.GetWallet(); }
private void LoadInOut(int id) { WalletRepo repo = new WalletRepo(); grdIncomeOutcome.DataSource = null; grdIncomeOutcome.DataSource = repo.GetWalletInOut(id); }
private void PopulateType() { WalletRepo repo = new WalletRepo(); CmbType.DisplayMember = "TypeName"; CmbType.ValueMember = "Id"; CmbType.DataSource = repo.GetTypes(); LoadWallet(); }
private void PopulateAmountType() { WalletRepo repo = new WalletRepo(); cmbAmountType.DisplayMember = "TypeAmount"; cmbAmountType.ValueMember = "Id"; cmbAmountType.DataSource = repo.GetAmountTypes(); LoadWallet(); }
private void btnInsert_Click(object sender, EventArgs e) { Wallet wallet = new Wallet(); wallet.Description = txtDescription.Text; wallet.MinPlus = (int)cmbAmountType.SelectedValue; wallet.Amount = int.Parse(txtAmount.Text); wallet.Type = (int)CmbType.SelectedValue; WalletRepo repo = new WalletRepo(); repo.AddWallet(wallet); LoadWallet(); GetBalance(); }
private void btnShow_Click(object sender, EventArgs e) { string value = null; if (rbIncoming.Checked) { value = "1".ToString(); LoadInOut(1); } if (rbOutgoing.Checked) { value = "2".ToString(); LoadInOut(2); } WalletRepo wallet = new WalletRepo(); var list = wallet.GetDescriptionOfAmountType((Convert.ToInt32(value))); }