public void CreateCateProduct(CateProduct cateproduct) { using (SqlConnection connection = base.GetConnection()) { SqlCommand command = new SqlCommand("_CateProductUpdate", connection) { CommandType = CommandType.StoredProcedure }; command.Parameters.AddWithValue("@Type", 0); command.Parameters.AddWithValue("@CateProductID", 0); command.Parameters.AddWithValue("@ParentProductID", cateproduct.ParentProductID); command.Parameters.AddWithValue("@CateProductName", cateproduct.CateProductName); command.Parameters.AddWithValue("@CateProductTotal", cateproduct.CateProductTotal); command.Parameters.AddWithValue("@CateProductOrder", cateproduct.CateProductOrder); command.Parameters.AddWithValue("@Language", cateproduct.Language); command.Parameters.AddWithValue("@Icon", cateproduct.Icon); command.Parameters.AddWithValue("@Slogan", cateproduct.Slogan); connection.Open(); if (command.ExecuteNonQuery() <= 0) { throw new DataAccessException("Kh\x00f4ng thể tạo danh mục tin"); } command.Dispose(); } }
public void CreateCateNew(CateProduct cateProduct) { new CateProductDAO().CreateCateProduct(cateProduct); }
public void UpdateCateProduct(CateProduct cateProduct) { new CateProductDAO().UpdateCateProduct(cateProduct); }