public bool eliminarRegistro(eCAMBIO_DETALLE oeCAMBIO_DETALLE) { using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString())) { string sp = "pa_crud_CAMBIO_DETALLE_eliminarRegistro"; SqlCommand cmd = new SqlCommand(sp, cnn); cmd.CommandType = CommandType.StoredProcedure; cnn.Open(); cmd.Parameters.Add(new SqlParameter("@CAM_NUMERO", oeCAMBIO_DETALLE.CAM_numero)); cmd.Parameters.Add(new SqlParameter("@PRO_CODIGO", oeCAMBIO_DETALLE.PRO_codigo)); return(cmd.ExecuteNonQuery() > 0); } }
public DataTable obtenerRegistro(eCAMBIO_DETALLE oeCAMBIO_DETALLE) { using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString())) { string sp = "pa_crud_CAMBIO_DETALLE_obtenerRegistro"; SqlCommand cmd = new SqlCommand(sp, cnn); cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter dad = new SqlDataAdapter(cmd); dad.SelectCommand.Parameters.Add(new SqlParameter("@CAM_NUMERO", oeCAMBIO_DETALLE.CAM_numero)); dad.SelectCommand.Parameters.Add(new SqlParameter("@PRO_CODIGO", oeCAMBIO_DETALLE.PRO_codigo)); DataTable dt = new DataTable(); dad.Fill(dt); return(dt); } }
public bool actualizarRegistro(eCAMBIO_DETALLE oeCAMBIO_DETALLE) { using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString())) { string sp = "pa_crud_CAMBIO_DETALLE_actualizarRegistro"; SqlCommand cmd = new SqlCommand(sp, cnn); cmd.CommandType = CommandType.StoredProcedure; cnn.Open(); cmd.Parameters.Add(new SqlParameter("@CAM_NUMERO", oeCAMBIO_DETALLE.CAM_numero)); //variable tipo:int cmd.Parameters.Add(new SqlParameter("@PRO_CODIGO", oeCAMBIO_DETALLE.PRO_codigo)); //variable tipo:string cmd.Parameters.Add(new SqlParameter("@DCA_CANTIDAD", oeCAMBIO_DETALLE.DCA_cantidad)); //variable tipo:int cmd.Parameters.Add(new SqlParameter("@DCA_CANTIDAD_SUBMULTIPLO", oeCAMBIO_DETALLE.DCA_cantidad_submultiplo)); //variable tipo:int cmd.Parameters.Add(new SqlParameter("@DCA_PRECIO_UNITARIO", oeCAMBIO_DETALLE.DCA_precio_unitario)); //variable tipo:double cmd.Parameters.Add(new SqlParameter("@DCA_MONTO_SUBTOTAL", oeCAMBIO_DETALLE.DCA_monto_subtotal)); //variable tipo:double cmd.Parameters.Add(new SqlParameter("@DCA_MONTO_IGV", oeCAMBIO_DETALLE.DCA_monto_igv)); //variable tipo:double cmd.Parameters.Add(new SqlParameter("@DCA_MONTO_ISC", oeCAMBIO_DETALLE.DCA_monto_isc)); //variable tipo:double cmd.Parameters.Add(new SqlParameter("@DCA_MONTO_TOTAL", oeCAMBIO_DETALLE.DCA_monto_total)); //variable tipo:double return(cmd.ExecuteNonQuery() > 0); } }