public int Update(Products aProducts) { using (SqlConnection connection = new SqlConnection(this.connection)) { SqlCommand cmd = new SqlCommand("spProducts", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@productId", SqlDbType.Int).Value = aProducts.id; cmd.Parameters.Add("@productName", SqlDbType.VarChar).Value = aProducts.products; cmd.Parameters.Add("@Type", SqlDbType.Int).Value = 1; connection.Open(); result = cmd.ExecuteNonQuery(); connection.Close(); return result; } }
public int Update(Products aProducts) { return aProductGateway.Update(aProducts); }
public int Insert(Products aProducts) { return aProductGateway.Insert(aProducts); }