示例#1
0
        private void btnVisualizar_Click(object sender, EventArgs e)
        {
            try
            {
                vw_emprestimo_locatario locatario = dgvEmprestimo.CurrentRow.DataBoundItem as vw_emprestimo_locatario;

                frmCadastrar frm = new frmCadastrar();
                frm.PreencherCampos(locatario.id_emprestimo);
                ((frmPrincipal)this.ParentForm).CarregarPanel(frm);
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("Referência de objeto não definida para uma instância de um objeto"))
                {
                    MessageBox.Show("Selecione um emprestimo!", "Biblioteca", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
示例#2
0
        private void btnRemover_Click(object sender, EventArgs e)
        {
            try
            {
                vw_emprestimo_locatario locatario = dgvEmprestimo.CurrentRow.DataBoundItem as vw_emprestimo_locatario;

                EmprestimoBusiness business = new EmprestimoBusiness();
                business.RemoverEmprestimo(locatario.id_emprestimo);

                MessageBox.Show("Emprestimo removido com sucesso!", "Biblioteca", MessageBoxButtons.OK, MessageBoxIcon.Information);
                CarregarGrid();
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("Referência de objeto não definida para uma instância de um objeto"))
                {
                    MessageBox.Show("Selecione um emprestimo!", "Biblioteca", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
示例#3
0
 private void PreencherDados(int idLocatario)
 {
     AzureBiblioteca         db  = new AzureBiblioteca();
     vw_emprestimo_locatario loc = db.vw_emprestimo_locatario.Where(x => x.id_emprestimo == idLocatario).ToList().Single();
 }