private void Guardar()
        {
            modalidadesDTO        = new ModalidadesDTO();
            modalidadesDTO.nombre = txtnombre.Text;
            modalidadesDAO        = new ModalidadesDAO(modalidadesDTO);

            modalidadesDAO.GuardarModalidad();
            MessageBox.Show("Modalidad guardada correctamente", "Mensaje");
        }
        private void Listar()
        {
            modalidadesDTO        = new ModalidadesDTO();
            modalidadesDTO.opcion = 0;
            modalidadesDAO        = new ModalidadesDAO(modalidadesDTO);

            Dtt = new DataTable();
            Dtt = modalidadesDAO.Listar();
            if (Dtt.Rows.Count > 0)
            {
                dtmodalidades.DataSource = Dtt;
            }
        }
Пример #3
0
        private void ListarModalidades()
        {
            modalidadesDTO        = new ModalidadesDTO();
            modalidadesDTO.opcion = 0;
            modalidadesDAO        = new ModalidadesDAO(modalidadesDTO);

            Dtt = new DataTable();
            Dtt = modalidadesDAO.Listar();
            if (Dtt.Rows.Count > 0)
            {
                cmbmodalidades.DataSource = Dtt;

                DataRow dataRow = Dtt.NewRow();
                dataRow["nombre"] = "Seleccione";
                Dtt.Rows.InsertAt(dataRow, 0);

                cmbmodalidades.DisplayMember = "nombre";
                cmbmodalidades.ValueMember   = "id";
            }
        }