你的位置:首页 > 软件开发 > ASP.net > NopCommerce定制系列(3)

NopCommerce定制系列(3)

发布时间:2016-07-22 12:00:09
Nop版本3.7。  Nop里的地址为 国家-> 省份。现在需要修改为 省份-> 城市-> 地区-> 街道。关于直辖市的话,由于只有三级,参考淘宝,即 北京 -> 北京 -> 地区 ->街道。 一:添加表添加城市(City)、地区(D ...

NopCommerce定制系列(3)

Nop版本3.7。  

Nop里的地址为 国家-> 省份。现在需要修改为 省份-> 城市-> 地区-> 街道。

关于直辖市的话,由于只有三级,参考淘宝,即 北京 -> 北京 -> 地区 ->街道。

 

一:添加表

添加城市(City)、地区(District)、街道(Street)表。

City 表结构如下,地区、街道表与 City 基本一致。可以参考 国家、省份 做法。

using System.Collections.Generic;using Nop.Core.Domain.Localization;namespace Nop.Core.Domain.Directory{  /// <summary>  /// Represents a city  /// </summary>  public partial class City : BaseEntity, ILocalizedEntity  {    private ICollection<District> _districts;    /// <summary>    /// Gets or sets the StateProvince identifier    /// </summary>    public int StateProvinceId { get; set; }    /// <summary>    /// Gets or sets the name    /// </summary>    public string Name { get; set; }    /// <summary>    /// Gets or sets the abbreviation    /// </summary>    public string Abbreviation { get; set; }    /// <summary>    /// Gets or sets the zip    /// </summary>    public int Zip { get; set; }    /// <summary>    /// Gets or sets a value indicating whether the entity is published    /// </summary>    public bool Published { get; set; }    /// <summary>    /// Gets or sets the display order    /// </summary>    public int DisplayOrder { get; set; }    /// <summary>    /// Gets or sets the StateProvince    /// </summary>    public virtual StateProvince StateProvince { get; set; }    /// <summary>    /// Gets or sets the district    /// </summary>    public virtual ICollection<District> Districts    {      get { return _districts ?? (_districts = new List<District>()); }      protected set { _districts = value; }    }  }}

原标题:NopCommerce定制系列(3)

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

可能感兴趣文章

我的浏览记录