private void txtb_cpf_Leave(object sender, EventArgs e) { string cpfSemMascara = service.preparaCPFparaBD(txtb_cpf.Text); var guest = guestController.retornaGuestCPF(cpfSemMascara); if (guest.gue_fk_room != null) { if (guest.gue_nome != null) { cpf = guest.gue_cpf; txtb_hospede.Text = guest.gue_nome; txtb_precoTotal.Text = "R$" + Convert.ToString(guest.gue_precoTotal); var room = roomController.retornaRoomID(guest.gue_fk_room); id_quarto = room.room_id; txtb_quarto.Text = room.room_numeroQuarto; rbtn_efetuado.Enabled = true; rbtn_pendente.Enabled = true; } else { rbtn_efetuado.Enabled = false; rbtn_pendente.Enabled = false; MessageBox.Show("Hóspede não encontrado"); } } else { MessageBox.Show("Hóspede não encontrado"); } }
private void btn_entrar_Click(object sender, EventArgs e) { string cpfSemMascara = service.preparaCPFparaBD(txtb_cpfGuest.Text); var guestRetornado = controller.retornaGuestCPF(cpfSemMascara); if (!string.IsNullOrEmpty(guestRetornado.gue_nome)) { StoreGuestScreen tela = new StoreGuestScreen(guestRetornado); this.Hide(); tela.ShowDialog(); } else { MessageBox.Show("CPF não identificado, inválido ou este hóspede não está vinculado à um quarto!!", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Error); } }