Ejemplo n.º 1
0
        private void cmd_Consultar_Click(object sender, EventArgs e)
        {
            NavioService navioService = new NavioService();
            List <Navio> navios       = new List <Navio>();

            if (txt_navio.Text == "" &&
                checkBox_todos.Checked == false)
            {
                MessageBox.Show("No se cargó ningún dato", "importante", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                txt_navio.Focus();
            }

            if (txt_navio.Text != "" &&
                checkBox_todos.Checked == false)
            {
                navios = navioService.GetByName(txt_navio.Text);
                if (navios.Count == 0)
                {
                    MessageBox.Show("No se encontró ningún navío con ese nombre.");
                }
            }

            if (checkBox_todos.Checked == true)
            {
                navios = navioService.GetAll();
            }
            cargar_grilla(navios);
        }
Ejemplo n.º 2
0
 public DataTable tomarConfirmacionGenerarListado()
 {
     navios = navioService.GetAll();
     if (this.check)
     {
         return(this.generarListado());
     }
     else
     {
         if (this.idTipoNavio != 0)
         {
             this.filtrarNaviosPorTipo();
         }
         return(this.generarListado());
     }
 }