Ejemplo n.º 1
0
        public BankAccountsVO getAccountInfo(int _id)
        {
            BankAccountsVO _newBankAccVo = new BankAccountsVO();
            DataTable      dataTable     = new DataTable();

            try
            {
                dataTable = _accountDAO.searchByIdAcc(_id);
                foreach (DataRow dr in dataTable.Rows)
                {
                    _newBankAccVo.idAcc    = Int32.Parse(dr["idAcc"].ToString());
                    _newBankAccVo.idClient = Int32.Parse(dr["idClient"].ToString());
                    _newBankAccVo.type     = dr["Type"].ToString();
                    _newBankAccVo.amount   = Int32.Parse(dr["Amount of money"].ToString());
                    _newBankAccVo.date     = DateTime.Parse(dr["Date_Created"].ToString());
                }
            }
            catch (NullReferenceException e)
            {
                Console.Write("Error:", e.ToString());
                Console.ReadLine();
            }

            return(_newBankAccVo);
        }
Ejemplo n.º 2
0
        //Panel Read-Delete
        private void buttonSubCAccReadDel_Click(object sender, EventArgs e)
        {
            int _id;

            _id = Int32.Parse(this.textBoxCAccReadDel.Text);
            if (this.comboBoxCAccOp.Text == "Read")
            {
                this.dataGridClientsAcc.DataSource = _bankAccDAO.searchByIdAcc(_id);
            }
            if (this.comboBoxCAccOp.Text == "Delete")
            {
                _bankAccDAO.deleteByID(_id);
                this.refreshGrid();
            }
            this.ClearPanels();
        }