Пример #1
0
        private void LoadWallet()
        {
            WalletRepo repo = new WalletRepo();

            grdWallets.DataSource = null;
            grdWallets.DataSource = repo.GetWallet();
        }
Пример #2
0
        private void LoadInOut(int id)
        {
            WalletRepo repo = new WalletRepo();

            grdIncomeOutcome.DataSource = null;
            grdIncomeOutcome.DataSource = repo.GetWalletInOut(id);
        }
Пример #3
0
        private void PopulateType()
        {
            WalletRepo repo = new WalletRepo();

            CmbType.DisplayMember = "TypeName";
            CmbType.ValueMember   = "Id";
            CmbType.DataSource    = repo.GetTypes();
            LoadWallet();
        }
Пример #4
0
        private void PopulateAmountType()
        {
            WalletRepo repo = new WalletRepo();

            cmbAmountType.DisplayMember = "TypeAmount";
            cmbAmountType.ValueMember   = "Id";
            cmbAmountType.DataSource    = repo.GetAmountTypes();
            LoadWallet();
        }
Пример #5
0
        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();
        }
Пример #6
0
        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)));
        }