Esempio n. 1
0
        private void BtnEmprestar_Click(object sender, EventArgs e)
        {
            try
            {
                List <string> lista = new List <string>();

                foreach (DataGridViewRow row in gridChavesReserva.Rows)
                {
                    lista.Add(row.Cells[2].Value.ToString());
                }

                CadastrarEmprestimo emprestimo = new CadastrarEmprestimo(usuario, gridReserva.CurrentRow.Cells[0].Value.ToString(),
                                                                         lista);
                emprestimo.ShowDialog();

                atualizarGrid();
            }
            catch
            {
                Message msg = new Message("Opção indisponível no momento! Tente novamente mais tarde.",
                                          "Erro", "erro", "confirma");

                msg.ShowDialog();
            }
        }
Esempio n. 2
0
 private void BtnEmprestar_Click(object sender, EventArgs e)
 {
     if (emprestimo.Text == "N/A")
     {
         CadastrarEmprestimo cadastrarEmp = new CadastrarEmprestimo(usuario, new List <string> {
             gridChaves.CurrentRow.Cells[5].Value.ToString()
         });
         cadastrarEmp.ShowDialog();
         atualizarGridChaves();
     }
     else
     {
         DevolverChave devolucao = new DevolverChave(emprestimo.Text, usuario);
         devolucao.ShowDialog();
         atualizarGridChaves();
     }
 }