コード例 #1
0
        public override void AddData()
        {
            EmprestimoDialog dialog = new EmprestimoDialog();
            dialog.Emprestimo = new Emprestimo();

            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                _repository.RegistrarNovoEmprestimo(dialog.Emprestimo);

                _control.RefreshGrid();
            }
        }
コード例 #2
0
        public override void UpdateData()
        {
            EmprestimoDialog dialog = new EmprestimoDialog();

            dialog.Emprestimo = _control.GetEmprestimo();

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                Emprestimo d = dialog.Emprestimo;

                _repository.AtualizarEmprestimo(d);

                _control.RefreshGrid();
            }
        }