Example #1
0
        private TiposDePiezasBLL recuperarInformacionAgregarTiposDePiezas()
        {
            TiposDePiezasBLL oTiposDePiezas = new TiposDePiezasBLL();

            oTiposDePiezas.Nombre = txtNombre.Text;

            return(oTiposDePiezas);
        }
Example #2
0
        private TiposDePiezasBLL recuperarInformacionTiposDePiezas()
        {
            TiposDePiezasBLL oTiposDePiezas = new TiposDePiezasBLL();

            oTiposDePiezas.Id     = Convert.ToInt32(lblIdTdP.Text);
            oTiposDePiezas.Nombre = txtNombre.Text;

            return(oTiposDePiezas);
        }
 public bool modificar(TiposDePiezasBLL oTiposDePiezas)
 {
     if (oTiposDePiezas.Nombre != "")
     {
         ModificacionDialogTrue oAgregadoDialog = new ModificacionDialogTrue();
         oAgregadoDialog.ShowDialog();
         return(conexion.ejecutarMetodoSinRetornoDatos("UPDATE PiezasTipos SET NOMBRE = '" + oTiposDePiezas.Nombre + "' WHERE Id =" + oTiposDePiezas.Id));
     }
     else
     {
         ModificacionDialogFalse oAgregadoDialog = new ModificacionDialogFalse();
         oAgregadoDialog.ShowDialog();
         return(false);
     }
 }
        //public bool agregar(TiposDePiezasBLL oTiposDePiezas)
        //{
        //    SqlCommand SQLComando = new SqlCommand("Insert into TiposDePiezas VALUES(@Nombre)");
        //    SQLComando.Parameters.Add("@Nombre", SqlDbType.VarChar).Value = oTiposDePiezas.Nombre;
        //    return conexion.ejecutarMetodoSinRetornoDatos(SQLComando);
        //}

        //public DataSet mostrarResultados()
        //{
        //    SqlCommand sentencia = new SqlCommand("SELECT * FROM PiezasTipos ORDER BY Nombre");
        //    return conexion.ejecutarSentencia(sentencia);
        //}

        //public int eliminar(TiposDePiezasBLL oTiposDePiezas)
        //{
        //    conexion.ejecutarMetodoSinRetornoDatos("DELETE FROM TiposDePiezas where Id = " + oTiposDePiezas.Id);

        //    return 1;
        //}

        //public bool modificar(TiposDePiezasBLL oTiposDePiezas)
        //{
        //    return conexion.ejecutarMetodoSinRetornoDatos("UPDATE TiposDePiezas SET NOMBRE = '" + oTiposDePiezas.Nombre + "' WHERE Id =" + oTiposDePiezas.Id);
        //}



        //Conexion mediante ACCES
        public bool agregar(TiposDePiezasBLL oTiposDePiezas)
        {
            if (oTiposDePiezas.Nombre != "")
            {
                OleDbCommand oleDbComando = new OleDbCommand("Insert into PiezasTipos (Nombre) VALUES(@Nombre)");
                oleDbComando.Parameters.AddWithValue("@Nombre", SqlDbType.VarChar).Value = oTiposDePiezas.Nombre;

                AgregadoDialogTrue oAgregadoDialog = new AgregadoDialogTrue();
                oAgregadoDialog.ShowDialog();

                return(conexion.ejecutarMetodoSinRetornoDatos(oleDbComando));
            }
            else
            {
                AgregadoDialogFalse oAgregadoDialog = new AgregadoDialogFalse();
                oAgregadoDialog.ShowDialog();
                return(false);
            }
        }
        public int eliminar(TiposDePiezasBLL oTiposDePiezas)
        {
            conexion.ejecutarMetodoSinRetornoDatos("DELETE FROM PiezasTipos where Id = " + oTiposDePiezas.Id);

            return(1);
        }