示例#1
0
 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;    
     }
 }
示例#2
0
 public int Update(Products aProducts)
 {
     return aProductGateway.Update(aProducts);
 }
示例#3
0
 public int Insert(Products aProducts)
 {
     return aProductGateway.Insert(aProducts);
 }