且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在ASP.NET中的详细页面中显示产品变化

更新时间:2023-10-07 15:56:10

通常,此操作由创建属性,产品类型然后是产品的层次结构来管理,顺序是自下而上。

Usually this is managed by the hierarchy of creating attributes, product types and then products, in that order bottom up.

属性处于离散级别。因此,您具有数字,字符串,列表或布尔类型的属性。例如。大小是一个属性,它是字符串值(S,M,L,XL等)的列表。与颜色相同。年龄可以是数字属性。

Attributes are at the discrete level. So you have numeric, string, list or Boolean kind of attributes. E.g. Size is an attribute, that is a list of String values (S,M,L,XL etc). Same with Color. Age can be a numeric attribute.

现在,您可以构建产品类型,以表示产品类型。例如。产品类型可以是 T恤。现在,您可以将属性与此产品类型关联。说出尺寸和颜色。

Now you can build product types, that represent what kind of product it is. E.g. a product type can be "T-Shirt". Now you can associate attributes with this product type. Say size and color.

要创建产品时,让管理员选择产品类型。使用它们,向他们展示并让他们配置将在产品上拥有的属性。因此,如果他们选择T恤产品类型,他们将能够选择颜色和尺寸值(因为它们是列表)。

When you want to create product, let admin choose product type. Using that, show them and let them configure the attributes they will have on the product. So if they choose T shirt product type, they will be able to choose values for Color and Size (since those are lists).

因此,如果要更新产品输入年龄属性并添加年龄属性,即可轻松实现。然后,所有使用该产品类型的产品都将开始显示Age作为另一个属性。而且年龄是数字,您可以向客户显示文本框以接受该字段的值。

So if you want to update the product type and add age attribute to it, you can do so easily. And then all products that use that product type will start showing Age as another attribute. And Age being numeric, you can show text box to customers for accepting value for that field.

希望这会有所帮助!