Skip to content

Commit

Permalink
Domain
Browse files Browse the repository at this point in the history
  • Loading branch information
491134648 committed Aug 13, 2015
1 parent d9be5c7 commit e5846f8
Show file tree
Hide file tree
Showing 112 changed files with 5,982 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Farmer.Core/BaseEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public abstract class BaseEntity
/// <summary>
/// Gets or sets the entity identifier
/// </summary>
public string Id { get; set; }
public Guid Id { get; set; }
/// <summary>
/// 是否删除
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Farmer.Core/Domain/Customer/RewardPointsHistory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public partial class RewardPointsHistory : BaseEntity
/// <summary>
/// Gets or sets the customer identifier
/// </summary>
public string CustomerId { get; set; }
public Guid CustomerId { get; set; }

/// <summary>
/// Gets or sets the points redeemed/added
Expand Down
83 changes: 83 additions & 0 deletions Farmer.Core/Domain/Directory/Country.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
using System.Collections.Generic;

namespace Farmer.Core.Domain
{
/// <summary>
/// Represents a country
/// </summary>
public partial class Country : BaseEntity, ILocalizedEntity, IStoreMappingSupported
{
private ICollection<StateProvince> _stateProvinces;
private ICollection<ShippingMethod> _restrictedShippingMethods;


/// <summary>
/// Gets or sets the name
/// </summary>
public string Name { get; set; }

/// <summary>
///ÔÊÐíÕ˵¥
/// </summary>
public bool AllowsBilling { get; set; }

/// <summary>
/// ÔÊÐíÅäËÍ
/// </summary>
public bool AllowsShipping { get; set; }

/// <summary>
/// Gets or sets the two letter ISO code
/// </summary>
public string TwoLetterIsoCode { get; set; }

/// <summary>
/// Gets or sets the three letter ISO code
/// </summary>
public string ThreeLetterIsoCode { get; set; }

/// <summary>
/// Gets or sets the numeric ISO code
/// </summary>
public int NumericIsoCode { get; set; }

/// <summary>
/// Gets or sets a value indicating whether customers in this country must be charged EU VAT
/// </summary>
public bool SubjectToVat { 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 a value indicating whether the entity is limited/restricted to certain stores
/// </summary>
public bool LimitedToStores { get; set; }

/// <summary>
/// Gets or sets the state/provinces
/// </summary>
public virtual ICollection<StateProvince> StateProvinces
{
get { return _stateProvinces ?? (_stateProvinces = new List<StateProvince>()); }
protected set { _stateProvinces = value; }
}

/// <summary>
/// Gets or sets the restricted shipping methods
/// </summary>
public virtual ICollection<ShippingMethod> RestrictedShippingMethods
{
get { return _restrictedShippingMethods ?? (_restrictedShippingMethods = new List<ShippingMethod>()); }
protected set { _restrictedShippingMethods = value; }
}
}

}
55 changes: 55 additions & 0 deletions Farmer.Core/Domain/Directory/Currency.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System;
namespace Farmer.Core.Domain
{
/// <summary>
/// Represents a currency
/// </summary>
public partial class Currency : BaseEntity, ILocalizedEntity, IStoreMappingSupported
{
/// <summary>
/// Gets or sets the name
/// </summary>
public string Name { get; set; }

/// <summary>
/// 当前代码
/// </summary>
public string CurrencyCode { get; set; }

/// <summary>
///汇率
/// </summary>
public decimal Rate { get; set; }

/// <summary>
/// 本地显示
/// </summary>
public string DisplayLocale { get; set; }

/// <summary>
/// 自定义格式
/// </summary>
public string CustomFormatting { get; set; }

/// <summary>
/// 是否店铺限制
/// </summary>
public bool LimitedToStores { 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 date and time of instance update
/// </summary>
public DateTime UpdatedOn { get; set; }
}

}
13 changes: 13 additions & 0 deletions Farmer.Core/Domain/Directory/CurrencySettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

namespace Farmer.Core.Domain
{
public class CurrencySettings : ISettings
{
public bool DisplayCurrencyLabel { get; set; }
public int PrimaryStoreCurrencyId { get; set; }
public int PrimaryExchangeRateCurrencyId { get; set; }
public string ActiveExchangeRateProviderSystemName { get; set; }
public bool AutoUpdateEnabled { get; set; }
public long LastUpdateTime { get; set; }
}
}
45 changes: 45 additions & 0 deletions Farmer.Core/Domain/Directory/ExchangeRate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System;

namespace Nop.Core.Domain.Directory
{
/// <summary>
/// ½»Ò×»ãÂÊ
/// </summary>
public partial class ExchangeRate
{
/// <summary>
/// Creates a new instance of the ExchangeRate class
/// </summary>
public ExchangeRate()
{
CurrencyCode = string.Empty;
Rate = 1.0m;
}

/// <summary>
/// The three letter ISO code for the Exchange Rate, e.g. USD
/// </summary>
public string CurrencyCode { get; set; }

/// <summary>
/// The conversion rate of this currency from the base currency
/// </summary>
public decimal Rate { get; set; }

/// <summary>
/// When was this exchange rate updated from the data source (the internet data xml feed)
/// </summary>
public DateTime UpdatedOn { get; set; }


/// <summary>
/// Format the rate into a string with the currency code, e.g. "USD 0.72543"
/// </summary>
/// <returns></returns>
public override string ToString()
{
return string.Format("{0} {1}", this.CurrencyCode, this.Rate);
}
}

}
28 changes: 28 additions & 0 deletions Farmer.Core/Domain/Directory/MeasureDimension.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
namespace Farmer.Core.Domain
{
/// <summary>
/// 测量规格
/// </summary>
public partial class MeasureDimension : BaseEntity
{
/// <summary>
/// Gets or sets the name
/// </summary>
public string Name { get; set; }

/// <summary>
///系统官架子
/// </summary>
public string SystemKeyword { get; set; }

/// <summary>
/// 比率
/// </summary>
public decimal Ratio { get; set; }

/// <summary>
/// 显示排序
/// </summary>
public int DisplayOrder { get; set; }
}
}
14 changes: 14 additions & 0 deletions Farmer.Core/Domain/Directory/MeasureSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

using System;

namespace Farmer.Core.Domain
{
/// <summary>
/// 测量设定
/// </summary>
public class MeasureSettings : ISettings
{
public Guid BaseDimensionId { get; set; }
public Guid BaseWeightId { get; set; }
}
}
28 changes: 28 additions & 0 deletions Farmer.Core/Domain/Directory/MeasureWeight.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
namespace Farmer.Core.Domain
{
/// <summary>
/// ²âÁ¿ÖØÁ¿
/// </summary>
public partial class MeasureWeight : BaseEntity
{
/// <summary>
/// Gets or sets the name
/// </summary>
public string Name { get; set; }

/// <summary>
/// Gets or sets the system keyword
/// </summary>
public string SystemKeyword { get; set; }

/// <summary>
/// Gets or sets the ratio
/// </summary>
public decimal Ratio { get; set; }

/// <summary>
/// Gets or sets the display order
/// </summary>
public int DisplayOrder { get; set; }
}
}
42 changes: 42 additions & 0 deletions Farmer.Core/Domain/Directory/StateProvince.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

using System;

namespace Farmer.Core.Domain
{
/// <summary>
/// Represents a state/province
/// </summary>
public partial class StateProvince : BaseEntity, ILocalizedEntity
{
/// <summary>
/// Gets or sets the country identifier
/// </summary>
public Guid CountryId { 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 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 country
/// </summary>
public virtual Country Country { get; set; }
}

}
Loading

0 comments on commit e5846f8

Please sign in to comment.