private void BtnDepositar_Click(object sender, EventArgs e)
        {
            // TODO: Validar identificacion dominicana.
            if (string.IsNullOrEmpty(txtIdentification.Text))
            {
                MessageBox.Show("Identificacion no valida", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (string.IsNullOrEmpty(txtNoCuenta.Text))
            {
                MessageBox.Show("Numero de cuenta de origen no valida.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (string.IsNullOrEmpty(txtNoCuentaDestino.Text))
            {
                MessageBox.Show("Numero de cuenta de destino no valida.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (string.IsNullOrEmpty(txtMontoaDepositar.Text) || txtMontoaDepositar.Text.Trim() == "0")
            {
                MessageBox.Show("Monto no valido", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            decimal amount = Convert.ToDecimal(txtMontoaDepositar.Text);

            var identificationType = radioIdentification.Checked ? IdentificationTypeEnum.Cedula : IdentificationTypeEnum.Passport;

            var transaction = new Transaction()
            {
                CasherId           = Settings.LoggedUser.Id,
                OriginAccount      = txtNoCuenta.Text,
                DestinyAccount     = txtNoCuentaDestino.Text,
                Identification     = txtIdentification.Text,
                IdentificationType = identificationType,
                Amount             = amount,
                TransactionType    = TransactionTypeEnum.Deposit
            };

            _cashService.Deposit(transaction, frmDepositDto);

            FrmHome home = new FrmHome();

            home.Show();
            this.Hide();
        }
Example #2
0
        private void btnRetirar_Click(object sender, EventArgs e)
        {
            if (SelectedTransaction != null)
            {
                if (SelectedTransaction.TransactionType == TransactionTypeEnum.Deposit)
                {
                    _cashService.Deposit(SelectedTransaction, null);
                }
                else
                {
                    _cashService.Retirement(SelectedTransaction, null);
                }

                Init();
            }
        }