예제 #1
0
        private void CargarLecturador()
        {
            DataTable dtL = new DataTable();
            neg_Lecturador_Servidor objL = new neg_Lecturador_Servidor();

            dtL = objL.Buscar_Todos();
            CargarComboBox(ref cmbLecturador, dtL, "Id");
        }
        private void mnuActualizar_Click(object sender, EventArgs e)
        {
            neg_Lecturador_Movil objLM = new neg_Lecturador_Movil();

            objLM.Actualizar(int.Parse(txtId.Text), txtNombre.Text, txtApellido.Text, txtTelefono.Text);

            neg_Lecturador_Servidor objLS = new neg_Lecturador_Servidor();

            objLS.Actualizar(int.Parse(txtId.Text), txtNombre.Text, txtApellido.Text, txtTelefono.Text);
        }
        private void mnuEliminar_Click(object sender, EventArgs e)
        {
            neg_Lecturador_Movil objLM = new neg_Lecturador_Movil();

            objLM.Eliminar(int.Parse(txtId.Text));

            neg_Lecturador_Servidor objLS = new neg_Lecturador_Servidor();

            objLS.Eliminar(int.Parse(txtId.Text));
        }
        private void mnuMostrarTodos_Click(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();

            //neg_Lecturador_Movil objL = new neg_Lecturador_Movil();

            neg_Lecturador_Servidor objL = new neg_Lecturador_Servidor();

            dt = objL.Buscar_Todos();
            dgvLecturador.DataSource = dt;
        }
        private void mnuBuscar_Click(object sender, EventArgs e)
        {
            DataTable dt;

            //neg_Lecturador_Movil objL = new neg_Lecturador_Movil();

            neg_Lecturador_Servidor objL = new neg_Lecturador_Servidor();

            dt = objL.Buscar(int.Parse(txtId.Text));
            if (dt.Rows.Count < 1)
            {
                txtId.Text       = "";
                txtNombre.Text   = "";
                txtApellido.Text = "";
                txtTelefono.Text = "";
            }
            else
            {
                txtId.Text       = dt.Rows[0]["Id"].ToString();
                txtNombre.Text   = dt.Rows[0]["Nombre"].ToString();
                txtApellido.Text = dt.Rows[0]["Apellido"].ToString();
                txtTelefono.Text = dt.Rows[0]["Telefono"].ToString();
            }
        }