public bool eliminarRegistro(eALMACEN oeALMACEN) { using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString())) { string sp = "pa_crud_ALMACEN_eliminarRegistro"; SqlCommand cmd = new SqlCommand(sp, cnn); cmd.CommandType = CommandType.StoredProcedure; cnn.Open(); cmd.Parameters.Add(new SqlParameter("@ALM_CODIGO", oeALMACEN.ALM_codigo)); return(cmd.ExecuteNonQuery() > 0); } }
public DataTable obtenerRegistro(eALMACEN oeALMACEN) { using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString())) { string sp = "pa_crud_ALMACEN_obtenerRegistro"; SqlCommand cmd = new SqlCommand(sp, cnn); cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter dad = new SqlDataAdapter(cmd); dad.SelectCommand.Parameters.Add(new SqlParameter("@ALM_CODIGO", oeALMACEN.ALM_codigo)); DataTable dt = new DataTable(); dad.Fill(dt); return(dt); } }
public bool actualizarRegistro(eALMACEN oeALMACEN) { using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString())) { string sp = "pa_crud_ALMACEN_actualizarRegistro"; SqlCommand cmd = new SqlCommand(sp, cnn); cmd.CommandType = CommandType.StoredProcedure; cnn.Open(); cmd.Parameters.Add(new SqlParameter("@ALM_CODIGO", oeALMACEN.ALM_codigo)); //variable tipo:string cmd.Parameters.Add(new SqlParameter("@ALM_NOMBRE", oeALMACEN.ALM_nombre)); //variable tipo:string cmd.Parameters.Add(new SqlParameter("@ALM_DESCRIPCION", (object)oeALMACEN.ALM_descripcion ?? DBNull.Value)); //variable tipo:string return(cmd.ExecuteNonQuery() > 0); } }