示例#1
0
        private void btnSalvarEmprestimo_Click(object sender, EventArgs e)
        {
            try
            {
                FormEmprestimoToObject();

                if (_emprestimo.Id == 0)
                {
                    _emprestimoService.AddEmprestimo(_emprestimo);
                    LimparCampos();
                }
                else
                {
                    _emprestimoService.UpdateEmprestimo(_emprestimo);
                    LimparCampos();
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            tabBiblioteca.SelectedIndex = 3;
            LimparCampos();
        }