nopcommerce中文包汉化怎么做

AclRecord-权限记录表
EntityName
CustomerRoleId
客户角色编号
ActivityLog-活动日志
ActivityLogTypeId
CustomerId
CreatedOnUtc
ActivityLogType-活动日志类别表
SystemKeyword
系统关键字
Address-地址信息表
StateProvinceId
国家省市编码
ZipPostalCode
PhoneNumber
CreatedOnUtc
创建日期时间
Affiliate-隶属机构表
BackInStockSubscription-已订阅库存表
CustomerId
CreatedOnUtc
创建日期时间
BlogComment-博客评论表
CustomerId
CommentText
BlogPostId
CreatedOnUtc
创建日期时间
BlogPost-博客发帖信息表
LanguageId
AllowComments
是否被和谐
CommentCount
StartDateUtc
开始日期时间
EndDateUtc
结束日期时间
MetaKeywords
标签关键字
MetaDescription
LimitedToStores
是否用于商店
CreatedOnUtc
创建日期时间
Campaign-活动信息表
CreatedOnUtc
创建日期时间
Category-类别表
Description
CategoryTemplateId
类别模版编号
MetaKeywords
标签关键字
MetaDescription
ParentCategoryId
AllowCustomersToSelectPageSize
是否允许客户分页
PageSizeOptions
PriceRanges
图片格式说明
ShowOnHomePage
是否显示首页
HasDiscountsApplied
是否启用打折
SubjectToAcl
是否有权定义主题
LimitedToStores
是否限定仓库
是否已发布
是否已删除
DisplayOrder
CreatedOnUtc
创建日期时间
UpdatedOnUtc
最后修改日期时间
CategoryTemplate-类别模版表
DisplayOrder
CheckoutAttribute-账单信息表
TextPrompt
IsRequired
ShippableProductRequired
是否可运输
IsTaxExempt
TaxCategoryId
AttributeControlTypeId
控制属性类型编号
DisplayOrder
CheckoutAttributeValue-账单信息明细表
CheckoutAttributeId
检测属性编号
ColorSquaresRgb
PriceAdjustment
WeightAdjustment
IsPreSelected
DisplayOrder
Country-国家信息表
AllowsBilling
是否允许开发票
AllowsShipping
是否允许海运
TwoLetterIsoCode
第二信件编号
ThreeLetterIsoCode
第三信件编号
NumericIsoCode
SubjectToVat
是否收取增值税
是否已发布
DisplayOrder
CrossSellProduct-关联销售产品
ProductId1
ProductId2
Currency-货币信息表
CurrencyCode
DisplayLocale
CustomFormatting
LimitedToStores
是否限制仓库
是否已发布
DisplayOrder
CreatedOnUtc
创建日期时间
UpdatedOnUtc
最后修改日期时间
Customer-客户信息表
CustomerGuid
uniqueidentifier
客户唯一编码
PasswordFormatId
密码格式编号
PasswordSalt
AdminComment
管理员评论
IsTaxExempt
AffiliateId
隶属机构编号
IsSystemAccount
是否系统账户
SystemName
LastIpAddress
CreatedOnUtc
创建日期时间
LastLoginDateUtc
最后登录日期时间
LastActivityDateUtc
最后访问日期时间
BillingAddress_Id
开票地址编号
ShippingAddress_Id
购物地址编号
Customer_CustomerRole_Mapping-用户角色表映射
Customer_Id
CustomerRole_Id
客户角色编号
CustomerAddresses-客户地址表
Customer_Id
Address_Id
CustomerRole-客户角色表
FreeShipping
IsSystemRole
是否系统角色
SystemName
Discount-折扣
DiscountTypeId
折扣类型编号
UsePercentage
是否启用百分比
DiscountPercentage
DiscountAmount
StartDateUtc
开始日期时间
EndDateUtc
解决日期时间
RequiresCouponCode
是否需要赠劵
CouponCode
DiscountLimitationId
LimitationTimes
Discount_AppliedToCategories-类别折扣表
Discount_Id
Category_Id
Discount_AppliedToProducts-产品折扣表
Discount_Id
Product_Id
DiscountRequirement-折扣需求信息表
DiscountId
DiscountRequirementRuleSystemName
折扣需求系统名称
DiscountUsageHistory-折扣使用历史记录表
DiscountId
CreatedOnUtc
创建日期时间
Download-资源下载信息记录表
DownloadGuid
uniqueidentifier
UseDownloadUrl
用户下载地址
DownloadUrl
DownloadBinary
下载的资源
ContentType
下载内容类型
是否首次下载
EmailAccount-邮箱账户
DisplayName
UseDefaultCredentials
是否默认创建
ExternalAuthenticationRecord-外部鉴定记录
CustomerId
ExternalIdentifier
外部标识符
ExternalDisplayIdentifier
外部显示标识符
OAuthToken
开放授权记号
OAuthAccessToken
开放授权使用记号
ProviderSystemName
供应者系统名称
Forums_Forum-论坛
ForumGroupId
论坛组别编号
Description
LastTopicId
最后一次发表主题编号
LastPostId
最后一次发帖编号
LastPostCustomerId
最后一次发帖用户编号
LastPostTime
最后一次发布时间
DisplayOrder
CreatedOnUtc
创建日期时间
UpdatedOnUtc
最后修改日期时间
Forums_Group-论坛组别表
DisplayOrder
CreatedOnUtc
创建日期时间
UpdatedOnUtc
最后更新日期时间
Forums_Post-论坛发布记录表
CustomerId
CreatedOnUtc
创建日期时间
UpdatedOnUtc
最后更新日期时间
Forums_PrivateMessage-私人论坛管理
FromCustomerId
发送人编号
ToCustomerId
接收人编号
IsDeletedByAuthor
作者是否可以删除
IsDeletedByRecipient
接收人是否可以删除
CreatedOnUtc
创建日期时间
Forums_Subscription-论坛订阅记录表
SubscriptionGuid
uniqueidentifier
CustomerId
CreatedOnUtc
创建日期时间
Forums_Topic-论坛主题信息表
CustomerId
TopicTypeId
主题类别编号
LastPostId
最后回帖主题编号
LastPostCustomerId
最后回帖人编号
LastPostTime
最后发布时间
CreatedOnUtc
创建日期时间
UpdatedOnUtc
最后修改日期时间
GenericAttribute-通用属性信息表
GiftCard-购物卡
PurchasedWithOrderItemId
购买的订单编号
GiftCardTypeId
礼品卡类型
IsGiftCardActivated
是否是活动卡
GiftCardCouponCode
卡赠券编码
RecipientName
受赠者名称
RecipientEmail
受赠者邮箱
SenderName
发送人名称
SenderEmail
发送人邮箱
IsRecipientNotified
是否通知接收人
CreatedOnUtc
创建日期时间
GiftCardUsageHistory-购物卡使用记录
GiftCardId
礼品卡编号
UsedWithOrderId
使用订单编号
礼品卡消费金额
CreatedOnUtc
创建日期时间
GoogleProduct-谷歌产品
年龄层组别
ItemGroupId
项目组别编号
Language-语言(国家)
LanguageCulture
UniqueSeoCode
FlagImageFileName
图片文件名
是否锁定时间
LimitedToStores
是否指定仓库
是否已发布
DisplayOrder
LocaleStringResource-本地语言对照表
LanguageId
ResourceName
ResourceValue
LocalizedProperty-功能定位
LanguageId
LocaleKeyGroup
LocaleValue
LogLevelId
日志级别编号
ShortMessage
FullMessage
CustomerId
ReferrerUrl
CreatedOnUtc
创建日期时间
Manufacturer-制造商
Description
ManufacturerTemplateId
制造商模版编号
MetaKeywords
Meta标签关键字
MetaDescription
Meta标签描述
AllowCustomersToSelectPageSize
是否允许客户选择页大小
PageSizeOptions
页大小设置
PriceRanges
允许图片格式
SubjectToAcl
是否有主题权限
LimitedToStores
是否指定仓库
是否已发布
是否已删除
DisplayOrder
CreatedOnUtc
创建日期时间
UpdatedOnUtc
最后修改日期时间
ManufacturerTemplate-制造商模版
DisplayOrder
MeasureDimension-预计尺寸
SystemKeyword
系统关键字
DisplayOrder
MeasureWeight-预计重量
SystemKeyword
系统关键字
DisplayOrder
MessageTemplate-消息模版
BccEmailAddresses
私密邮箱地址
EmailAccountId
邮箱账户编号
LimitedToStores
是否指定仓库
News-新闻信息表
LanguageId
是否已发布
StartDateUtc
有效期开始日期时间
EndDateUtc
有效期结束日期时间
AllowComments
是否允许评论
CommentCount
LimitedToStores
是否指定商店
MetaKeywords
Meta关键字
MetaDescription
CreatedOnUtc
创建日期时间
NewsComment-新闻评论表
CommentTitle
CommentText
NewsItemId
CustomerId
CreatedOnUtc
创建日期时间
NewsLetterSubscription-新闻订阅申请
NewsLetterSubscriptionGuid
uniqueidentifier
新闻订阅编码
CreatedOnUtc
创建日期时间
Order-订单
uniqueidentifier
CustomerId
BillingAddressId
开票地址编号
ShippingAddressId
配送地址编号
OrderStatusId
订单状态编号
ShippingStatusId
配送状态编号
PaymentStatusId
付款状态编号
PaymentMethodSystemName
付款方式名称
CustomerCurrencyCode
付款币别编码
CurrencyRate
CustomerTaxDisplayTypeId
增值税数量
OrderSubtotalInclTax
税后订单总额
OrderSubtotalExclTax
税前订单总额
OrderSubTotalDiscountInclTax
税后折后订单总额
OrderSubTotalDiscountExclTax
税前折后订单总额
OrderShippingInclTax
OrderShippingExclTax
PaymentMethodAdditionalFeeInclTax
PaymentMethodAdditionalFeeExclTax
OrderDiscount
OrderTotal
订单合计金额
RefundedAmount
RewardPointsWereAdded
CheckoutAttributeDescription
商品满意度描述
CheckoutAttributesXml
付款属性配置
CustomerLanguageId
客户语言编号
AffiliateId
CustomerIp
AllowStoringCreditCardNumber
是否支持信用卡
消费卡类别
CardNumber
MaskedCreditCardNumber
卡号黑名单
信用卡安全码
CardExpirationMonth
当月失效卡
CardExpirationYear
当前年失效卡
AuthorizationTransactionId
交易授权编号
AuthorizationTransactionCode
AuthorizationTransactionResult
CaptureTransactionId
获得交易编号
CaptureTransactionResult
获得交易结果
SubscriptionTransactionId
订阅交易编号
PurchaseOrderNumber
PaidDateUtc
付款日期时间
ShippingMethod
ShippingRateComputationMethodSystemName
运费汇率系统名称
CreatedOnUtc
创建日期时间
OrderItem-订单明细
OrderItemGuid
uniqueidentifier
UnitPriceInclTax
税后吊牌价
UnitPriceExclTax
税前吊牌价
PriceInclTax
PriceExclTax
DiscountAmountInclTax
税后折后总额
DiscountAmountExclTax
税前折后总额
OriginalProductCost
商品成本金额
AttributeDescription
AttributesXml
DownloadCount
IsDownloadActivated
是否激活下载
LicenseDownloadId
允许下载编号
ItemWeight
OrderNote-订单票据
DisplayToCustomer
是否指定客户
CreatedOnUtc
创建日期时间
PermissionRecord-权限记录表
SystemName
PermissionRecord_Role_Mapping-角色权限记录关系表
PermissionRecord_Id
权限记录编号
CustomerRole_Id
客户角色编号
Picture-图片表
PictureBinary
SeoFilename
是否新图片
LanguageId
SystemKeyword
系统关键字
是否已投票
ShowOnHomePage
投票完成后是否显示主页
AllowGuestsToVote
是否允许未登录访客投票
DisplayOrder
StartDateUtc
开始日期时间
EndDateUtc
结束日期时间
PollAnswer-投票理由
NumberOfVotes
DisplayOrder
PollVotingRecord-投票记录表
PollAnswerId
投票理由编号
CustomerId
CreatedOnUtc
创建日期时间
Product-产品表
ProductTypeId
产品类别编号
ParentGroupedProductId
父分组产品编号
VisibleIndividually
是否单独可见
ShortDescription
FullDescription
AdminComment
管理员评论
ProductTemplateId
ShowOnHomePage
是否显示在主页
MetaKeywords
Meta关键字
MetaDescription
AllowCustomerReviews
是否允许用户评论
ApprovedRatingSum
NotApprovedRatingSum
ApprovedTotalReviews
已审核总评论数
NotApprovedTotalReviews
未审核总评论数
SubjectToAcl
是否指定权限
LimitedToStores
是否指定商店
ManufacturerPartNumber
制造商编号
全球贸易项目代码
IsGiftCard
是否礼品卡
GiftCardTypeId
礼品卡类别编号
RequireOtherProducts
是否需要其他产品
RequiredProductIds
所需的产品编号
AutomaticallyAddRequiredProducts
自动添加需要的产品
IsDownload
是否可以下载
DownloadId
UnlimitedDownloads
是否无限制下载
NumberOfDownloads
下载任务数量设置
DownloadExpirationDays
下载过期天数
DownloadActivationTypeId
下载激活类型编号
HasSampleDownload
是否下载样本
SampleDownloadId
样本下载编号
HasUserAgreement
是否有用户协议
UserAgreementText
用户协议文本
IsRecurring
RecurringCycleLength
循环周期长度
RecurringCyclePeriodId
循环周期编号
RecurringTotalCycles
循环总周期
IsShipEnabled
是否启用邮寄
IsFreeShipping
AdditionalShippingCharge
额外的运输费用
IsTaxExempt
TaxCategoryId
税收类别编号
ManageInventoryMethodId
管理库存方法编号
StockQuantity
DisplayStockAvailability
显示库存可用性
DisplayStockQuantity
是否显示库存数量
MinStockQuantity
最小库存数量
LowStockActivityId
低库存活动编号
NotifyAdminForQuantityBelow
低库存报警数量
BackorderModeId
退货订单编号
AllowBackInStockSubscriptions
是否允许退货
OrderMinimumQuantity
最小订货量
OrderMaximumQuantity
最大订货量
AllowedQuantities
DisableBuyButton
是否禁用购买按钮
DisableWishlistButton
是否禁用列表按钮
AvailableForPreOrder
是否可以预定
CallForPrice
ProductCost
产品成本价
SpecialPrice
SpecialPriceStartDateTimeUtc
特价商品开始有效日期时间
SpecialPriceEndDateTimeUtc
特价商品结束有效日期时间
CustomerEntersPrice
MinimumCustomerEnteredPrice
最低会员价
MaximumCustomerEnteredPrice
最高会员价
HasTierPrices
是否阶梯价
HasDiscountsApplied
AvailableStartDateTimeUtc
有效开始日期时间
AvailableEndDateTimeUtc
有效结束日期时间
DisplayOrder
是否已发布
CreatedOnUtc
创建日期时间
UpdatedOnUtc
最后修改日期时间
Product_Category_Mapping-商品类别表
CategoryId
IsFeaturedProduct
是否热门商品
DisplayOrder
Product_Manufacturer_Mapping-产品制造商
ManufacturerId
制造商编号
IsFeaturedProduct
是否热门商品
DisplayOrder
Product_Picture_Mapping-产品图片表
DisplayOrder
Product_ProductAttribute_Mapping-产品属性表
ProductAttributeId
产品属性编号
TextPrompt
IsRequired
是否必需的
AttributeControlTypeId
属性控制类型编号
DisplayOrder
Product_ProductTag_Mapping-产品标签
Product_Id
ProductTag_Id
产品标签编号
Product_SpecificationAttribute_Mapping-产品说明书
SpecificationAttributeOptionId
规范属性操作编号
CustomValue
AllowFiltering
是否允许过滤
ShowOnProductPage
是否显示在产品中
DisplayOrder
ProductAttribute-产品属性
Description
ProductReview-产品评论
CustomerId
IsApproved
ReviewText
HelpfulYesTotal
HelpfulNoTotal
CreatedOnUtc
创建日期时间
ProductReviewHelpfulness-产品评论好评表
ProductReviewId
产品评论编号
WasHelpful
CustomerId
ProductTag-产品标签
ProductTemplate-产品模版
DisplayOrder
ProductVariantAttributeCombination-产品调整表
AttributesXml
StockQuantity
AllowOutOfStockOrders
是否允许预售
ManufacturerPartNumber
全球贸易项目代码
ProductVariantAttributeValue-产品调整值表
ProductVariantAttributeId
产品关联编号
AttributeValueTypeId
属性值类别编号
AssociatedProductId
关联产品编号
ColorSquaresRgb
PriceAdjustment
WeightAdjustment
IsPreSelected
DisplayOrder
QueuedEmail-邮件发送状态表
发件人邮箱
发件人名称
收件人邮箱
收件人名称
CreatedOnUtc
创建日期时间
EmailAccountId
邮箱账户编号
RecurringPayment-分期付款表
CycleLength
CyclePeriodId
TotalCycles
StartDateUtc
开始日期时间
是否已删除
InitialOrderId
初始订单编号
CreatedOnUtc
创建日期时间
RecurringPaymentHistory-分期付款记录表
RecurringPaymentId
分期付款编号
CreatedOnUtc
创建日期时间
RelatedProduct-相关产品
ProductId1
ProductId2
DisplayOrder
ReturnRequest-退货申请表
OrderItemId
CustomerId
ReasonForReturn
RequestedAction
CustomerComments
StaffNotes
工作人员注意事项
ReturnRequestStatusId
返回请求状态编号
CreatedOnUtc
创建日期时间
UpdatedOnUtc
最后修改日期时间
RewardPointsHistory-积分兑换历史记录
CustomerId
PointsBalance
UsedAmount
CreatedOnUtc
创建日期时间
UsedWithOrder_Id
积分消费的订单编号
ScheduleTask-计划任务
计划子编号
StopOnError
报错是否停止
LastStartUtc
最后开始日期时间
LastEndUtc
最后结束日期时间
LastSuccessUtc
上次完成日期时间
Setting-设置
Shipment-配送状态表
TrackingNumber
TotalWeight
ShippedDateUtc
发货日期时间
DeliveryDateUtc
收货日期时间
CreatedOnUtc
创建日期时间
ShipmentItem-发货信息表
ShipmentId
OrderItemId
ShippingByWeight--发货信息表
ShippingMethodId
AdditionalFixedCost
PercentageRateOfSubtotal
RatePerWeightUnit
LowerWeightLimit
ShippingMethod-配送方式
Description
DisplayOrder
ShippingMethodRestrictions-配送方式限制
ShippingMethod_Id
配送方式编号
Country_Id
ShoppingCartItem-购物车条目
ShoppingCartTypeId
购物车类型编号
CustomerId
AttributesXml
CustomerEnteredPrice
CreatedOnUtc
创建日期时间
UpdatedOnUtc
最后修改日期时间
SpecificationAttribute-规格说明
DisplayOrder
SpecificationAttributeOption-规范属性选项
SpecificationAttributeId
规范属性编号
DisplayOrder
StateProvince-地区信息表
Abbreviation
是否已发布
DisplayOrder
Store-仓库信息表
SslEnabled
安全基准网址
DisplayOrder
StoreMapping-仓库映射
EntityName
TaxCategory-税收类别
DisplayOrder
TaxRate-税收汇率
TaxCategoryId
税收类别编号
StateProvinceId
Percentage
TierPrice-双价制度
CustomerRoleId
客户角色编号
Topic-主题
SystemName
IncludeInSitemap
是否包括在网站地图
IsPasswordProtected
是否有密保
MetaKeywords
Meta关键字
MetaDescription
LimitedToStores
是否指定仓库
UrlRecord-URL记录
EntityName
LanguageIdnopcommerce中文网 | 教你一招
从nopcommerce3.7开始就支持redis缓存了,但是默认没有启用,启用步骤如下:1、首先安装redis服务器(如果没有的话),参考网址 2、然后修改web.config如下:&RedisCaching Enabled="true" ConnectionString="localhost:6379,allowAdmin=true" /&注意要启用allowAdmin=true,否则后台清理缓存的时候会报错。3、刷新页面就可以了,在Redis Desktop Manager里面看下缓存数据吧。分享是一种美。版权所有,转载请注明出处
135257cd-b59a-4e8c-8ddd-ef|1|5.0|ad-47ef-9e05-950bb762570c
Autofac一般是通过Contrller的构造函数或者属性来注入,但是这有一个共同点就是调用这个类的方法一般都是实例方法,也就是要实例化这个类才能调用它的方法。但是如果它是一个静态方法我们又该怎么办呢?其实也很简单,下面我们就通过一个写日志的组件来介绍怎么实现ASP.NET
MVC5类的静态方法的依赖注入。因为考虑到很多地方都要用到写日志这个方法,而且我们又不想每次调用都需要new一个对象,所以把调用方法封装成一些静态方法。
DependencyRegistrar.cs
using Autofac;using Autofac.Integration.Mvc;using Lanhu.Services;using Lanhu.Services.MetionNowOrder;using Lanhu.Services.Member;using System.Web.Mvc; namespace Lanhu.Admin{
public class DependencyRegistrar
public static void RegisterDependencies()
var builder = new ContainerBuilder();
builder.RegisterControllers(typeof(MvcApplication).Assembly);
builder.RegisterType&Log_UserLogonService&().As&ILog_UserLogon&().InstancePerLifetimeScope();
builder.RegisterType&Log_UserOperateService&().As&ILog_UserOperate&().InstancePerLifetimeScope();
//autofac 注册依赖
IContainer container = builder.Build();
DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
&&&&} &} }
在App_Start事件中调用上面的会依赖注入代码:
using Lanhu.Core;using System;using System.Collections.Generic;using System.;using System.Web;using System.Web.Mvc;using System.Web.Optimization;using System.Web.Routing; namespace Lanhu.Admin{
public class MvcApplication : System.Web.HttpApplication
protected void Application_Start()
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
DependencyRegistrar.RegisterDependencies();
LogFacade.cs:
using Lanhu.Model;using Lanhu.Services;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Web;using System.Web.Mvc; namespace Lanhu.Admin.Infrastructure{
public class LogFacade
public static bool AddLogonLog(MLog_UserLogon model)
var service = DependencyResolver.Current.GetService&ILog_UserLogon&();
return service.Insert(model);
public static bool AddOperateLog(string info,bool isError=false)
var service = DependencyResolver.Current.GetService&ILog_UserOperate&();
if (isError)
model.ErrorMsg = info;
model.Msg = info;
return service.Insert(model);
public static bool AddOperateLog(MLog_UserOperate model)
var service = DependencyResolver.Current.GetService&ILog_UserOperate&();
return service.Insert(model);
上面封装了三个静态方法,在方法里面通过DependencyResolver.Current.GetService从Ioc容器中获取相应类型的依赖对象。这个LogFacade使用外观模式,让调用显得很简单。
04323aba-ac24-4efd-a675-876f42f50c84|2|5.0|ad-47ef-9e05-950bb762570c
I've seen a lot of nopCommerce forums users asking how they can use Entity Framework (EF) Code-First&Migrations to customize nopCommerce, add new fields and entites to the core. I actually use a lot of EF Migrations myself when doing nopCommerce customization projects, and I must say it helps&a lot in the development.Today, I'll share with you how you can do that in nopCommerce project! I'll be using nopCommerce 3.20 as an example, but you can easily apply the concept to other vesions!Setting Up EF Migrations in nopCommerce SolutionThe first thing you want to do is to enable migrations in your nopCommerce solution. So fire up nopCommerce in Visual Studio, look at Nop.Web project, and open Web.config. You need to add a connection string to your development database. Note that adding the connection string in Web.config doesn't affect how nopCommerce works, since nopCommerce doesn't look for connection string in Web.config.Then, open NopObjectContext.cs in Nop.Data. Add a new constructor that points to the name of the connection string that you've just added in previous step.&NOTE: replace Pro-nopCommerce with the name of your connection string.The next step is to actually enable migrations in the project. If you have not already done so, bring up Package Manager Console. In the "Default Project" drop-down list, select Nop.Data as the project. Please also make sure Nop.Web is selected as the&StartUp Project. Now, enter the command "enable-migrations" in Package Manager Console, and hit Enter! Visual Studio will generate a file named "Configurations.cs"; you can safely ignore it, but you need to keep it.The last step in EF Migrations setup is done by entering the command "add-migration InitialMigration -IgnoreChanges" in Package Manager Console. "InitialMigration" (highligted yellow) is the name you want to give the the current migration, and the "IgnoreChanges" handle is to tell EF Migrations that you want to leave out the current database as-is: that means you want EF to&ignore all the existing tables so that no script is generated for the existing tables.As a result, you'll see a new .cs file generated by Visual Studio that correspond to the migration - InitialMigration - you've just added. If you look at the file, it essentially is a blank file, due to the fact that we used the -IgnoreChanges handle in previous step.To actually save this migration over to the database, run the command "update-database" in Package Manager Console. Your database is now ready for actual EF Migration tasks!Adding a Migration and Updating the DatabaseNow, suppose we want to link up Blog and Products, where a Product can have multiple BlogPost that talk about the Product itself. We'll need a one-to-many relationship between Product and BlogPost.In essence, what we need is a new&ProductId&field in BlogPost, and a&ICollection&BlogPost&&property in Product. The following screenshot sums up the update we should add to both&Product.cs&and&BlogPost.cs&(in Nop.Core project).Now you have the properties ready on your domain model, you also need to setup the configuration and tell Entity Framework how you want to format the parameter, for example the relationship, and whether a field is optional/required. Open&BlogPostMap.cs&in Nop.Data, and enter the following lines, where we tell EF to that&Product&(or&ProductId)&is an optional property (meaning it can have&NULL&as value), and a&Product&can have many&BlogPost, and to use&ProductId&as the foreign key between&BlogPost&andProduct.We now have enough information to instruct Entity Framework to generate the migration, so again, bring up Package Manager Console, and enter the command "add-migration AddProductToBlogPost".This command causes Visual Studio to generate a .cs file that looks like the following:To actually generate the SQL script and update the database, run again the command "update-database" in Package Manager Console. Now, to verify that the database is updated correctly, open up BlogPost table in the database, and check that the new field, foreign key and etc&are indeed added.ConclusionEntity Framework Code-first Migration can be a very handy tool if you customize nopCommerce a lot. Like this you don't need to touch the database when you want to add new fields, tables and etc to the database. Everything can be done from the code!Learn up the technique, and have fun coding!翻译自:
b717ae54-e2b3-424d-aa36-5a|3|5.0|ad-47ef-9e05-950bb762570c
如果要在数据库中添加一个新的数据表,需要按照下面的步骤来完成.
一、数据库中添加数据表,比如nop_demo
二、在domain下添加nop_demo.cs
需要在目录Libraries\Nop.Core\Domain\下某个目录下添加相应的类,我在Catalog下添加nop_demo.cs;
三、在Mapping下添加map类
需要在目录Libraries\Nop.Data\Mapping\下某个目录下添加相应的类,我在Catalog下添加nop_demoMap.cs;
四、添加IService.cs\Service.cs
需要在目录Libraries\Nop.Services\下某个目录下添加相应的类,我在Catalog下添加Inop_demoService.cs和nop_demoService.cs
五、在DependencyRegistrar.cs中注册相应类型
需要在文件Presentation\Nop.Web\Infrastructure\DependencyRegistrar.cs中添加builder.RegisterType&nop_demoService&().As&Inop_demoService&().InstancePerHttpRequest();
六、添加相应model文件
需要在路径Presentation\Nop.Admin\Models\Catalog\下添加Nop_demoModel.cs
七、添加相应html文件
需要在路径Presentation\Nop.Admin\Views\Catalog\下添加Nop_demo.cshtml
八、添加domain与model的映射
&需要在文件Presentation\Nop.Admin\Infrastructure\AutoMapperStartupTask.cs 中添加相应的映射
Mapper.CreateMap&Nop_demo&,&Nop_demoModel&();
Mapper.CreateMap&Nop_demoModel,&Nop_demo&();
版权声明:本文为博主原创文章,未经博主允许不得转载。
5ee-4e6e-b14f-673d73cb30f3|2|3.0|ad-47ef-9e05-950bb762570c
熟悉nopcommerce插件的朋友应该知道里面有一种Misc类型的插件,比如Nop.Plugin.Misc.WebServices和Nop.Plugin.Misc.FacebookShop,继承自接口IMiscPlugin,主要用来完成其他插件不能完成的工作,今天无意中发现这种插件还有个妙用,就是可以替换现有的页面,看来nopcommerce真的很博大。例如我们进入后台促销管理 - 折扣管理,你会看到这个页面:这个功能做的不太友好,没有搜索功能,如果数据比较多的话找起来会很吃力,怎么办?一般情况下我们会想到直接修改代码来增加搜索功能,但是这样会破坏nopcommerce的源程序,做nopcommerce二次开发的前提是尽可能的不修改它的架构,而是用插件和模板来实现自己的需求,这样方便以后升级。然后我们会想到做个页面来替换这个页面从而达到我们的目的,这时候就会用到Misc类型的插件了,实际上我们就是在这个插件里面做了一个带搜索的折扣管理的页面,然后重要的是修改RouteProvider.cs里面的路由,如下:这段代码的意思很明显就是移除默认的路由然后添加新的路由从而指向我们添加的这个页面,插件完成后后台安装再进入折扣管理页面你会看到如图所示的页面:好了,其实还有很多的用途,盆友们自己研究吧!源码下载:分享是一种美。版权所有,转载请注明出处
ad2a70-9b87-ca875aa45fea|5|5.0|ad-47ef-9e05-950bb762570c
nopcommerce后台编辑器使用了tinymce,默认不支持上传本地图片功能,这里简单说一下如何汉化和支持本地上传图片功能。1. 如何汉化首先在官网下载汉化包:解压后放到目录\Presentation\Nop.Web\Content\tinymce\langs,然后找到\Presentation\Nop.Web\Administration\Views\Shared\EditorTemplates\RichEditor.cshtml,这个view就是初始化tinymce的地方,在tinymce.init里面添加配置信息language: 'zh_CN',然后保存刷新页面就看到中文了。2. 如何支持本地图片上传找到文件\Presentation\Nop.Web\Administration\Views\Shared\EditorTemplates\RichEditor.cshtml,把其中的canUploadPictures =改为canUploadPictures = 保存刷新页面即可。需要说明的是这个上传功能不够强大,如果需要强大的图片和文件管理功能可能需要在官网购买付费插件了,更多信息请查看:
ccdb082c-904a-48d7-a088-f|3|4.0|ad-47ef-9e05-950bb762570c
我刚刚完成了nopCommerce注册页面的密码强度检查仪,因为我觉得在电子商务交易平台,安全问题是非常重要的。在注册页面有必要添加一个密码强度检测仪,以便通知用户他们的密码是否足够强大。今天,大多数网站都使用这个密码强度计来检查密码的强度。
为什么一个密码强度计如此重要?
- 拥有一个强密码来保护我们的,因为我们每天都在网上共享个人信息 - 拥有一个强密码来保护我们,如信用卡信息,社会保障,银行帐号,密码#S等敏感信息
如何建立一个强大的密码?
- 一个强大的密码至少有8个字符- 一个强大的密码应该有特殊字符 - 一个强大的密码应该有字母和数字 - 一个强大的密码应该有小写字母和大写字母
- 请在至少2个月更改一次密码的做法。 - 避免使用正确的拼写。例如:你应该使用“ef4t”代替单词“effort”。
现在,是时候看代码了:
1) 在nopCommerce代码,注册页面在以下位置:
根目录\Views\Customer\&Register.cshtml &&&-- 打开这个文件
2) 在代码中找到这里:
&div class="form-fields"&
&&&&&&&&&&&&&&&&&&&&&div class="inputs"&
&&&&&&&&&&&&&&&&&&&&&&&&@Html.LabelFor(model =& model.Password, new { }, ":")
&&&&&&&&&&&&&&&&&&&&&&&&@Html.EditorFor(model =& model.Password)
&&&&&&&&&&&&&&&&&&&&&&&&@Html.RequiredHint()
&&&&&&&&&&&&&&&&&&&&&&&&@Html.ValidationMessageFor(model =& model.Password)
&&&&&&&&&&&&&&&&&&&&&/div&
&&&&&&&&&&&&&&&&&&&&&div class="inputs"&
&&&&&&&&&&&&&&&&&&&&&&&&@Html.LabelFor(model =& model.ConfirmPassword, new { }, ":")
&&&&&&&&&&&&&&&&&&&&&&&&@Html.EditorFor(model =& model.ConfirmPassword)
&&&&&&&&&&&&&&&&&&&&&&&&@Html.RequiredHint()
&&&&&&&&&&&&&&&&&&&&&&&&@Html.ValidationMessageFor(model =& model.ConfirmPassword)
&&&&&&&&&&&&&&&&&&&&&/div&
&&&&&&&&&&&&&&&&&&&&@if (Model.DisplayCaptcha)
&&&&&&&&&&&&&&&&&&&&{
&&&&&&&&&&&&&&&&&&&&&&&&&div class="captcha-box"&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&@Html.Raw(Html.GenerateCaptcha())
&&&&&&&&&&&&&&&&&&&&&&&&&/div&
&&&&&&&&&&&&&&&&&&&&}
&&&&&&&&&&&&&&&&&/div&
3) 在这种情况下,我们需要添加javascript,jQuery和CSS。因此,为了做到这一点,我们将在我们的“Register.cshtml”页面中添加这样的代码:
&script type='text/javascript'&
&&&&$(function () {
&&&&&&&&// This applies the Strength checking plug-in to your particular element
&&&&&&&&$('#Password').strength({ strengthButtonText: "" });
&&&&&&&&// Fixup your Required indicator (inserts it explicitly after your password element)
&&&&&&&&$('.required-indicator').insertAfter($("#Password"));
注: 这里的 $('#Password') 将引用密码输入字段。
4) 我们还需要添加相应的JQuery插件(如果存在jquery插件就不需要添加了):
&!-- Example jQuery --&
&script type="text/javascript" src=""&&/script&
&!-- Strength.js --&
&script type="text/javascript" src=""&&/script&
注:&"strength.js" 这个文件里面定义什么是弱,中,强密码。根据您的要求,如果你愿意你可以修改它。
5) 现在,我们将增加CSS样式:
&style type='text/css'&
&&&&.strength_meter, .strength_meter * {
&&&&&&&&display: inline;
6) 到这里 - 你可以下载这个页面的源代码了Register.cshtml: P.S. 此代码经过测试,适用于nopCommerce3.30版本
注: 在nopCommerce,您可以通过将定义的最小长度的密码:
Administration & Configuration & Settings & All settings&
找到: "customersettings.passwordminlength" 并且修改它的值
希望对你有所帮助...翻译自:/Blog/post/Lavish-Kumar/29/Steps-to-add-password-strength-meter-in-nopCommerce-3-30-register-page/
f1e7f1a8-a9e5-4ff3-b087-0a952a|5.0|ad-47ef-9e05-950bb762570c
很多朋友在修改模板的时候看到很多类似@Html.Widget("xxx")的东西,这里简单介绍一下流程:
比如@Html.Widget("home_page_top"),首先要知道Html.Widget是什么,这是Html的一个扩展方法,位于Nop.Web.Framework\HtmlExtensions.cs
public static MvcHtmlString Widget(this HtmlHelper helper, string widgetZone)
return helper.Action("WidgetsByZone", "Widget", new { widgetZone = widgetZone });
可以看到这里面调用的是action,找到WidgetController下面的WidgetsByZone,这是一个child action(不懂的百度一下),读一下代码,就能了解这个方法就是通过反射获取到实现接口IWidgetPlugin并且GetWidgetZones()包含home_page_top的插件的列表,然后创建一个model传递给试图:
[ChildActionOnly]
public ActionResult WidgetsByZone(string widgetZone)
var model = new List&RenderWidgetModel&();
var widgets = _widgetService.LoadActiveWidgetsByWidgetZone(widgetZone, _storeContext.CurrentStore.Id);
foreach (var widget in widgets)
var widgetModel = new RenderWidgetModel();
string actionN
string controllerN
RouteValueDictionary routeV
widget.GetDisplayWidgetRoute(widgetZone, out actionName, out controllerName, out routeValues);
widgetModel.ActionName = actionN
widgetModel.ControllerName = controllerN
widgetModel.RouteValues = routeV
model.Add(widgetModel);
return PartialView(model);
打开试图Widget\WidgetsByZone.cshtml:
@model List&RenderWidgetModel&
@using Nop.Web.Models.C
@foreach (var widget in Model)
@Html.Action(widget.ActionName, widget.ControllerName, widget.RouteValues)
这个试图的目的就是循环输出html,具体输出的内容在插件里面实现的,比如插件Nop.Plugin.Widgets.NivoSlider里面有个NivoSliderPlugin,这类插件必须继承自BasePlugin,和IWidgetPlugin,里面的方法GetDisplayWidgetRoute就是用于返回显示这个插件内容的action的信息,WidgetsNivoSliderController.cs里面的public ActionResult PublicInfo(string widgetZone)就是这个插件具体输出的内容,大体流程就是这样了。
ecbcb576-826d-4afd-9b1e-9eba3f4deecf|7|3.3|ad-47ef-9e05-950bb762570c
asp.net mvc里面的area是什么,
&如果在nopcommerce里面加入类似admin的area,步骤如下:
1、新建一个mvc空项目MvcApplication1,位置放在\Nop.Web下面,添加一个类MvcApplicationAreaRegistration.cs用于注册area,内容如下:
using System.Web.M
namespace MvcApplication1
public class MvcApplicationAreaRegistration : AreaRegistration
public override string AreaName
return "MvcApplication1";
public override void RegisterArea(AreaRegistrationContext context)
context.MapRoute(
"MvcApplication1_default",
"MvcApplication1/{controller}/{action}/{id}",
new { controller = "Home", action = "Index", area = "MvcApplication1", id = "" },
new[] { "MvcApplication1.Controllers" }
2、修改MvcApplication1/Views/_ViewStart.cshtml,内容如下:
Layout = "~/MvcApplication1/Views/Shared/_Layout.cshtml";
如果不修改的话会提示找不到view的。
3、添加一个HomeController和对应的视图,这里不再详细说明。
4、修改MvcApplication1输出路径,改为:..\bin\,要不然是找不到dll的。
5、删除Global.asax文件,删除web.config里面不需要的内容,可参考admin下面的config文件。
6、最后关键一步,修改Nop.Web.Framework\Themes\ThemeableVirtualPathProviderViewEngine.cs的方法GetPath,添加如下内容:
if (!string.IsNullOrEmpty(areaName) && areaName.Equals("mvcApplication1", StringComparison.InvariantCultureIgnoreCase))
//admin area does not support mobile devices
if (mobile)
searchedLocations = new string[0];
return string.E
var newLocations = areaLocations.ToList();
newLocations.Insert(0, "~/MvcApplication1//Views/{1}/{0}.cshtml");
newLocations.Insert(0, "~/MvcApplication1//Views/{1}/{0}.vbhtml");
newLocations.Insert(0, "~/MvcApplication1//Views/Shared/{0}.cshtml");
newLocations.Insert(0, "~/MvcApplication1//Views/Shared/{0}.vbhtml");
areaLocations = newLocations.ToArray();
重新编译测试一下吧,地址http://localhost:2619/MvcApplication1/Home。
cf72bb52-fe40-4a62-a9dd-444e3d0c9cdb|4|5.0|ad-47ef-9e05-950bb762570c
nopcommerce拥有一套不错的模板机制,可以让你快速的做一套属于自己的主题。\Presentation\Nop.Web下面有个Themes文件夹,这里面就是放主题的地方,每个主题对应一个文件夹,每个主题文件夹下面都有一个theme.config文件,这个文件定义了该主题的一些基本信息。Content文件夹放的样式、图片、脚本等资源文件,Views文件夹放的是试图,nopcommerce会默认先读取这个里面的view,如果找不到就去根目录下面的Views里面找,我的作法是直接把根目录下面的Views文件夹复制过来,需要哪个就修改哪个,然后就是修改样式了,nopcommerce有一列、两列、三列显示,你可以参考一些国内的商城系统(注:你可以使用google浏览器或者火狐浏览器能很方便的看到每一块的具体样式,能很快的抄过来。。。),这里就不多说了。
这里分享了几个简单的主题:
04305bdf-8f28-4687-84ad-6bc5f8fa.0|ad-47ef-9e05-950bb762570c
之后的文章1}

我要回帖

更多关于 nopcommerce中文 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信