├── .gitignore ├── .nuget ├── NuGet.Config ├── NuGet.exe └── NuGet.targets ├── ByteartRetail.Application ├── ApplicationService.cs ├── ByteartRetail.Application.csproj ├── Implementation │ ├── OrderServiceImpl.cs │ ├── PostbackServiceImpl.cs │ ├── ProductServiceImpl.cs │ └── UserServiceImpl.cs ├── Properties │ └── AssemblyInfo.cs ├── QuerySpecExtension.cs └── packages.config ├── ByteartRetail.DataObjects ├── AddressDataObject.xsd ├── ByteartRetail.DataObjects.csproj ├── ByteartRetailDataObjects.Partial.cs ├── ByteartRetailDataObjects.cs ├── CategorizationDataObject.xsd ├── CategoryDataObject.xsd ├── CollectionDataObjectList.xsd ├── FaultData.cs ├── GenerateDataObjects.cmd ├── PostbackDataObject.xsd ├── ProductDataObject.xsd ├── Properties │ └── AssemblyInfo.cs ├── QuerySpec.xsd ├── RoleDataObject.xsd ├── SalesLineDataObject.xsd ├── SalesOrderDataObject.xsd ├── SalesOrderStatusDataObject.xsd ├── ShoppingCartDataObject.xsd ├── ShoppingCartItemDataObject.xsd └── UserDataObject.xsd ├── ByteartRetail.Domain.Repositories ├── App.config ├── ByteartRetail.Domain.Repositories.csproj ├── EntityFramework │ ├── ByteartRetailDbContext.cs │ ├── ByteartRetailDbContextInitailizer.cs │ ├── CategorizationRepository.cs │ ├── CategoryRepository.cs │ ├── ModelConfigurations │ │ ├── CategorizationTypeConfiguration.cs │ │ ├── CategoryTypeConfiguration.cs │ │ ├── ProductTypeConfiguration.cs │ │ ├── RoleTypeConfiguration.cs │ │ ├── SalesLineTypeConfiguration.cs │ │ ├── SalesOrderTypeConfiguration.cs │ │ ├── ShoppingCartItemTypeConfiguration.cs │ │ ├── ShoppingCartTypeConfiguration.cs │ │ ├── UserRoleTypeConfiguration.cs │ │ └── UserTypeConfiguration.cs │ ├── ProductRepository.cs │ ├── RoleRepository.cs │ ├── SalesOrderRepository.cs │ ├── ShoppingCartItemRepository.cs │ ├── ShoppingCartRepository.cs │ ├── UserRepository.cs │ └── UserRoleRepository.cs ├── Properties │ └── AssemblyInfo.cs ├── Specifications │ ├── SalesOrderBelongsToUserSpecification.cs │ ├── SalesOrderIDEqualsSpecification.cs │ ├── ShoppingCartBelongsToCustomerSpecification.cs │ ├── ShoppingCartItemBelongsToShoppingCartSpecification.cs │ ├── UserEmailEqualsSpecification.cs │ ├── UserNameEqualsSpecification.cs │ ├── UserPasswordEqualsSpecification.cs │ └── UserStringEqualsSpecification.cs └── packages.config ├── ByteartRetail.Domain ├── ByteartRetail.Domain.csproj ├── Events │ ├── GetUserOrdersEvent.cs │ ├── Handlers │ │ ├── GetUserOrdersEventHandler.cs │ │ ├── OrderConfirmedEventHandler.cs │ │ └── OrderDispatchedEventHandler.cs │ ├── OrderConfirmedEvent.cs │ └── OrderDispatchedEvent.cs ├── Model │ ├── Address.cs │ ├── Categorization.cs │ ├── Category.cs │ ├── Product.cs │ ├── Role.cs │ ├── SalesLine.cs │ ├── SalesOrder.cs │ ├── SalesOrderStatus.cs │ ├── ShoppingCart.cs │ ├── ShoppingCartItem.cs │ ├── User.cs │ └── UserRole.cs ├── Properties │ └── AssemblyInfo.cs ├── Repositories │ ├── ICategorizationRepository.cs │ ├── ICategoryRepository.cs │ ├── IProductRepository.cs │ ├── IRoleRepository.cs │ ├── ISalesOrderRepository.cs │ ├── IShoppingCartItemRepository.cs │ ├── IShoppingCartRepository.cs │ ├── IUserRepository.cs │ └── IUserRoleRepository.cs ├── Services │ ├── DomainService.cs │ └── IDomainService.cs └── packages.config ├── ByteartRetail.Events.Handlers ├── ByteartRetail.Events.Handlers.csproj ├── Properties │ └── AssemblyInfo.cs ├── SendEmailHandler.cs └── packages.config ├── ByteartRetail.Infrastructure.Caching ├── ByteartRetail.Infrastructure.Caching.csproj ├── EntLibCacheProvider.cs ├── Properties │ └── AssemblyInfo.cs └── packages.config ├── ByteartRetail.Infrastructure ├── ByteartRetail.Infrastructure.csproj ├── Caching │ ├── CacheManager.cs │ ├── CachingAttribute.cs │ ├── CachingMethod.cs │ └── ICacheProvider.cs ├── Communication │ ├── ChannelFactoryManager.cs │ └── ServiceProxy.cs ├── Config │ ├── ByteartRetailConfigSection.csd │ ├── ByteartRetailConfigSection.csd.config │ ├── ByteartRetailConfigSection.csd.cs │ ├── ByteartRetailConfigSection.csd.diagram │ ├── ByteartRetailConfigSection.csd.xsd │ └── ByteartRetailConfigurationReader.cs ├── IApplicationServiceContract.cs ├── InterceptionBehaviors │ ├── CachingBehavior.cs │ └── ExceptionLoggingBehavior.cs ├── Properties │ └── AssemblyInfo.cs ├── ServiceLocator.cs ├── Utils.cs └── packages.config ├── ByteartRetail.ServiceContracts ├── ByteartRetail.ServiceContracts.csproj ├── IOrderService.cs ├── IPostbackService.cs ├── IProductService.cs ├── IUserService.cs ├── Properties │ └── AssemblyInfo.cs └── packages.config ├── ByteartRetail.Services.WCF ├── App_Data │ ├── ByteartRetail.mdf │ └── ByteartRetail_log.ldf ├── ByteartRetail.Services.WCF.csproj ├── Common.cs ├── Common.tt ├── Global.asax ├── Global.asax.cs ├── Logs │ └── balog.txt ├── OrderService.svc ├── OrderService.svc.cs ├── OrderService.svc.tt ├── PostbackService.svc ├── PostbackService.svc.cs ├── PostbackService.svc.tt ├── ProductService.svc ├── ProductService.svc.cs ├── ProductService.svc.tt ├── Properties │ └── AssemblyInfo.cs ├── Traces_Server.svclog ├── UserService.svc ├── UserService.svc.cs ├── UserService.svc.tt ├── Web.Debug.config ├── Web.Release.config ├── Web.config └── packages.config ├── ByteartRetail.Web.MVC ├── App_Code │ ├── ByteartRetailMembershipProvider.cs │ ├── ByteartRetailMembershipUser.cs │ ├── HtmlHelperExtension.cs │ ├── PermissionKeys.cs │ └── UrlHelperExtension.cs ├── App_Start │ ├── BundleConfig.cs │ ├── FilterConfig.cs │ ├── RouteConfig.cs │ └── WebApiConfig.cs ├── ByteartRetail.Web.MVC.csproj ├── Content │ ├── Site.css │ ├── ellipsis-xbl.xml │ ├── superfish-navbar.css │ ├── superfish-vertical.css │ ├── themes │ │ └── smoothness │ │ │ ├── images │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ ├── ui-bg_flat_75_ffffff_40x100.png │ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ │ ├── ui-icons_222222_256x240.png │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ ├── ui-icons_454545_256x240.png │ │ │ ├── ui-icons_888888_256x240.png │ │ │ └── ui-icons_cd0a0a_256x240.png │ │ │ └── jquery-ui-1.8.23.custom.css │ ├── uploadify.css │ └── uploadify.swf ├── Controllers │ ├── AccountController.cs │ ├── AdminController.cs │ ├── ControllerBase.cs │ ├── HomeController.cs │ └── LayoutController.cs ├── Global.asax ├── Global.asax.cs ├── Images │ ├── Add.png │ ├── Add2.png │ ├── Admin_32.png │ ├── Back.png │ ├── Bag.png │ ├── Cancel.png │ ├── Category_32.png │ ├── CopyTo.png │ ├── Delete.png │ ├── Disable.png │ ├── Edit.png │ ├── Enable.png │ ├── Login.png │ ├── Logout.png │ ├── Product_32.png │ ├── Products │ │ ├── 29ebfc59_e14a_49bc_9a41_d0796f392475.jpg │ │ ├── 2d3df03f_0663_4f9a_8f6c_cb0af683cd23.jpg │ │ ├── 333c0de9_cae2_4458_a675_3560e8525ae5.jpg │ │ ├── 43dd3fe6_4203_41dd_b570_2c9eacb7c021.jpg │ │ ├── 774f83b1_e90d_4ff1_a148_f90af591a865.jpg │ │ ├── 82d1556f_1238_43ce_a5fd_410cc246162e.jpg │ │ ├── ProductImage.png │ │ ├── Thumbs.db │ │ ├── a1c1738a_eaba_4c4c_b683_7c5b4eb64306.jpg │ │ ├── b182e978_85e1_474d_84e3_e505441e9000.jpg │ │ ├── bc0d0d76_3d79_472e_86bb_63a9376d2bab.jpg │ │ ├── bc2dbf1a_699a_4eaf_a49f_4eccc199bb55.jpg │ │ ├── c9285a49_972c_4356_a893_3e2a4e45c17d.jpg │ │ ├── d5d4367d_ab87_4687_8d7c_d1544acf50d1.jpg │ │ ├── d633a09b_479f_4af2_af9d_635b7a59e1b7.jpg │ │ ├── dafeaaed_0b93_45ea_8b04_00dd86c62d5e.jpg │ │ └── dd34e809_b1fc_4c75_b8f9_c5444a64cb47.jpg │ ├── Role_32.png │ ├── SalesOrder_32.png │ ├── Save.png │ ├── ShoppingCart.png │ ├── ShoppingCart.psd │ ├── ShoppingCart256.png │ ├── ShoppingCart32.png │ ├── ShoppingCart64.png │ ├── Success_32.png │ ├── Thumbs.db │ ├── Update.png │ ├── User_32.png │ ├── afterlogo.jpg │ ├── arrows-ffffff.png │ ├── banner.jpg │ ├── byteartretail_logo.png │ ├── byteartretail_logo.psd │ ├── byteartretail_logo_trans.png │ ├── byteartretail_logo_trans.psd │ ├── category.jpg │ ├── close.gif │ ├── favicon.ico │ ├── footer.jpg │ ├── hard.jpg │ ├── header.jpg │ ├── logo.jpg │ ├── menu.jpg │ ├── menu_beforelogo.jpg │ ├── newtovar.jpg │ ├── op.jpg │ ├── pic1.jpg │ ├── pic2.jpg │ ├── pic3.jpg │ ├── pic4.jpg │ ├── picap.jpg │ ├── popular.jpg │ ├── shadow.png │ ├── spacer.gif │ ├── taling.jpg │ ├── taling_center.jpg │ └── trash.jpg ├── Models │ └── LoginModel.cs ├── Properties │ └── AssemblyInfo.cs ├── Scripts │ ├── _references.js │ ├── hoverIntent.js │ ├── i18n │ │ └── grid.locale-en.js │ ├── jquery-1.7.1.intellisense.js │ ├── jquery-1.7.1.js │ ├── jquery-1.7.1.min.js │ ├── jquery-ui-1.8.20.js │ ├── jquery-ui-1.8.20.min.js │ ├── jquery-ui-1.8.23.custom.min.js │ ├── jquery.bgiframe.min.js │ ├── jquery.jqGrid.min.js │ ├── jquery.unobtrusive-ajax.js │ ├── jquery.unobtrusive-ajax.min.js │ ├── jquery.uploadify.js │ ├── jquery.uploadify.min.js │ ├── jquery.validate-vsdoc.js │ ├── jquery.validate.js │ ├── jquery.validate.min.js │ ├── jquery.validate.unobtrusive.js │ ├── jquery.validate.unobtrusive.min.js │ ├── knockout-2.1.0.debug.js │ ├── knockout-2.1.0.js │ ├── modernizr-2.5.3.js │ ├── superfish.js │ └── supersubs.js ├── Views │ ├── Account │ │ ├── Account.cshtml │ │ ├── Login.cshtml │ │ └── Register.cshtml │ ├── Admin │ │ ├── AddCategory.cshtml │ │ ├── AddProduct.cshtml │ │ ├── AddRole.cshtml │ │ ├── AddUserAccount.cshtml │ │ ├── Administration.cshtml │ │ ├── Categories.cshtml │ │ ├── EditCategory.cshtml │ │ ├── EditProduct.cshtml │ │ ├── EditRole.cshtml │ │ ├── EditUserAccount.cshtml │ │ ├── Products.cshtml │ │ ├── Roles.cshtml │ │ ├── SalesOrder.cshtml │ │ ├── SalesOrders.cshtml │ │ └── UserAccounts.cshtml │ ├── Home │ │ ├── About.cshtml │ │ ├── Category.cshtml │ │ ├── Checkout.cshtml │ │ ├── Contact.cshtml │ │ ├── Index.cshtml │ │ ├── Product.cshtml │ │ ├── SalesOrder.cshtml │ │ ├── SalesOrders.cshtml │ │ ├── ShoppingCart.cshtml │ │ └── SuccessPage.cshtml │ ├── Shared │ │ ├── CategoriesPartial.cshtml │ │ ├── Error.cshtml │ │ ├── FeaturedProductsPartial.cshtml │ │ ├── ProductsPartial.cshtml │ │ ├── _Layout.cshtml │ │ └── _LoginPartial.cshtml │ ├── Web.config │ └── _ViewStart.cshtml ├── Web.Debug.config ├── Web.Release.config ├── Web.config └── packages.config ├── ByteartRetail_V3_Kai.sln └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs) 2 | [Bb]in/ 3 | [Oo]bj/ 4 | 5 | # mstest test results 6 | TestResults 7 | 8 | ## Ignore Visual Studio temporary files, build results, and 9 | ## files generated by popular Visual Studio add-ons. 10 | 11 | # User-specific files 12 | *.suo 13 | *.user 14 | *.sln.docstates 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Rr]elease/ 19 | x64/ 20 | *_i.c 21 | *_p.c 22 | *.ilk 23 | *.meta 24 | *.obj 25 | *.pch 26 | *.pdb 27 | *.pgc 28 | *.pgd 29 | *.rsp 30 | *.sbr 31 | *.tlb 32 | *.tli 33 | *.tlh 34 | *.tmp 35 | *.log 36 | *.vspscc 37 | *.vssscc 38 | .builds 39 | 40 | # Visual C++ cache files 41 | ipch/ 42 | *.aps 43 | *.ncb 44 | *.opensdf 45 | *.sdf 46 | 47 | # Visual Studio profiler 48 | *.psess 49 | *.vsp 50 | *.vspx 51 | 52 | # Guidance Automation Toolkit 53 | *.gpState 54 | 55 | # ReSharper is a .NET coding add-in 56 | _ReSharper* 57 | 58 | # NCrunch 59 | *.ncrunch* 60 | .*crunch*.local.xml 61 | 62 | # Installshield output folder 63 | [Ee]xpress 64 | 65 | # DocProject is a documentation generator add-in 66 | DocProject/buildhelp/ 67 | DocProject/Help/*.HxT 68 | DocProject/Help/*.HxC 69 | DocProject/Help/*.hhc 70 | DocProject/Help/*.hhk 71 | DocProject/Help/*.hhp 72 | DocProject/Help/Html2 73 | DocProject/Help/html 74 | 75 | # Click-Once directory 76 | publish 77 | 78 | # Publish Web Output 79 | *.Publish.xml 80 | 81 | # NuGet Packages Directory 82 | packages 83 | 84 | # Windows Azure Build Output 85 | csx 86 | *.build.csdef 87 | 88 | # Windows Store app package directory 89 | AppPackages/ 90 | 91 | # Others 92 | [Bb]in 93 | [Oo]bj 94 | sql 95 | TestResults 96 | [Tt]est[Rr]esult* 97 | *.Cache 98 | ClientBin 99 | [Ss]tyle[Cc]op.* 100 | ~$* 101 | *.dbmdl 102 | Generated_Code #added for RIA/Silverlight projects 103 | 104 | # Backup & report files from converting an old project file to a newer 105 | # Visual Studio version. Backup files are not needed, because we have git ;-) 106 | _UpgradeReport_Files/ 107 | Backup*/ 108 | UpgradeLog*.XML 109 | -------------------------------------------------------------------------------- /.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.nuget/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/.nuget/NuGet.exe -------------------------------------------------------------------------------- /ByteartRetail.Application/Implementation/PostbackServiceImpl.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Repositories; 2 | using ByteartRetail.DataObjects; 3 | using ByteartRetail.ServiceContracts; 4 | using System; 5 | 6 | namespace ByteartRetail.Application.Implementation 7 | { 8 | /// 9 | /// 表示与“服务器信息回发”相关的一种服务实现。 10 | /// 11 | public class PostbackServiceImpl : ApplicationService, IPostbackService 12 | { 13 | #region Ctor 14 | /// 15 | /// 初始化一个新的PostbackServiceImpl实例。 16 | /// 17 | /// 用来初始化PostbackServiceImpl类型的仓储上下文实例。 18 | public PostbackServiceImpl(IRepositoryContext context) : base(context) { } 19 | #endregion 20 | 21 | #region IPostbackService Members 22 | 23 | /// 24 | /// 创建商品信息。 25 | /// 26 | /// 已创建的商品信息。 27 | public PostbackDataObject GetPostback() 28 | { 29 | var result = new PostbackDataObject 30 | { 31 | ID = Guid.NewGuid().ToString(), 32 | ServerArchitecture = string.Format("{0} processors on {1} bit OS.", Environment.ProcessorCount, Environment.Is64BitOperatingSystem ? "64" : "32"), 33 | ServerDateTime = DateTime.Now, 34 | ServerOS = Environment.OSVersion.ToString(), 35 | MachineName = Environment.MachineName, 36 | CLRVersion = Environment.Version.ToString() 37 | }; 38 | 39 | return result; 40 | } 41 | 42 | #endregion 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /ByteartRetail.Application/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ByteartRetail.Application")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ByteartRetail.Application")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("a6a69f39-9da4-48fb-b21c-1ccf8b061456")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ByteartRetail.Application/QuerySpecExtension.cs: -------------------------------------------------------------------------------- 1 | using ByteartRetail.DataObjects; 2 | 3 | namespace ByteartRetail.Application 4 | { 5 | public static class QuerySpecExtension 6 | { 7 | public static bool IsVerbose(this QuerySpec spec) 8 | { 9 | return spec.Verbose ?? false; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ByteartRetail.Application/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ByteartRetail.DataObjects/AddressDataObject.xsd: -------------------------------------------------------------------------------- 1 |  2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /ByteartRetail.DataObjects/CategorizationDataObject.xsd: -------------------------------------------------------------------------------- 1 |  2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /ByteartRetail.DataObjects/CategoryDataObject.xsd: -------------------------------------------------------------------------------- 1 |  2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /ByteartRetail.DataObjects/FaultData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | using System.ServiceModel; 4 | 5 | namespace ByteartRetail.DataObjects 6 | { 7 | /// 8 | /// Represents the data to be transferred through the 9 | /// network which contains the fault exception information. 10 | /// 11 | [DataContract] 12 | public class FaultData 13 | { 14 | #region Public Properties 15 | /// 16 | /// Gets or sets the message of the fault data. 17 | /// 18 | [DataMember(Order = 0)] 19 | public string Message { get; set; } 20 | /// 21 | /// Gets or sets the full message of the fault data. 22 | /// 23 | [DataMember(Order = 1)] 24 | public string FullMessage { get; set; } 25 | /// 26 | /// Gets or sets the stack trace information of the fault exception. 27 | /// 28 | [DataMember(Order = 2)] 29 | public string StackTrace { get; set; } 30 | #endregion 31 | 32 | #region Public Static Methods 33 | /// 34 | /// Creates a new instance of FaultData class from the specified object. 35 | /// 36 | /// The object which carries the error information. 37 | /// A new instance of FaultData class. 38 | public static FaultData CreateFromException(Exception ex) 39 | { 40 | return new FaultData 41 | { 42 | Message = ex.Message, 43 | FullMessage = ex.ToString(), 44 | StackTrace = ex.StackTrace 45 | }; 46 | } 47 | /// 48 | /// Creates a new instance of class from the specified object. 49 | /// 50 | /// The object which carries the error information. 51 | /// A new instance of class. 52 | public static FaultReason CreateFaultReason(Exception ex) 53 | { 54 | return new FaultReason(ex.Message); 55 | } 56 | #endregion 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /ByteartRetail.DataObjects/GenerateDataObjects.cmd: -------------------------------------------------------------------------------- 1 | svcutil.exe /dconly /n:*,ByteartRetail.DataObjects /l:cs /o:ByteartRetailDataObjects.cs *.xsd 2 | -------------------------------------------------------------------------------- /ByteartRetail.DataObjects/PostbackDataObject.xsd: -------------------------------------------------------------------------------- 1 |  2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /ByteartRetail.DataObjects/ProductDataObject.xsd: -------------------------------------------------------------------------------- 1 |  2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ByteartRetail.DataObjects/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ByteartRetail.DataObjects")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ByteartRetail.DataObjects")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("fba93f93-9f26-4b7d-a347-c921ea0562f3")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ByteartRetail.DataObjects/QuerySpec.xsd: -------------------------------------------------------------------------------- 1 |  2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ByteartRetail.DataObjects/RoleDataObject.xsd: -------------------------------------------------------------------------------- 1 |  2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /ByteartRetail.DataObjects/SalesLineDataObject.xsd: -------------------------------------------------------------------------------- 1 |  2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /ByteartRetail.DataObjects/SalesOrderDataObject.xsd: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /ByteartRetail.DataObjects/SalesOrderStatusDataObject.xsd: -------------------------------------------------------------------------------- 1 |  2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /ByteartRetail.DataObjects/ShoppingCartDataObject.xsd: -------------------------------------------------------------------------------- 1 |  2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ByteartRetail.DataObjects/ShoppingCartItemDataObject.xsd: -------------------------------------------------------------------------------- 1 |  2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /ByteartRetail.DataObjects/UserDataObject.xsd: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/EntityFramework/ByteartRetailDbContextInitailizer.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Entity; 2 | 3 | namespace ByteartRetail.Domain.Repositories.EntityFramework 4 | { 5 | /// 6 | /// 表示由Byteart Retail专用的数据访问上下文初始化器。 7 | /// 8 | public sealed class ByteartRetailDbContextInitailizer : DropCreateDatabaseIfModelChanges 9 | { 10 | // 请在使用ByteartRetailDbContextInitializer作为数据库初始化器(Database Initializer)时,去除以下代码行 11 | // 的注释,以便在数据库重建时,相应的SQL脚本会被执行。对于已有数据库的情况,请直接注释掉以下代码行。 12 | //protected override void Seed(ByteartRetailDbContext context) 13 | //{ 14 | // context.Database.ExecuteSqlCommand("CREATE UNIQUE INDEX IDX_CUSTOMER_USERNAME ON Customers(UserName)"); 15 | // context.Database.ExecuteSqlCommand("CREATE UNIQUE INDEX IDX_CUSTOMER_EMAIL ON Customers(Email)"); 16 | // context.Database.ExecuteSqlCommand("CREATE UNIQUE INDEX IDX_LAPTOP_NAME ON Laptops(Name)"); 17 | // base.Seed(context); 18 | //} 19 | 20 | /// 21 | /// 执行对数据库的初始化操作。 22 | /// 23 | public static void Initialize() 24 | { 25 | Database.SetInitializer(null); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/EntityFramework/CategoryRepository.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Repositories; 2 | using Apworks.Repositories.EntityFramework; 3 | using ByteartRetail.Domain.Model; 4 | 5 | namespace ByteartRetail.Domain.Repositories.EntityFramework 6 | { 7 | public class CategoryRepository : EntityFrameworkRepository, ICategoryRepository 8 | { 9 | public CategoryRepository(IRepositoryContext context) : base(context) { } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/EntityFramework/ModelConfigurations/CategorizationTypeConfiguration.cs: -------------------------------------------------------------------------------- 1 | using ByteartRetail.Domain.Model; 2 | using System.ComponentModel.DataAnnotations.Schema; 3 | using System.Data.Entity.ModelConfiguration; 4 | 5 | namespace ByteartRetail.Domain.Repositories.EntityFramework.ModelConfigurations 6 | { 7 | public class CategorizationTypeConfiguration : EntityTypeConfiguration 8 | { 9 | public CategorizationTypeConfiguration() 10 | { 11 | HasKey(c => c.ID); 12 | Property(c => c.ID) 13 | .IsRequired() 14 | .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity); 15 | Property(c => c.ProductID) 16 | .IsRequired(); 17 | Property(c => c.CategoryID) 18 | .IsRequired(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/EntityFramework/ModelConfigurations/CategoryTypeConfiguration.cs: -------------------------------------------------------------------------------- 1 | using ByteartRetail.Domain.Model; 2 | using System; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | using System.Data.Entity.ModelConfiguration; 5 | 6 | namespace ByteartRetail.Domain.Repositories.EntityFramework.ModelConfigurations 7 | { 8 | public class CategoryTypeConfiguration : EntityTypeConfiguration 9 | { 10 | public CategoryTypeConfiguration() 11 | { 12 | HasKey(c => c.ID); 13 | Property(c => c.ID) 14 | .IsRequired() 15 | .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity); 16 | Property(c => c.Name) 17 | .IsRequired() 18 | .HasMaxLength(25); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/EntityFramework/ModelConfigurations/ProductTypeConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Entity.ModelConfiguration; 2 | using ByteartRetail.Domain.Model; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | 5 | namespace ByteartRetail.Domain.Repositories.EntityFramework.ModelConfigurations 6 | { 7 | /// 8 | /// Represents the entity type configuration for the 9 | /// Laptop 10 | /// 11 | /// entity. 12 | /// 13 | public class ProductTypeConfiguration : EntityTypeConfiguration 14 | { 15 | #region Ctor 16 | /// 17 | /// Initializes a new instance of LaptopTypeConfiguration class. 18 | /// 19 | public ProductTypeConfiguration() 20 | { 21 | HasKey(l => l.ID); 22 | Property(p => p.ID) 23 | .IsRequired() 24 | .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity); 25 | Property(p => p.Description) 26 | .IsRequired(); 27 | Property(p => p.Name) 28 | .IsRequired() 29 | .HasMaxLength(40); 30 | Property(p => p.ImageUrl) 31 | .HasMaxLength(255); 32 | } 33 | #endregion 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/EntityFramework/ModelConfigurations/RoleTypeConfiguration.cs: -------------------------------------------------------------------------------- 1 | using ByteartRetail.Domain.Model; 2 | using System.ComponentModel.DataAnnotations.Schema; 3 | using System.Data.Entity.ModelConfiguration; 4 | 5 | namespace ByteartRetail.Domain.Repositories.EntityFramework.ModelConfigurations 6 | { 7 | public class RoleTypeConfiguration : EntityTypeConfiguration 8 | { 9 | public RoleTypeConfiguration() 10 | { 11 | HasKey(c => c.ID); 12 | Property(c => c.ID) 13 | .IsRequired() 14 | .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity); 15 | Property(c => c.Name) 16 | .IsRequired() 17 | .HasMaxLength(25); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/EntityFramework/ModelConfigurations/SalesLineTypeConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Entity.ModelConfiguration; 2 | using ByteartRetail.Domain.Model; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | 5 | namespace ByteartRetail.Domain.Repositories.EntityFramework.ModelConfigurations 6 | { 7 | public class SalesLineTypeConfiguration : EntityTypeConfiguration 8 | { 9 | public SalesLineTypeConfiguration() 10 | { 11 | HasKey(s => s.ID); 12 | Property(p => p.ID) 13 | .IsRequired() 14 | .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity); 15 | HasRequired(p => p.SalesOrder) 16 | .WithMany(p => p.SalesLines); 17 | Ignore(p => p.LineAmount); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/EntityFramework/ModelConfigurations/SalesOrderTypeConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Entity.ModelConfiguration; 2 | using ByteartRetail.Domain.Model; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | 5 | namespace ByteartRetail.Domain.Repositories.EntityFramework.ModelConfigurations 6 | { 7 | public class SalesOrderTypeConfiguration : EntityTypeConfiguration 8 | { 9 | public SalesOrderTypeConfiguration() 10 | { 11 | HasKey(s => s.ID); 12 | Property(s => s.ID) 13 | .IsRequired() 14 | .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity); 15 | Ignore(p => p.Subtotal); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/EntityFramework/ModelConfigurations/ShoppingCartItemTypeConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Entity.ModelConfiguration; 2 | using ByteartRetail.Domain.Model; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | 5 | namespace ByteartRetail.Domain.Repositories.EntityFramework.ModelConfigurations 6 | { 7 | public class ShoppingCartItemTypeConfiguration : EntityTypeConfiguration 8 | { 9 | public ShoppingCartItemTypeConfiguration() 10 | { 11 | HasKey(c => c.ID); 12 | Property(c => c.ID) 13 | .IsRequired() 14 | .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity); 15 | Ignore(p => p.LineAmount); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/EntityFramework/ModelConfigurations/ShoppingCartTypeConfiguration.cs: -------------------------------------------------------------------------------- 1 | using ByteartRetail.Domain.Model; 2 | using System.ComponentModel.DataAnnotations.Schema; 3 | using System.Data.Entity.ModelConfiguration; 4 | 5 | namespace ByteartRetail.Domain.Repositories.EntityFramework.ModelConfigurations 6 | { 7 | public class ShoppingCartTypeConfiguration : EntityTypeConfiguration 8 | { 9 | public ShoppingCartTypeConfiguration() 10 | { 11 | HasKey(c => c.ID); 12 | Property(c => c.ID) 13 | .IsRequired() 14 | .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/EntityFramework/ModelConfigurations/UserRoleTypeConfiguration.cs: -------------------------------------------------------------------------------- 1 | using ByteartRetail.Domain.Model; 2 | using System.ComponentModel.DataAnnotations.Schema; 3 | using System.Data.Entity.ModelConfiguration; 4 | 5 | namespace ByteartRetail.Domain.Repositories.EntityFramework.ModelConfigurations 6 | { 7 | public class UserRoleTypeConfiguration : EntityTypeConfiguration 8 | { 9 | public UserRoleTypeConfiguration() 10 | { 11 | HasKey(ur => ur.ID); 12 | Property(ur => ur.ID) 13 | .IsRequired() 14 | .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity); 15 | Property(ur => ur.RoleID) 16 | .IsRequired(); 17 | Property(ur => ur.UserID) 18 | .IsRequired(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/EntityFramework/ModelConfigurations/UserTypeConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Entity.ModelConfiguration; 2 | using ByteartRetail.Domain.Model; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | 5 | namespace ByteartRetail.Domain.Repositories.EntityFramework.ModelConfigurations 6 | { 7 | /// 8 | /// Represents the entity type configuration for the 9 | /// Customer 10 | /// 11 | /// entity. 12 | /// 13 | public class UserTypeConfiguration : EntityTypeConfiguration 14 | { 15 | #region Ctor 16 | /// 17 | /// Initializes a new instance of CustomerTypeConfiguration class. 18 | /// 19 | public UserTypeConfiguration() 20 | { 21 | HasKey(c => c.ID); 22 | Property(c => c.ID) 23 | .IsRequired() 24 | .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity); 25 | Property(c => c.UserName) 26 | .IsRequired() 27 | .HasMaxLength(20); 28 | Property(c => c.Password) 29 | .IsRequired() 30 | .HasMaxLength(20); 31 | Property(c => c.Email) 32 | .IsRequired() 33 | .HasMaxLength(80); 34 | 35 | ToTable("Users"); 36 | } 37 | #endregion 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/EntityFramework/ProductRepository.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Repositories; 2 | using Apworks.Repositories.EntityFramework; 3 | using ByteartRetail.Domain.Model; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | 7 | namespace ByteartRetail.Domain.Repositories.EntityFramework 8 | { 9 | /// 10 | /// 表示Product仓储的一个具体实现。 11 | /// 12 | public class ProductRepository : EntityFrameworkRepository, IProductRepository 13 | { 14 | #region Ctor 15 | public ProductRepository(IRepositoryContext context) : base(context) { } 16 | #endregion 17 | 18 | #region IProductRepository Members 19 | /// 20 | /// 获取特色商品的列表。 21 | /// 22 | /// 需要获取的特色商品的个数。默认值:0,表示获取所有特色商品。 23 | /// 特色商品列表。 24 | public IEnumerable GetFeaturedProducts(int count = 0) 25 | { 26 | var ctx = EFContext.Context as ByteartRetailDbContext; 27 | if (ctx != null) 28 | { 29 | var query = from p in ctx.Products 30 | where p.IsFeatured 31 | select p; 32 | return count == 0 ? query.ToList() : query.Take(count).ToList(); 33 | } 34 | return null; 35 | } 36 | 37 | #endregion 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/EntityFramework/RoleRepository.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Repositories; 2 | using Apworks.Repositories.EntityFramework; 3 | using ByteartRetail.Domain.Model; 4 | 5 | namespace ByteartRetail.Domain.Repositories.EntityFramework 6 | { 7 | public class RoleRepository : EntityFrameworkRepository, IRoleRepository 8 | { 9 | public RoleRepository(IRepositoryContext context) 10 | : base(context) 11 | { } 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/EntityFramework/SalesOrderRepository.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Repositories; 2 | using Apworks.Repositories.EntityFramework; 3 | using Apworks.Storage; 4 | using ByteartRetail.Domain.Model; 5 | using System; 6 | using System.Collections.Generic; 7 | using ByteartRetail.Domain.Repositories.Specifications; 8 | 9 | namespace ByteartRetail.Domain.Repositories.EntityFramework 10 | { 11 | public class SalesOrderRepository : EntityFrameworkRepository, ISalesOrderRepository 12 | { 13 | public SalesOrderRepository(IRepositoryContext context) 14 | : base(context) 15 | { } 16 | 17 | #region ISalesOrderRepository Members 18 | 19 | public IEnumerable FindSalesOrdersByUser(User user) 20 | { 21 | return FindAll(new SalesOrderBelongsToUserSpecification(user), sp => sp.DateCreated, SortOrder.Descending); 22 | } 23 | 24 | public SalesOrder GetSalesOrderByID(Guid orderID) 25 | { 26 | return Find(new SalesOrderIDEqualsSpecification(orderID), elp => elp.SalesLines); 27 | } 28 | 29 | #endregion 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/EntityFramework/ShoppingCartItemRepository.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Repositories; 2 | using Apworks.Repositories.EntityFramework; 3 | using Apworks.Specifications; 4 | using ByteartRetail.Domain.Model; 5 | using System.Collections.Generic; 6 | using ByteartRetail.Domain.Repositories.Specifications; 7 | 8 | namespace ByteartRetail.Domain.Repositories.EntityFramework 9 | { 10 | public class ShoppingCartItemRepository : EntityFrameworkRepository, IShoppingCartItemRepository 11 | { 12 | public ShoppingCartItemRepository(IRepositoryContext context) 13 | : base(context) 14 | { } 15 | 16 | #region IShoppingCartItemRepository Members 17 | 18 | public ShoppingCartItem FindItem(ShoppingCart shoppingCart, Product product) 19 | { 20 | return Find(Specification.Eval(sci => sci.ShoppingCart.ID == shoppingCart.ID && 21 | sci.Product.ID == product.ID), elp => elp.Product); 22 | } 23 | 24 | public IEnumerable FindItemsByCart(ShoppingCart cart) 25 | { 26 | // ReSharper disable PossiblyMistakenUseOfParamsMethod 27 | return FindAll(new ShoppingCartItemBelongsToShoppingCartSpecification(cart), elp => elp.Product); 28 | // ReSharper restore PossiblyMistakenUseOfParamsMethod 29 | } 30 | 31 | #endregion 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/EntityFramework/ShoppingCartRepository.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Repositories; 2 | using Apworks.Repositories.EntityFramework; 3 | using ByteartRetail.Domain.Model; 4 | using ByteartRetail.Domain.Repositories.Specifications; 5 | 6 | namespace ByteartRetail.Domain.Repositories.EntityFramework 7 | { 8 | public class ShoppingCartRepository : EntityFrameworkRepository, IShoppingCartRepository 9 | { 10 | public ShoppingCartRepository(IRepositoryContext context) 11 | : base(context) 12 | { 13 | 14 | } 15 | 16 | #region IShoppingCartRepository Members 17 | 18 | public ShoppingCart FindShoppingCartByUser(User user) 19 | { 20 | return Find(new ShoppingCartBelongsToCustomerSpecification(user)); 21 | } 22 | 23 | #endregion 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/EntityFramework/UserRepository.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Repositories; 2 | using Apworks.Repositories.EntityFramework; 3 | using Apworks.Specifications; 4 | using ByteartRetail.Domain.Model; 5 | using ByteartRetail.Domain.Repositories.Specifications; 6 | 7 | namespace ByteartRetail.Domain.Repositories.EntityFramework 8 | { 9 | public class UserRepository : EntityFrameworkRepository, IUserRepository 10 | { 11 | public UserRepository(IRepositoryContext context) 12 | : base(context) 13 | { } 14 | 15 | #region ICustomerRepository Members 16 | 17 | public bool UserNameExists(string userName) 18 | { 19 | return Exists(new UserNameEqualsSpecification(userName)); 20 | } 21 | 22 | public bool EmailExists(string email) 23 | { 24 | return Exists(new UserEmailEqualsSpecification(email)); 25 | } 26 | 27 | public bool CheckPassword(string userName, string password) 28 | { 29 | return Exists(new AndSpecification(new UserNameEqualsSpecification(userName), 30 | new UserPasswordEqualsSpecification(password))); 31 | } 32 | 33 | public User GetUserByName(string userName) 34 | { 35 | return Find(new UserNameEqualsSpecification(userName)); 36 | } 37 | 38 | public User GetUserByEmail(string email) 39 | { 40 | return Find(new UserEmailEqualsSpecification(email)); 41 | } 42 | #endregion 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/EntityFramework/UserRoleRepository.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Repositories; 2 | using Apworks.Repositories.EntityFramework; 3 | using ByteartRetail.Domain.Model; 4 | using System; 5 | using System.Linq; 6 | 7 | namespace ByteartRetail.Domain.Repositories.EntityFramework 8 | { 9 | public class UserRoleRepository : EntityFrameworkRepository, IUserRoleRepository 10 | { 11 | public UserRoleRepository(IRepositoryContext context) 12 | : base(context) { } 13 | 14 | public Role GetRoleForUser(User user) 15 | { 16 | var context = EFContext.Context as ByteartRetailDbContext; 17 | if (context != null) 18 | { 19 | var query = from role in context.Roles 20 | from userRole in context.UserRoles 21 | from usr in context.Users 22 | where role.ID == userRole.RoleID && 23 | usr.ID == userRole.UserID && 24 | usr.ID == user.ID 25 | select role; 26 | return query.FirstOrDefault(); 27 | } 28 | throw new InvalidOperationException("The provided repository context is invalid."); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ByteartRetail.Domain.Repositories")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ByteartRetail.Domain.Repositories")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("bf329d19-7c72-45cb-b1ff-128ef2caef7d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/Specifications/SalesOrderBelongsToUserSpecification.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Apworks.Specifications; 3 | using ByteartRetail.Domain.Model; 4 | 5 | namespace ByteartRetail.Domain.Repositories.Specifications 6 | { 7 | internal class SalesOrderBelongsToUserSpecification : Specification 8 | { 9 | private readonly User _user; 10 | 11 | public SalesOrderBelongsToUserSpecification(User user) 12 | { 13 | _user = user; 14 | } 15 | 16 | public override System.Linq.Expressions.Expression> GetExpression() 17 | { 18 | return so => so.User.ID == _user.ID; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/Specifications/SalesOrderIDEqualsSpecification.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Apworks.Specifications; 3 | using ByteartRetail.Domain.Model; 4 | 5 | namespace ByteartRetail.Domain.Repositories.Specifications 6 | { 7 | public class SalesOrderIDEqualsSpecification : Specification 8 | { 9 | private readonly Guid _orderID; 10 | 11 | public SalesOrderIDEqualsSpecification(Guid orderID) 12 | { 13 | _orderID = orderID; 14 | } 15 | 16 | public override System.Linq.Expressions.Expression> GetExpression() 17 | { 18 | return p => p.ID == _orderID; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/Specifications/ShoppingCartBelongsToCustomerSpecification.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Apworks.Specifications; 3 | using ByteartRetail.Domain.Model; 4 | 5 | namespace ByteartRetail.Domain.Repositories.Specifications 6 | { 7 | internal class ShoppingCartBelongsToCustomerSpecification : Specification 8 | { 9 | private readonly User _user; 10 | 11 | 12 | public ShoppingCartBelongsToCustomerSpecification(User user) 13 | { 14 | _user = user; 15 | } 16 | 17 | public override System.Linq.Expressions.Expression> GetExpression() 18 | { 19 | return c => c.User.ID == _user.ID; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/Specifications/ShoppingCartItemBelongsToShoppingCartSpecification.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Apworks.Specifications; 3 | using ByteartRetail.Domain.Model; 4 | 5 | namespace ByteartRetail.Domain.Repositories.Specifications 6 | { 7 | internal class ShoppingCartItemBelongsToShoppingCartSpecification : Specification 8 | { 9 | private readonly ShoppingCart _shoppingCart; 10 | 11 | public ShoppingCartItemBelongsToShoppingCartSpecification(ShoppingCart shoppingCart) 12 | { 13 | _shoppingCart = shoppingCart; 14 | } 15 | 16 | public override System.Linq.Expressions.Expression> GetExpression() 17 | { 18 | // 注意:在以前的版本中,由于Repository中在获取对象时,Where使用的是Specification.IsSatisifedBy 19 | // 函数作为参数,就导致EF采用了Where的Func重载版本,于是EF会把所有的数据从数据库中读出,然后在内存 20 | // 中作筛选。而从V3开始,Repository使用Specification.GetExpression作查询筛选,因此调用的是IQueryable 21 | // 接口上的Where重载,导致EF到数据库中做数据筛选,但是这种筛选方式不支持对象的比对,所以在这里需要根据 22 | // ID进行对象相等的认定。 23 | return p => p.ShoppingCart.ID == _shoppingCart.ID; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/Specifications/UserEmailEqualsSpecification.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using ByteartRetail.Domain.Model; 3 | 4 | namespace ByteartRetail.Domain.Repositories.Specifications 5 | { 6 | internal class UserEmailEqualsSpecification : UserStringEqualsSpecification 7 | { 8 | public UserEmailEqualsSpecification(string email) 9 | : base(email) 10 | { } 11 | 12 | public override System.Linq.Expressions.Expression> GetExpression() 13 | { 14 | return c => c.Email == Value; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/Specifications/UserNameEqualsSpecification.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using ByteartRetail.Domain.Model; 3 | 4 | namespace ByteartRetail.Domain.Repositories.Specifications 5 | { 6 | internal class UserNameEqualsSpecification : UserStringEqualsSpecification 7 | { 8 | public UserNameEqualsSpecification(string userName) 9 | : base(userName) 10 | { 11 | 12 | } 13 | 14 | public override System.Linq.Expressions.Expression> GetExpression() 15 | { 16 | return c => c.UserName == Value; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/Specifications/UserPasswordEqualsSpecification.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using ByteartRetail.Domain.Model; 3 | 4 | namespace ByteartRetail.Domain.Repositories.Specifications 5 | { 6 | internal class UserPasswordEqualsSpecification : UserStringEqualsSpecification 7 | { 8 | 9 | public UserPasswordEqualsSpecification(string password) 10 | : base(password) 11 | { 12 | } 13 | 14 | public override System.Linq.Expressions.Expression> GetExpression() 15 | { 16 | return c => c.Password == Value; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/Specifications/UserStringEqualsSpecification.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Specifications; 2 | using ByteartRetail.Domain.Model; 3 | 4 | namespace ByteartRetail.Domain.Repositories.Specifications 5 | { 6 | internal abstract class UserStringEqualsSpecification : Specification 7 | { 8 | protected readonly string Value; 9 | 10 | protected UserStringEqualsSpecification(string value) 11 | { 12 | this.Value = value; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ByteartRetail.Domain.Repositories/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Events/GetUserOrdersEvent.cs: -------------------------------------------------------------------------------- 1 | using Apworks; 2 | using Apworks.Events; 3 | using System; 4 | using System.Collections.Generic; 5 | using ByteartRetail.Domain.Model; 6 | 7 | namespace ByteartRetail.Domain.Events 8 | { 9 | [Serializable] 10 | public class GetUserOrdersEvent : DomainEvent 11 | { 12 | public GetUserOrdersEvent(IEntity source) : base(source) { } 13 | 14 | public IEnumerable SalesOrders { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Events/Handlers/GetUserOrdersEventHandler.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Events; 2 | using ByteartRetail.Domain.Model; 3 | using ByteartRetail.Domain.Repositories; 4 | 5 | namespace ByteartRetail.Domain.Events.Handlers 6 | { 7 | [ParallelExecution] 8 | public class GetUserOrdersEventHandler : IDomainEventHandler 9 | { 10 | private readonly ISalesOrderRepository _salesOrderRepository; 11 | 12 | public GetUserOrdersEventHandler(ISalesOrderRepository salesOrderRepository) 13 | { 14 | _salesOrderRepository = salesOrderRepository; 15 | } 16 | 17 | public void Handle(GetUserOrdersEvent evnt) 18 | { 19 | var user = evnt.Source as User; 20 | evnt.SalesOrders = _salesOrderRepository.FindSalesOrdersByUser(user); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Events/Handlers/OrderConfirmedEventHandler.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Bus; 2 | using Apworks.Events; 3 | using ByteartRetail.Domain.Model; 4 | 5 | namespace ByteartRetail.Domain.Events.Handlers 6 | { 7 | public class OrderConfirmedEventHandler : IDomainEventHandler 8 | { 9 | private readonly IEventBus _bus; 10 | 11 | public OrderConfirmedEventHandler(IEventBus bus) 12 | { 13 | _bus = bus; 14 | } 15 | 16 | public void Handle(OrderConfirmedEvent evnt) 17 | { 18 | var salesOrder = evnt.Source as SalesOrder; 19 | if (salesOrder != null) 20 | { 21 | salesOrder.DateDelivered = evnt.ConfirmedDate; 22 | salesOrder.Status = SalesOrderStatus.Delivered; 23 | } 24 | 25 | _bus.Publish(evnt); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Events/Handlers/OrderDispatchedEventHandler.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Bus; 2 | using Apworks.Events; 3 | using ByteartRetail.Domain.Model; 4 | using ByteartRetail.Domain.Repositories; 5 | 6 | namespace ByteartRetail.Domain.Events.Handlers 7 | { 8 | public class OrderDispatchedEventHandler : IDomainEventHandler 9 | { 10 | private readonly ISalesOrderRepository _salesOrderRepository; 11 | private readonly IEventBus _bus; 12 | 13 | public OrderDispatchedEventHandler(ISalesOrderRepository salesOrderRepository, IEventBus bus) 14 | { 15 | _salesOrderRepository = salesOrderRepository; 16 | _bus = bus; 17 | } 18 | 19 | public void Handle(OrderDispatchedEvent evnt) 20 | { 21 | var salesOrder = evnt.Source as SalesOrder; 22 | if (salesOrder != null) 23 | { 24 | salesOrder.DateDispatched = evnt.DispatchedDate; 25 | salesOrder.Status = SalesOrderStatus.Dispatched; 26 | } 27 | 28 | _bus.Publish(evnt); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Events/OrderConfirmedEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Apworks; 3 | using Apworks.Events; 4 | 5 | namespace ByteartRetail.Domain.Events 6 | { 7 | /// 8 | /// 表示订单确认的领域事件。 9 | /// 10 | [Serializable] 11 | public class OrderConfirmedEvent : DomainEvent 12 | { 13 | #region Ctor 14 | public OrderConfirmedEvent() { } 15 | public OrderConfirmedEvent(IEntity source) : base(source) { } 16 | #endregion 17 | 18 | #region Public Properties 19 | /// 20 | /// 获取或设置订单确认的日期。 21 | /// 22 | public DateTime ConfirmedDate { get; set; } 23 | public string UserEmailAddress { get; set; } 24 | public Guid OrderID { get; set; } 25 | #endregion 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Events/OrderDispatchedEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Apworks; 3 | using Apworks.Events; 4 | 5 | namespace ByteartRetail.Domain.Events 6 | { 7 | /// 8 | /// 表示当针对某销售订单进行发货时所产生的领域事件。 9 | /// 10 | [Serializable] 11 | public class OrderDispatchedEvent : DomainEvent 12 | { 13 | #region Ctor 14 | public OrderDispatchedEvent() { } 15 | public OrderDispatchedEvent(IEntity source) : base(source) { } 16 | #endregion 17 | 18 | #region Public Properties 19 | /// 20 | /// 获取或设置订单发货的日期。 21 | /// 22 | public DateTime DispatchedDate { get; set; } 23 | public string UserEmailAddress { get; set; } 24 | public Guid OrderID { get; set; } 25 | #endregion 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Model/Categorization.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Apworks; 3 | 4 | namespace ByteartRetail.Domain.Model 5 | { 6 | /// 7 | /// 表示商品的分类信息的对象。 8 | /// 9 | public class Categorization : IAggregateRoot 10 | { 11 | #region Ctor 12 | /// 13 | /// 初始化一个Categorization类型的实例。 14 | /// 15 | public Categorization() { } 16 | /// 17 | /// 初始化一个Categorization类型的实例。 18 | /// 19 | /// 类别对象的ID。 20 | /// 商品对象的ID。 21 | public Categorization(Guid productID, Guid categoryID) 22 | { 23 | CategoryID = categoryID; 24 | ProductID = productID; 25 | } 26 | #endregion 27 | 28 | #region Properties 29 | public Guid ID { get; set; } 30 | 31 | /// 32 | /// 获取或设置类别对象的ID。 33 | /// 34 | public Guid CategoryID { get; set; } 35 | 36 | /// 37 | /// 获取或设置商品对象的ID。 38 | /// 39 | public Guid ProductID { get; set; } 40 | 41 | #endregion 42 | 43 | #region Public Methods 44 | /// 45 | /// 返回表示当前Object的字符串。 46 | /// 47 | /// 表示当前对象的字符串。 48 | public override string ToString() 49 | { 50 | return string.Format("CategoryID: {0}, ProductID: {1}", CategoryID, ProductID); 51 | } 52 | /// 53 | /// 创建商品与分类之间的关系。 54 | /// 55 | /// 商品实体。 56 | /// 分类实体。 57 | /// 描述商品与分类之间关系的实体。 58 | public static Categorization CreateCategorization(Product product, Category category) 59 | { 60 | return new Categorization(product.ID, category.ID); 61 | } 62 | #endregion 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Model/Category.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Apworks; 3 | 4 | namespace ByteartRetail.Domain.Model 5 | { 6 | /// 7 | /// 表示商品类别的对象。 8 | /// 9 | public class Category : IAggregateRoot 10 | { 11 | #region Ctor 12 | /// 13 | /// 初始化一个Category类型的实例。 14 | /// 15 | public Category() { } 16 | /// 17 | /// 初始化一个Category类型的实例。 18 | /// 19 | /// 商品分类的名称。 20 | /// 商品分类的描述信息。 21 | public Category(string name, string description) 22 | { 23 | Name = name; 24 | Description = description; 25 | } 26 | #endregion 27 | 28 | #region Properties 29 | public Guid ID { get; set; } 30 | 31 | /// 32 | /// 获取或设置商品分类的名称。 33 | /// 34 | public string Name { get; set; } 35 | 36 | /// 37 | /// 获取或设置商品分类的描述信息。 38 | /// 39 | public string Description { get; set; } 40 | 41 | #endregion 42 | 43 | #region Public Methods 44 | /// 45 | /// 返回表示当前Object的字符串。 46 | /// 47 | /// 表示当前对象的字符串。 48 | public override string ToString() 49 | { 50 | return Name; 51 | } 52 | #endregion 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Model/Product.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Apworks; 3 | 4 | namespace ByteartRetail.Domain.Model 5 | { 6 | /// 7 | /// 表示在线零售系统可供销售的商品对象。 8 | /// 9 | public class Product : IAggregateRoot 10 | { 11 | #region Properties 12 | public Guid ID { get; set; } 13 | 14 | /// 15 | /// 获取或设置商品的名称。 16 | /// 17 | public string Name { get; set; } 18 | 19 | /// 20 | /// 获取或设置商品的描述信息。 21 | /// 22 | public string Description { get; set; } 23 | 24 | /// 25 | /// 获取或设置商品的单价。 26 | /// 27 | /// 28 | /// 在实际的销售系统中,商品单价并不是一个固定的值,它可以是 29 | /// 一个估价,也可以是一个加权平均值。这就需要涉及到库存管理系统, 30 | /// 本案例对这部分内容不作演示。 31 | /// 32 | public decimal UnitPrice { get; set; } 33 | 34 | /// 35 | /// 获取或设置用于表述商品外观的图片的URL地址。 36 | /// 37 | public string ImageUrl { get; set; } 38 | 39 | /// 40 | /// 获取或设置一个值,该值表述当前商品 41 | /// 是否为特色商品。 42 | /// 43 | public bool IsFeatured { get; set; } 44 | 45 | #endregion 46 | 47 | #region Public Methods 48 | /// 49 | /// 返回表示当前Object的字符串。 50 | /// 51 | /// 表示当前对象的字符串。 52 | public override string ToString() 53 | { 54 | return Name; 55 | } 56 | #endregion 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Model/Role.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Apworks; 3 | 4 | namespace ByteartRetail.Domain.Model 5 | { 6 | /// 7 | /// 表示“角色”领域概念的聚合根。 8 | /// 9 | public class Role : IAggregateRoot 10 | { 11 | #region Ctor 12 | /// 13 | /// 初始化一个新的Role实例。 14 | /// 15 | public Role() { } 16 | /// 17 | /// 初始化一个新的Role实例。 18 | /// 19 | /// 角色名称。 20 | /// 角色描述。 21 | public Role(string name, string description) 22 | { 23 | Name = name; 24 | Description = description; 25 | } 26 | #endregion 27 | 28 | #region Public Properties 29 | public Guid ID { get; set; } 30 | 31 | /// 32 | /// 获取或设置角色名称。 33 | /// 34 | public string Name { get; set; } 35 | 36 | /// 37 | /// 获取或设置角色描述。 38 | /// 39 | public string Description { get; set; } 40 | 41 | #endregion 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Model/SalesOrderStatus.cs: -------------------------------------------------------------------------------- 1 | namespace ByteartRetail.Domain.Model 2 | { 3 | /// 4 | /// 表示销售订单的状态。 5 | /// 6 | /// 此处使用枚举类型,是为了在Domain Model中简化编码,毕竟枚举类型要比整数类型更能表达领域含义。但在 7 | /// Entity Framework的4.3.1版本中,暂没有对枚举类型的支持。 8 | /// 9 | public enum SalesOrderStatus : int 10 | { 11 | /// 12 | /// 表示销售订单的已创建状态 - 表明销售订单已被创建(未用)。 13 | /// 14 | Created = 0, 15 | /// 16 | /// 表示销售订单的已付款状态 - 表明客户已向销售订单付款。 17 | /// 18 | Paid, 19 | /// 20 | /// 表示销售订单的已拣货状态 - 表明销售订单中包含的商品已从仓库拣货(未用)。 21 | /// 22 | Picked, 23 | /// 24 | /// 表示销售订单的已发货状态。 25 | /// 26 | Dispatched, 27 | /// 28 | /// 表示销售订单的已派送状态。 29 | /// 30 | Delivered 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Model/ShoppingCart.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Apworks; 3 | 4 | namespace ByteartRetail.Domain.Model 5 | { 6 | /// 7 | /// 表示“购物篮”的领域实体对象。 8 | /// 9 | public class ShoppingCart : IAggregateRoot 10 | { 11 | #region Private Fields 12 | private User user; 13 | #endregion 14 | 15 | #region Ctor 16 | /// 17 | /// 初始化一个ShoppingCart类型的实例。 18 | /// 19 | public ShoppingCart() { } 20 | #endregion 21 | 22 | #region Public Properties 23 | public Guid ID { get; set; } 24 | 25 | /// 26 | /// 获取或设置拥有此购物篮的客户实体。 27 | /// 28 | public virtual User User 29 | { 30 | get { return user; } 31 | set { user = value; } 32 | } 33 | #endregion 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Model/UserRole.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Apworks; 3 | 4 | namespace ByteartRetail.Domain.Model 5 | { 6 | /// 7 | /// 表示“用户角色关系”领域概念的聚合根。 8 | /// 9 | public class UserRole : IAggregateRoot 10 | { 11 | #region Ctor 12 | /// 13 | /// 初始化一个新的UserRole实例。 14 | /// 15 | public UserRole() { } 16 | 17 | /// 18 | /// 初始化一个新的UserRole实例。 19 | /// 20 | /// 用户账户的ID。 21 | /// 角色的ID。 22 | public UserRole(Guid userID, Guid roleID) 23 | { 24 | UserID = userID; 25 | RoleID = roleID; 26 | } 27 | #endregion 28 | 29 | #region Public Properties 30 | public Guid ID { get; set; } 31 | 32 | /// 33 | /// 获取或设置用户账户的ID值。 34 | /// 35 | public Guid UserID { get; set; } 36 | 37 | /// 38 | /// 获取或设置角色的ID值。 39 | /// 40 | public Guid RoleID { get; set; } 41 | 42 | #endregion 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ByteartRetail.Domain")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ByteartRetail.Domain")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d6bca1c9-b5dd-414b-b098-c3cc9620f081")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Repositories/ICategorizationRepository.cs: -------------------------------------------------------------------------------- 1 | using Apworks; 2 | using Apworks.Repositories; 3 | using ByteartRetail.Domain.Model; 4 | using System.Collections.Generic; 5 | 6 | namespace ByteartRetail.Domain.Repositories 7 | { 8 | /// 9 | /// 表示用于“商品分类关系”聚合根的仓储接口。 10 | /// 11 | public interface ICategorizationRepository : IRepository 12 | { 13 | #region Methods 14 | /// 15 | /// 获取指定分类下的所有商品信息。 16 | /// 17 | /// 指定的商品分类。 18 | /// 属于指定分类下的所有商品信息。 19 | IEnumerable GetProductsForCategory(Category category); 20 | /// 21 | /// 以分页的方式,获取指定分类下的所有商品信息。 22 | /// 23 | /// 指定的商品分类。 24 | /// 所请求的分页页码。 25 | /// 所请求的分页大小。 26 | /// 属于指定分类下的某页的商品信息。 27 | PagedResult GetProductsForCategoryWithPagination(Category category, int pageNumber, int pageSize); 28 | /// 29 | /// 获取商品所属的商品分类。 30 | /// 31 | /// 商品信息。 32 | /// 商品分类。 33 | Category GetCategoryForProduct(Product product); 34 | #endregion 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Repositories/ICategoryRepository.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Repositories; 2 | using ByteartRetail.Domain.Model; 3 | 4 | namespace ByteartRetail.Domain.Repositories 5 | { 6 | /// 7 | /// 表示用于“商品分类”聚合根的仓储接口。 8 | /// 9 | public interface ICategoryRepository : IRepository 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Repositories/IProductRepository.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Repositories; 2 | using ByteartRetail.Domain.Model; 3 | using System.Collections.Generic; 4 | 5 | namespace ByteartRetail.Domain.Repositories 6 | { 7 | /// 8 | /// 表示用于“商品”聚合根的仓储接口。 9 | /// 10 | public interface IProductRepository : IRepository 11 | { 12 | #region Methods 13 | /// 14 | /// 获取特色商品的列表。 15 | /// 16 | /// 需要获取的特色商品的个数。默认值:0,表示获取所有特色商品。 17 | /// 特色商品列表。 18 | IEnumerable GetFeaturedProducts(int count = 0); 19 | #endregion 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Repositories/IRoleRepository.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Repositories; 2 | using ByteartRetail.Domain.Model; 3 | 4 | namespace ByteartRetail.Domain.Repositories 5 | { 6 | /// 7 | /// 表示用于“角色”聚合根的仓储接口。 8 | /// 9 | public interface IRoleRepository : IRepository 10 | { 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Repositories/ISalesOrderRepository.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Repositories; 2 | using ByteartRetail.Domain.Model; 3 | using System; 4 | using System.Collections.Generic; 5 | 6 | namespace ByteartRetail.Domain.Repositories 7 | { 8 | /// 9 | /// 表示用于“销售订单”聚合根的仓储接口。 10 | /// 11 | public interface ISalesOrderRepository : IRepository 12 | { 13 | #region Methods 14 | /// 15 | /// 查找属于指定用户的所有销售订单。 16 | /// 17 | /// 用户。 18 | /// 指定用户的所有销售订单。 19 | IEnumerable FindSalesOrdersByUser(User user); 20 | /// 21 | /// 根据销售订单的ID值获取销售订单。 22 | /// 23 | /// 销售订单的ID值。 24 | /// 销售订单。 25 | SalesOrder GetSalesOrderByID(Guid orderID); 26 | #endregion 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Repositories/IShoppingCartItemRepository.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Repositories; 2 | using ByteartRetail.Domain.Model; 3 | using System.Collections.Generic; 4 | 5 | namespace ByteartRetail.Domain.Repositories 6 | { 7 | /// 8 | /// 表示用于“购物篮项目”聚合根的仓储接口。 9 | /// 10 | public interface IShoppingCartItemRepository : IRepository 11 | { 12 | #region Methods 13 | /// 14 | /// 根据指定的购物篮以及存在于购物篮中的商品,查找购物篮项目。 15 | /// 16 | /// 购物篮。 17 | /// 商品。 18 | /// 购物篮项目。 19 | ShoppingCartItem FindItem(ShoppingCart shoppingCart, Product product); 20 | /// 21 | /// 查找指定购物篮中的所有购物篮项目。 22 | /// 23 | /// 购物篮。 24 | /// 所有购物篮项目。 25 | IEnumerable FindItemsByCart(ShoppingCart cart); 26 | #endregion 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Repositories/IShoppingCartRepository.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Repositories; 2 | using ByteartRetail.Domain.Model; 3 | 4 | namespace ByteartRetail.Domain.Repositories 5 | { 6 | /// 7 | /// 表示用于“购物篮”聚合根的仓储接口。 8 | /// 9 | public interface IShoppingCartRepository : IRepository 10 | { 11 | #region 12 | /// 13 | /// 根据指定的用户,查找该用户的购物篮。 14 | /// 15 | /// 用户。 16 | /// 购物篮。 17 | ShoppingCart FindShoppingCartByUser(User user); 18 | #endregion 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Repositories/IUserRepository.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Repositories; 2 | using ByteartRetail.Domain.Model; 3 | 4 | namespace ByteartRetail.Domain.Repositories 5 | { 6 | /// 7 | /// 表示继承于该接口的类型是作用在“用户”聚合根上的仓储类型。 8 | /// 9 | public interface IUserRepository : IRepository 10 | { 11 | #region Methods 12 | /// 13 | /// 确定指定的用户名是否存在。 14 | /// 15 | /// 待确定的用户名。 16 | /// 如果用户名存在,则返回true,否则返回false。 17 | bool UserNameExists(string userName); 18 | 19 | /// 20 | /// 确定指定的电子邮件地址是否存在。 21 | /// 22 | /// 如果电子邮件地址存在,则返回true,否则返回false。 23 | bool EmailExists(string email); 24 | /// 25 | /// 确定指定的用户名和密码是否一致。 26 | /// 27 | /// 待确定的用户名。 28 | /// 待确定的密码。 29 | /// 如果两者一致,则返回true,否则返回false。 30 | bool CheckPassword(string userName, string password); 31 | /// 32 | /// 根据指定的用户名,获取用户实体。 33 | /// 34 | /// 需要获取的用户的用户名。 35 | /// 用户实体。 36 | User GetUserByName(string userName); 37 | /// 38 | /// 根据指定的电子邮件地址,获取用户实体。 39 | /// 40 | /// 需要获取的用户的电子邮件地址。 41 | /// 用户实体。 42 | User GetUserByEmail(string email); 43 | #endregion 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Repositories/IUserRoleRepository.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Repositories; 2 | using ByteartRetail.Domain.Model; 3 | 4 | namespace ByteartRetail.Domain.Repositories 5 | { 6 | /// 7 | /// 表示用于“用户角色关系”聚合根的仓储接口。 8 | /// 9 | public interface IUserRoleRepository : IRepository 10 | { 11 | #region Methods 12 | /// 13 | /// 根据指定的用户,获取该用户所属的角色。 14 | /// 15 | /// 用户。 16 | /// 角色。 17 | Role GetRoleForUser(User user); 18 | #endregion 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/Services/IDomainService.cs: -------------------------------------------------------------------------------- 1 | using ByteartRetail.Domain.Model; 2 | 3 | namespace ByteartRetail.Domain.Services 4 | { 5 | /// 6 | /// 表示继承于该接口的类型都是领域服务(Domain Service)类型。 7 | /// 8 | public interface IDomainService 9 | { 10 | #region Methods 11 | /// 12 | /// 将指定的商品归类到指定的商品分类中。 13 | /// 14 | /// 需要归类的商品。 15 | /// 商品分类。 16 | /// 用以表述商品及其分类之间关系的实体。 17 | Categorization Categorize(Product product, Category category); 18 | /// 19 | /// 将指定的商品从其所属的商品分类中移除。 20 | /// 21 | /// 商品。 22 | /// 分类,若为NULL,则表示从所有分类中移除。 23 | void Uncategorize(Product product, Category category = null); 24 | /// 25 | /// 通过指定的用户及其所拥有的购物篮实体,创建销售订单。 26 | /// 27 | /// 用户实体。 28 | /// 购物篮实体。 29 | /// 销售订单实体。 30 | SalesOrder CreateSalesOrder(User user, ShoppingCart shoppingCart); 31 | /// 32 | /// 将指定的用户赋予特定的角色。 33 | /// 34 | /// 用户实体。 35 | /// 角色实体。 36 | /// 用以表述用户及其角色之间关系的实体。 37 | UserRole AssignRole(User user, Role role); 38 | /// 39 | /// 将指定的用户从角色中移除。 40 | /// 41 | /// 用户实体。 42 | /// 角色实体,若为NULL,则表示从所有角色中移除。 43 | void UnassignRole(User user, Role role = null); 44 | #endregion 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /ByteartRetail.Domain/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /ByteartRetail.Events.Handlers/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ByteartRetail.Events.Handlers")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ByteartRetail.Events.Handlers")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("cf3d4045-3442-4c01-969f-16146b85bfc5")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ByteartRetail.Events.Handlers/SendEmailHandler.cs: -------------------------------------------------------------------------------- 1 | using Apworks.Events; 2 | using ByteartRetail.Domain.Events; 3 | using System; 4 | using Utils = ByteartRetail.Infrastructure.Utils; 5 | 6 | namespace ByteartRetail.Events.Handlers 7 | { 8 | /// 9 | /// 表示向外发送邮件的事件处理器。 10 | /// 11 | [ParallelExecution] 12 | public class SendEmailHandler : IEventHandler, IEventHandler 13 | { 14 | #region IEventHandler Members 15 | /// 16 | /// 处理给定的事件。 17 | /// 18 | /// 需要处理的事件。 19 | public void Handle(OrderDispatchedEvent evnt) 20 | { 21 | try 22 | { 23 | // 此处仅为演示,所以邮件内容很简单。可以根据自己的实际情况做一些复杂的邮件功能,比如 24 | // 使用邮件模板或者邮件风格等。 25 | Utils.SendEmail(evnt.UserEmailAddress, 26 | "您的订单已经发货", 27 | string.Format("您的订单 {0} 已于 {1} 发货。有关订单的更多信息,请与系统管理员联系。", 28 | evnt.OrderID.ToString().ToUpper(), evnt.DispatchedDate)); 29 | } 30 | catch (Exception ex) 31 | { 32 | // 如遇异常,直接记Log 33 | Utils.Log(ex); 34 | } 35 | } 36 | 37 | #endregion 38 | 39 | #region IEventHandler Members 40 | /// 41 | /// 处理给定的事件。 42 | /// 43 | /// 需要处理的事件。 44 | public void Handle(OrderConfirmedEvent evnt) 45 | { 46 | try 47 | { 48 | // 此处仅为演示,所以邮件内容很简单。可以根据自己的实际情况做一些复杂的邮件功能,比如 49 | // 使用邮件模板或者邮件风格等。 50 | Utils.SendEmail(evnt.UserEmailAddress, 51 | "您的订单已经确认收货", 52 | string.Format("您的订单 {0} 已于 {1} 确认收货。有关订单的更多信息,请与系统管理员联系。", 53 | evnt.OrderID.ToString().ToUpper(), evnt.ConfirmedDate)); 54 | } 55 | catch (Exception ex) 56 | { 57 | // 如遇异常,直接记Log 58 | Utils.Log(ex); 59 | } 60 | } 61 | 62 | #endregion 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /ByteartRetail.Events.Handlers/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /ByteartRetail.Infrastructure.Caching/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ByteartRetail.Infrastructure.Caching")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ByteartRetail.Infrastructure.Caching")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("4d1932e3-cd41-4ae0-bab3-664288d5d1f3")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ByteartRetail.Infrastructure.Caching/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ByteartRetail.Infrastructure/Caching/CachingAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ByteartRetail.Infrastructure.Caching 4 | { 5 | /// 6 | /// 表示由此特性所描述的方法,能够获得来自Byteart Retail基础结构层所提供的缓存功能。 7 | /// 8 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] 9 | public class CachingAttribute : Attribute 10 | { 11 | #region Ctor 12 | /// 13 | /// 初始化一个新的CachingAttribute类型。 14 | /// 15 | /// 缓存方式。 16 | public CachingAttribute(CachingMethod method) 17 | { 18 | Method = method; 19 | } 20 | /// 21 | /// 初始化一个新的CachingAttribute类型。 22 | /// 23 | /// 缓存方式。 24 | /// 与当前缓存方式相关的方法名称。注:此参数仅在缓存方式为Remove时起作用。 25 | public CachingAttribute(CachingMethod method, params string[] correspondingMethodNames) 26 | : this(method) 27 | { 28 | CorrespondingMethodNames = correspondingMethodNames; 29 | } 30 | #endregion 31 | 32 | #region Public Properties 33 | /// 34 | /// 获取或设置缓存方式。 35 | /// 36 | public CachingMethod Method { get; set; } 37 | /// 38 | /// 获取或设置一个值,该值表示当缓存方式为Put时,是否强制将值写入缓存中。 39 | /// 40 | public bool Force { get; set; } 41 | /// 42 | /// 获取或设置与当前缓存方式相关的方法名称。注:此参数仅在缓存方式为Remove时起作用。 43 | /// 44 | public string[] CorrespondingMethodNames { get; set; } 45 | #endregion 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /ByteartRetail.Infrastructure/Caching/CachingMethod.cs: -------------------------------------------------------------------------------- 1 | namespace ByteartRetail.Infrastructure.Caching 2 | { 3 | /// 4 | /// 表示用于Caching特性的缓存方式。 5 | /// 6 | public enum CachingMethod 7 | { 8 | /// 9 | /// 表示需要从缓存中获取对象。如果缓存中不存在所需的对象,系统则会调用实际的方法获取对象, 10 | /// 然后将获得的结果添加到缓存中。 11 | /// 12 | Get, 13 | /// 14 | /// 表示需要将对象存入缓存。此方式会调用实际方法以获取对象,然后将获得的结果添加到缓存中, 15 | /// 并直接返回方法的调用结果。 16 | /// 17 | Put, 18 | /// 19 | /// 表示需要将对象从缓存中移除。 20 | /// 21 | Remove 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ByteartRetail.Infrastructure/Caching/ICacheProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ByteartRetail.Infrastructure.Caching 4 | { 5 | /// 6 | /// 表示实现该接口的类型是能够为应用程序提供缓存机制的类型。 7 | /// 8 | public interface ICacheProvider 9 | { 10 | #region Methods 11 | /// 12 | /// 向缓存中添加一个对象。 13 | /// 14 | /// 缓存的键值,该值通常是使用缓存机制的方法的名称。 15 | /// 缓存值的键值,该值通常是由使用缓存机制的方法的参数值所产生。 16 | /// 需要缓存的对象。 17 | void Add(string key, string valKey, object value); 18 | /// 19 | /// 向缓存中更新一个对象。 20 | /// 21 | /// 缓存的键值,该值通常是使用缓存机制的方法的名称。 22 | /// 缓存值的键值,该值通常是由使用缓存机制的方法的参数值所产生。 23 | /// 需要缓存的对象。 24 | void Put(string key, string valKey, object value); 25 | /// 26 | /// 从缓存中读取对象。 27 | /// 28 | /// 缓存的键值,该值通常是使用缓存机制的方法的名称。 29 | /// 缓存值的键值,该值通常是由使用缓存机制的方法的参数值所产生。 30 | /// 被缓存的对象。 31 | object Get(string key, string valKey); 32 | /// 33 | /// 从缓存中移除对象。 34 | /// 35 | /// 缓存的键值,该值通常是使用缓存机制的方法的名称。 36 | void Remove(string key); 37 | /// 38 | /// 获取一个值,该值表示拥有指定键值的缓存是否存在。 39 | /// 40 | /// 指定的键值。 41 | /// 如果缓存存在,则返回true,否则返回false。 42 | bool Exists(string key); 43 | /// 44 | /// 获取一个值,该值表示拥有指定键值和缓存值键的缓存是否存在。 45 | /// 46 | /// 指定的键值。 47 | /// 缓存值键。 48 | /// 如果缓存存在,则返回true,否则返回false。 49 | bool Exists(string key, string valKey); 50 | #endregion 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /ByteartRetail.Infrastructure/Config/ByteartRetailConfigSection.csd.config: -------------------------------------------------------------------------------- 1 |  2 | 10 | 11 | 12 |
13 | 14 | 15 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ByteartRetail.Infrastructure/IApplicationServiceContract.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace ByteartRetail.Infrastructure 3 | { 4 | /// 5 | /// 表示实现该接口的类型为Application Service Contract。 6 | /// 7 | public interface IApplicationServiceContract : IDisposable 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ByteartRetail.Infrastructure/InterceptionBehaviors/ExceptionLoggingBehavior.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Practices.Unity.InterceptionExtension; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace ByteartRetail.Infrastructure.InterceptionBehaviors 6 | { 7 | /// 8 | /// 表示用于异常日志记录的拦截行为。 9 | /// 10 | public class ExceptionLoggingBehavior : IInterceptionBehavior 11 | { 12 | #region IInterceptionBehavior Members 13 | /// 14 | /// 获取当前行为需要拦截的对象类型接口。 15 | /// 16 | /// 所有需要拦截的对象类型接口。 17 | public IEnumerable GetRequiredInterfaces() 18 | { 19 | return Type.EmptyTypes; 20 | } 21 | 22 | /// 23 | /// 通过实现此方法来拦截调用并执行所需的拦截行为。 24 | /// 25 | /// 调用拦截目标时的输入信息。 26 | /// 通过行为链来获取下一个拦截行为的委托。 27 | /// 从拦截目标获得的返回信息。 28 | public IMethodReturn Invoke(IMethodInvocation input, GetNextInterceptionBehaviorDelegate getNext) 29 | { 30 | var methodReturn = getNext().Invoke(input, getNext); 31 | if (methodReturn.Exception != null) 32 | { 33 | Utils.Log(methodReturn.Exception); 34 | } 35 | return methodReturn; 36 | } 37 | /// 38 | /// 获取一个值,该值表示当前拦截行为被调用时,是否真的需要执行 39 | /// 某些操作。 40 | /// 41 | public bool WillExecute 42 | { 43 | get { return true; } 44 | } 45 | 46 | #endregion 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /ByteartRetail.Infrastructure/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ByteartRetail.Infrastructure")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ByteartRetail.Infrastructure")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("e41aa12a-ad77-43fc-8794-4f9097abb5fa")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ByteartRetail.Infrastructure/Utils.cs: -------------------------------------------------------------------------------- 1 | using ByteartRetail.Infrastructure.Config; 2 | using System; 3 | using System.Net; 4 | using System.Net.Mail; 5 | 6 | namespace ByteartRetail.Infrastructure 7 | { 8 | /// 9 | /// 表示用于整个Byteart Retail系统的工具类。 10 | /// 11 | public static class Utils 12 | { 13 | #region Private Fields 14 | // ReSharper disable InconsistentNaming 15 | private static readonly log4net.ILog log = log4net.LogManager.GetLogger("ByteartRetail.Logger"); 16 | // ReSharper restore InconsistentNaming 17 | #endregion 18 | 19 | #region Public Static Methods 20 | /// 21 | /// 将指定的字符串信息写入日志。 22 | /// 23 | /// 需要写入日志的字符串信息。 24 | public static void Log(string message) 25 | { 26 | log.Info(message); 27 | } 28 | /// 29 | /// 将指定的实例详细信息写入日志。 30 | /// 31 | /// 需要将详细信息写入日志的实例。 32 | public static void Log(Exception ex) 33 | { 34 | log.Error("Exception caught", ex); 35 | } 36 | /// 37 | /// 向指定的邮件地址发送邮件。 38 | /// 39 | /// 需要发送邮件的邮件地址。 40 | /// 邮件主题。 41 | /// 邮件内容。 42 | public static void SendEmail(string to, string subject, string content) 43 | { 44 | var msg = new MailMessage(ByteartRetailConfigurationReader.Instance.EmailSender, 45 | to, 46 | subject, 47 | content); 48 | var smtpClient = new SmtpClient(ByteartRetailConfigurationReader.Instance.EmailHost) 49 | { 50 | Port = ByteartRetailConfigurationReader.Instance.EmailPort, 51 | Credentials = 52 | new NetworkCredential(ByteartRetailConfigurationReader.Instance.EmailUserName, 53 | ByteartRetailConfigurationReader.Instance.EmailPassword), 54 | EnableSsl = ByteartRetailConfigurationReader.Instance.EmailEnableSsl 55 | }; 56 | smtpClient.Send(msg); 57 | } 58 | #endregion 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /ByteartRetail.Infrastructure/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ByteartRetail.ServiceContracts/IPostbackService.cs: -------------------------------------------------------------------------------- 1 | using ByteartRetail.DataObjects; 2 | using ByteartRetail.Infrastructure; 3 | using System.ServiceModel; 4 | 5 | namespace ByteartRetail.ServiceContracts 6 | { 7 | /// 8 | /// 表示与“服务器信息回发”相关的应用层服务契约。 9 | /// 10 | [ServiceContract(Namespace = "http://www.ByteartRetail.com")] 11 | public interface IPostbackService : IApplicationServiceContract 12 | { 13 | #region Methods 14 | /// 15 | /// 将服务器相关的信息回发给客户端。 16 | /// 17 | /// 服务器相关信息。 18 | /// 此服务仅用于测试,没有实际业务含义。 19 | [OperationContract] 20 | [FaultContract(typeof(FaultData))] 21 | PostbackDataObject GetPostback(); 22 | #endregion 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ByteartRetail.ServiceContracts/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ByteartRetail.ServiceContracts")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ByteartRetail.ServiceContracts")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("7d737313-3453-4716-9a85-88233925a4ad")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ByteartRetail.ServiceContracts/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /ByteartRetail.Services.WCF/App_Data/ByteartRetail.mdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Services.WCF/App_Data/ByteartRetail.mdf -------------------------------------------------------------------------------- /ByteartRetail.Services.WCF/App_Data/ByteartRetail_log.ldf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Services.WCF/App_Data/ByteartRetail_log.ldf -------------------------------------------------------------------------------- /ByteartRetail.Services.WCF/Common.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /ByteartRetail.Services.WCF/Common.tt: -------------------------------------------------------------------------------- 1 | <#@ template debug="true" hostSpecific="true" #> 2 | <#@ output extension=".cs" #> 3 | <#@ import namespace="System" #> 4 | <#@ import namespace="System.Reflection" #> 5 | <#@ import namespace="System.Text" #> 6 | <#+ 7 | private string GetTypeName(Type type) 8 | { 9 | if (!type.IsGenericType) 10 | { 11 | if (type == typeof(void)) 12 | return "void"; 13 | else 14 | return type.Name; 15 | } 16 | string returnTypeGenericTypeName = type.Name.Replace("`1", ""); 17 | string returnTypeGenericTypeArgumentName = type.GetGenericArguments()[0].Name; 18 | return string.Format("{0}<{1}>", returnTypeGenericTypeName, returnTypeGenericTypeArgumentName); 19 | } 20 | 21 | private string GetMethodReturnType(MethodInfo method) 22 | { 23 | return GetTypeName(method.ReturnType); 24 | } 25 | 26 | private string GetMethodParameterList(MethodInfo method) 27 | { 28 | ParameterInfo[] parameters = method.GetParameters(); 29 | StringBuilder sb = new StringBuilder(); 30 | for(int i = 0; i < parameters.Length; i++) 31 | { 32 | sb.Append(GetTypeName(parameters[i].ParameterType)); 33 | sb.Append(" "); 34 | sb.Append(parameters[i].Name); 35 | if (i != parameters.Length - 1) 36 | sb.Append(", "); 37 | } 38 | return sb.ToString(); 39 | } 40 | 41 | private string GetMethodParameterValueList(MethodInfo method) 42 | { 43 | ParameterInfo[] parameters = method.GetParameters(); 44 | StringBuilder sb = new StringBuilder(); 45 | for(int i = 0; i < parameters.Length; i++) 46 | { 47 | sb.Append(parameters[i].Name); 48 | if (i != parameters.Length - 1) 49 | sb.Append(", "); 50 | } 51 | return sb.ToString(); 52 | } 53 | #> -------------------------------------------------------------------------------- /ByteartRetail.Services.WCF/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="ByteartRetail.Services.WCF.Global" Language="C#" %> 2 | -------------------------------------------------------------------------------- /ByteartRetail.Services.WCF/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Apworks.Application; 3 | using Apworks.Config.Fluent; 4 | using ByteartRetail.Application; 5 | using ByteartRetail.Domain.Repositories.EntityFramework; 6 | 7 | namespace ByteartRetail.Services.WCF 8 | { 9 | public class Global : System.Web.HttpApplication 10 | { 11 | 12 | protected void Application_Start(object sender, EventArgs e) 13 | { 14 | ByteartRetailDbContextInitailizer.Initialize(); 15 | ApplicationService.Initialize(); 16 | log4net.Config.XmlConfigurator.Configure(); 17 | AppRuntime.Instance 18 | .ConfigureApworks() 19 | .UsingUnityContainerWithDefaultSettings(true, "unity") 20 | .Create().Start(); 21 | } 22 | 23 | protected void Session_Start(object sender, EventArgs e) 24 | { 25 | 26 | } 27 | 28 | protected void Application_BeginRequest(object sender, EventArgs e) 29 | { 30 | 31 | } 32 | 33 | protected void Application_AuthenticateRequest(object sender, EventArgs e) 34 | { 35 | 36 | } 37 | 38 | protected void Application_Error(object sender, EventArgs e) 39 | { 40 | 41 | } 42 | 43 | protected void Session_End(object sender, EventArgs e) 44 | { 45 | 46 | } 47 | 48 | protected void Application_End(object sender, EventArgs e) 49 | { 50 | 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /ByteartRetail.Services.WCF/Logs/balog.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Services.WCF/Logs/balog.txt -------------------------------------------------------------------------------- /ByteartRetail.Services.WCF/OrderService.svc: -------------------------------------------------------------------------------- 1 | <%@ ServiceHost Language="C#" Debug="true" Service="ByteartRetail.Services.WCF.OrderService" CodeBehind="OrderService.svc.cs" %> 2 | -------------------------------------------------------------------------------- /ByteartRetail.Services.WCF/OrderService.svc.tt: -------------------------------------------------------------------------------- 1 | <#@ template debug="true" hostSpecific="true" #> 2 | <#@ output extension=".cs" #> 3 | <#@ Assembly Name="System.Core.dll" #> 4 | <#@ Assembly Name="System.Windows.Forms.dll" #> 5 | <#@ assembly name="System.ServiceModel.dll"#> 6 | <#@ assembly name="System.Runtime.Serialization.dll"#> 7 | <#@ Assembly Name="$(SolutionDir)ByteartRetail.Infrastructure\bin\$(ConfigurationName)\ByteartRetail.Infrastructure.dll" #> 8 | <#@ Assembly Name="$(SolutionDir)ByteartRetail.Application\bin\$(ConfigurationName)\ByteartRetail.Application.dll" #> 9 | <#@ Assembly Name="$(SolutionDir)ByteartRetail.Domain\bin\$(ConfigurationName)\ByteartRetail.Domain.dll" #> 10 | <#@ Assembly Name="$(SolutionDir)ByteartRetail.ServiceContracts\bin\$(ConfigurationName)\ByteartRetail.ServiceContracts.dll" #> 11 | <#@ import namespace="System" #> 12 | <#@ import namespace="System.Reflection" #> 13 | <#@ import namespace="System.IO" #> 14 | <#@ import namespace="System.Text" #> 15 | <#@ import namespace="System.Collections.Generic" #> 16 | <#@ import namespace="ByteartRetail.Application" #> 17 | <#@ import namespace="System.ServiceModel"#> 18 | <#@ include file="Common.tt"#> 19 | // ****************************************************** 20 | // DO NOT CHANGE THE CONTENT OF THIS FILE 21 | // This file was generated by the T4 engine and the 22 | // contents of this source code will be changed after 23 | // the custom tool was run. 24 | // ****************************************************** 25 | using System; 26 | using System.ServiceModel; 27 | using Apworks; 28 | using ByteartRetail.DataObjects; 29 | using ByteartRetail.ServiceContracts; 30 | 31 | namespace ByteartRetail.Services.WCF 32 | { 33 | [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)] 34 | public class OrderService : IOrderService 35 | { 36 | private readonly IOrderService _orderServiceImpl = ServiceLocator.Instance.GetService(); 37 | <#foreach (MethodInfo method in typeof(ByteartRetail.ServiceContracts.IOrderService).GetMethods()) {#> 38 | public <#=GetMethodReturnType(method)#> <#=method.Name#>(<#=GetMethodParameterList(method)#>) 39 | { 40 | try 41 | { 42 | <#if(method.ReturnType != typeof(void)){#>return<#}#> _orderServiceImpl.<#=method.Name#>(<#=GetMethodParameterValueList(method)#>); 43 | } 44 | catch(Exception ex) 45 | { 46 | throw new FaultException(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex)); 47 | } 48 | } 49 | <#}#> 50 | public void Dispose() { _orderServiceImpl.Dispose(); } 51 | } 52 | } -------------------------------------------------------------------------------- /ByteartRetail.Services.WCF/PostbackService.svc: -------------------------------------------------------------------------------- 1 | <%@ ServiceHost Language="C#" Debug="true" Service="ByteartRetail.Services.WCF.PostbackService" CodeBehind="PostbackService.svc.cs" %> 2 | -------------------------------------------------------------------------------- /ByteartRetail.Services.WCF/PostbackService.svc.cs: -------------------------------------------------------------------------------- 1 |  2 | 3 | // ****************************************************** 4 | // DO NOT CHANGE THE CONTENT OF THIS FILE 5 | // This file was generated by the T4 engine and the 6 | // contents of this source code will be changed after 7 | // the custom tool was run. 8 | // ****************************************************** 9 | using System; 10 | using System.ServiceModel; 11 | using Apworks; 12 | using ByteartRetail.DataObjects; 13 | using ByteartRetail.ServiceContracts; 14 | 15 | namespace ByteartRetail.Services.WCF 16 | { 17 | [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)] 18 | public class PostbackService : IPostbackService 19 | { 20 | private readonly IPostbackService _postbackServiceImpl = ServiceLocator.Instance.GetService(); 21 | public PostbackDataObject GetPostback() 22 | { 23 | try 24 | { 25 | return _postbackServiceImpl.GetPostback(); 26 | } 27 | catch(Exception ex) 28 | { 29 | throw new FaultException(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex)); 30 | } 31 | } 32 | public void Dispose() { _postbackServiceImpl.Dispose(); } 33 | } 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /ByteartRetail.Services.WCF/PostbackService.svc.tt: -------------------------------------------------------------------------------- 1 | <#@ template debug="true" hostSpecific="true" #> 2 | <#@ output extension=".cs" #> 3 | <#@ Assembly Name="System.Core.dll" #> 4 | <#@ Assembly Name="System.Windows.Forms.dll" #> 5 | <#@ assembly name="System.ServiceModel.dll"#> 6 | <#@ assembly name="System.Runtime.Serialization.dll"#> 7 | <#@ Assembly Name="$(SolutionDir)ByteartRetail.Infrastructure\bin\$(ConfigurationName)\ByteartRetail.Infrastructure.dll" #> 8 | <#@ Assembly Name="$(SolutionDir)ByteartRetail.Application\bin\$(ConfigurationName)\ByteartRetail.Application.dll" #> 9 | <#@ Assembly Name="$(SolutionDir)ByteartRetail.Domain\bin\$(ConfigurationName)\ByteartRetail.Domain.dll" #> 10 | <#@ Assembly Name="$(SolutionDir)ByteartRetail.ServiceContracts\bin\$(ConfigurationName)\ByteartRetail.ServiceContracts.dll" #> 11 | <#@ import namespace="System" #> 12 | <#@ import namespace="System.Reflection" #> 13 | <#@ import namespace="System.IO" #> 14 | <#@ import namespace="System.Text" #> 15 | <#@ import namespace="System.Collections.Generic" #> 16 | <#@ import namespace="ByteartRetail.Application" #> 17 | <#@ import namespace="System.ServiceModel"#> 18 | <#@ include file="Common.tt"#> 19 | // ****************************************************** 20 | // DO NOT CHANGE THE CONTENT OF THIS FILE 21 | // This file was generated by the T4 engine and the 22 | // contents of this source code will be changed after 23 | // the custom tool was run. 24 | // ****************************************************** 25 | using System; 26 | using System.ServiceModel; 27 | using Apworks; 28 | using ByteartRetail.DataObjects; 29 | using ByteartRetail.ServiceContracts; 30 | 31 | namespace ByteartRetail.Services.WCF 32 | { 33 | [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)] 34 | public class PostbackService : IPostbackService 35 | { 36 | private readonly IPostbackService _postbackServiceImpl = ServiceLocator.Instance.GetService(); 37 | <#foreach (MethodInfo method in typeof(ByteartRetail.ServiceContracts.IPostbackService).GetMethods()) {#> 38 | public <#=GetMethodReturnType(method)#> <#=method.Name#>(<#=GetMethodParameterList(method)#>) 39 | { 40 | try 41 | { 42 | <#if(method.ReturnType != typeof(void)){#>return<#}#> _postbackServiceImpl.<#=method.Name#>(<#=GetMethodParameterValueList(method)#>); 43 | } 44 | catch(Exception ex) 45 | { 46 | throw new FaultException(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex)); 47 | } 48 | } 49 | <#}#> 50 | public void Dispose() { _postbackServiceImpl.Dispose(); } 51 | } 52 | } 53 | 54 | 55 | -------------------------------------------------------------------------------- /ByteartRetail.Services.WCF/ProductService.svc: -------------------------------------------------------------------------------- 1 | <%@ ServiceHost Language="C#" Debug="true" Service="ByteartRetail.Services.WCF.ProductService" CodeBehind="ProductService.svc.cs" %> 2 | -------------------------------------------------------------------------------- /ByteartRetail.Services.WCF/ProductService.svc.tt: -------------------------------------------------------------------------------- 1 | <#@ template debug="true" hostSpecific="true" #> 2 | <#@ output extension=".cs" #> 3 | <#@ Assembly Name="System.Core.dll" #> 4 | <#@ Assembly Name="System.Windows.Forms.dll" #> 5 | <#@ assembly name="System.ServiceModel.dll"#> 6 | <#@ assembly name="System.Runtime.Serialization.dll"#> 7 | <#@ Assembly Name="$(SolutionDir)ByteartRetail.Infrastructure\bin\$(ConfigurationName)\ByteartRetail.Infrastructure.dll" #> 8 | <#@ Assembly Name="$(SolutionDir)ByteartRetail.Application\bin\$(ConfigurationName)\ByteartRetail.Application.dll" #> 9 | <#@ Assembly Name="$(SolutionDir)ByteartRetail.Domain\bin\$(ConfigurationName)\ByteartRetail.Domain.dll" #> 10 | <#@ Assembly Name="$(SolutionDir)ByteartRetail.ServiceContracts\bin\$(ConfigurationName)\ByteartRetail.ServiceContracts.dll" #> 11 | <#@ import namespace="System" #> 12 | <#@ import namespace="System.Reflection" #> 13 | <#@ import namespace="System.IO" #> 14 | <#@ import namespace="System.Text" #> 15 | <#@ import namespace="System.Collections.Generic" #> 16 | <#@ import namespace="ByteartRetail.Application" #> 17 | <#@ import namespace="System.ServiceModel"#> 18 | <#@ include file="Common.tt"#> 19 | // ****************************************************** 20 | // DO NOT CHANGE THE CONTENT OF THIS FILE 21 | // This file was generated by the T4 engine and the 22 | // contents of this source code will be changed after 23 | // the custom tool was run. 24 | // ****************************************************** 25 | using System; 26 | using System.ServiceModel; 27 | using Apworks; 28 | using ByteartRetail.DataObjects; 29 | using ByteartRetail.ServiceContracts; 30 | 31 | namespace ByteartRetail.Services.WCF 32 | { 33 | [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)] 34 | public class ProductService : IProductService 35 | { 36 | private readonly IProductService _productServiceImpl = ServiceLocator.Instance.GetService(); 37 | <#foreach (MethodInfo method in typeof(ByteartRetail.ServiceContracts.IProductService).GetMethods()) {#> 38 | public <#=GetMethodReturnType(method)#> <#=method.Name#>(<#=GetMethodParameterList(method)#>) 39 | { 40 | try 41 | { 42 | <#if(method.ReturnType != typeof(void)){#>return<#}#> _productServiceImpl.<#=method.Name#>(<#=GetMethodParameterValueList(method)#>); 43 | } 44 | catch(Exception ex) 45 | { 46 | throw new FaultException(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex)); 47 | } 48 | } 49 | <#}#> 50 | public void Dispose() { _productServiceImpl.Dispose(); } 51 | } 52 | } -------------------------------------------------------------------------------- /ByteartRetail.Services.WCF/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ByteartRetail.Services.WCF")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ByteartRetail.Services.WCF")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("4598e1f2-404a-4b9d-a2ac-a328dcb699e7")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ByteartRetail.Services.WCF/Traces_Server.svclog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Services.WCF/Traces_Server.svclog -------------------------------------------------------------------------------- /ByteartRetail.Services.WCF/UserService.svc: -------------------------------------------------------------------------------- 1 | <%@ ServiceHost Language="C#" Debug="true" Service="ByteartRetail.Services.WCF.UserService" CodeBehind="UserService.svc.cs" %> 2 | -------------------------------------------------------------------------------- /ByteartRetail.Services.WCF/UserService.svc.tt: -------------------------------------------------------------------------------- 1 | <#@ template debug="true" hostSpecific="true" #> 2 | <#@ output extension=".cs" #> 3 | <#@ Assembly Name="System.Core.dll" #> 4 | <#@ Assembly Name="System.Windows.Forms.dll" #> 5 | <#@ assembly name="System.ServiceModel.dll"#> 6 | <#@ assembly name="System.Runtime.Serialization.dll"#> 7 | <#@ Assembly Name="$(SolutionDir)ByteartRetail.Infrastructure\bin\$(ConfigurationName)\ByteartRetail.Infrastructure.dll" #> 8 | <#@ Assembly Name="$(SolutionDir)ByteartRetail.Application\bin\$(ConfigurationName)\ByteartRetail.Application.dll" #> 9 | <#@ Assembly Name="$(SolutionDir)ByteartRetail.Domain\bin\$(ConfigurationName)\ByteartRetail.Domain.dll" #> 10 | <#@ Assembly Name="$(SolutionDir)ByteartRetail.ServiceContracts\bin\$(ConfigurationName)\ByteartRetail.ServiceContracts.dll" #> 11 | <#@ import namespace="System" #> 12 | <#@ import namespace="System.Reflection" #> 13 | <#@ import namespace="System.IO" #> 14 | <#@ import namespace="System.Text" #> 15 | <#@ import namespace="System.Collections.Generic" #> 16 | <#@ import namespace="ByteartRetail.Application" #> 17 | <#@ import namespace="System.ServiceModel"#> 18 | <#@ include file="Common.tt"#> 19 | // ****************************************************** 20 | // DO NOT CHANGE THE CONTENT OF THIS FILE 21 | // This file was generated by the T4 engine and the 22 | // contents of this source code will be changed after 23 | // the custom tool was run. 24 | // ****************************************************** 25 | using System; 26 | using System.ServiceModel; 27 | using Apworks; 28 | using ByteartRetail.DataObjects; 29 | using ByteartRetail.ServiceContracts; 30 | 31 | namespace ByteartRetail.Services.WCF 32 | { 33 | [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)] 34 | public class UserService : IUserService 35 | { 36 | private readonly IUserService _userServiceImpl = ServiceLocator.Instance.GetService(); 37 | <#foreach (MethodInfo method in typeof(ByteartRetail.ServiceContracts.IUserService).GetMethods()) {#> 38 | public <#=GetMethodReturnType(method)#> <#=method.Name#>(<#=GetMethodParameterList(method)#>) 39 | { 40 | try 41 | { 42 | <#if(method.ReturnType != typeof(void)){#>return<#}#> _userServiceImpl.<#=method.Name#>(<#=GetMethodParameterValueList(method)#>); 43 | } 44 | catch(Exception ex) 45 | { 46 | throw new FaultException(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex)); 47 | } 48 | } 49 | <#}#> 50 | public void Dispose() { _userServiceImpl.Dispose(); } 51 | } 52 | } 53 | 54 | 55 | -------------------------------------------------------------------------------- /ByteartRetail.Services.WCF/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /ByteartRetail.Services.WCF/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /ByteartRetail.Services.WCF/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/App_Code/PermissionKeys.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ByteartRetail.Web.MVC 4 | { 5 | [Flags] 6 | public enum PermissionKeys 7 | { 8 | None = 0, 9 | Customers = 1, 10 | SalesReps = 2, 11 | Buyers = 4, 12 | Administrators = 8 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/App_Code/UrlHelperExtension.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | 3 | namespace ByteartRetail.Web.MVC 4 | { 5 | public static class UrlHelperExtension 6 | { 7 | public static string GetProductImagePath(UrlHelper helper) 8 | { 9 | return helper.Content("~/Images/Products/"); 10 | } 11 | 12 | public static MvcHtmlString ProductImagePath(this UrlHelper helper) 13 | { 14 | return MvcHtmlString.Create(GetProductImagePath(helper)); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Optimization; 2 | 3 | namespace ByteartRetail.Web.MVC.App_Start 4 | { 5 | public class BundleConfig 6 | { 7 | // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725 8 | public static void RegisterBundles(BundleCollection bundles) 9 | { 10 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include( 11 | "~/Scripts/jquery-{version}.js")); 12 | 13 | bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include( 14 | "~/Scripts/jquery-ui-{version}.js")); 15 | 16 | bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( 17 | "~/Scripts/jquery.unobtrusive*", 18 | "~/Scripts/jquery.validate*")); 19 | 20 | // Use the development version of Modernizr to develop with and learn from. Then, when you're 21 | // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. 22 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( 23 | "~/Scripts/modernizr-*")); 24 | 25 | bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css")); 26 | 27 | bundles.Add(new StyleBundle("~/Content/themes/base/css").Include( 28 | "~/Content/themes/base/jquery.ui.core.css", 29 | "~/Content/themes/base/jquery.ui.resizable.css", 30 | "~/Content/themes/base/jquery.ui.selectable.css", 31 | "~/Content/themes/base/jquery.ui.accordion.css", 32 | "~/Content/themes/base/jquery.ui.autocomplete.css", 33 | "~/Content/themes/base/jquery.ui.button.css", 34 | "~/Content/themes/base/jquery.ui.dialog.css", 35 | "~/Content/themes/base/jquery.ui.slider.css", 36 | "~/Content/themes/base/jquery.ui.tabs.css", 37 | "~/Content/themes/base/jquery.ui.datepicker.css", 38 | "~/Content/themes/base/jquery.ui.progressbar.css", 39 | "~/Content/themes/base/jquery.ui.theme.css")); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | 3 | namespace ByteartRetail.Web.MVC.App_Start 4 | { 5 | public class FilterConfig 6 | { 7 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 8 | { 9 | filters.Add(new HandleErrorAttribute()); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | using System.Web.Routing; 3 | 4 | namespace ByteartRetail.Web.MVC.App_Start 5 | { 6 | public class RouteConfig 7 | { 8 | public static void RegisterRoutes(RouteCollection routes) 9 | { 10 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 11 | 12 | routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional } 13 | ); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/App_Start/WebApiConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Http; 2 | 3 | namespace ByteartRetail.Web.MVC.App_Start 4 | { 5 | public static class WebApiConfig 6 | { 7 | public static void Register(HttpConfiguration config) 8 | { 9 | config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}", new { id = RouteParameter.Optional } 10 | ); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Content/ellipsis-xbl.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Content/superfish-navbar.css: -------------------------------------------------------------------------------- 1 | 2 | /*** adding the class sf-navbar in addition to sf-menu creates an all-horizontal nav-bar menu ***/ 3 | .sf-navbar { 4 | background: #BDD2FF; 5 | height: 2.5em; 6 | padding-bottom: 2.5em; 7 | position: relative; 8 | } 9 | .sf-navbar li { 10 | background: #AABDE6; 11 | position: static; 12 | } 13 | .sf-navbar a { 14 | border-top: none; 15 | } 16 | .sf-navbar li ul { 17 | width: 44em; /*IE6 soils itself without this*/ 18 | } 19 | .sf-navbar li li { 20 | background: #BDD2FF; 21 | position: relative; 22 | } 23 | .sf-navbar li li ul { 24 | width: 13em; 25 | } 26 | .sf-navbar li li li { 27 | width: 100%; 28 | } 29 | .sf-navbar ul li { 30 | width: auto; 31 | float: left; 32 | } 33 | .sf-navbar a, .sf-navbar a:visited { 34 | border: none; 35 | } 36 | .sf-navbar li.current { 37 | background: #BDD2FF; 38 | } 39 | .sf-navbar li:hover, 40 | .sf-navbar li.sfHover, 41 | .sf-navbar li li.current, 42 | .sf-navbar a:focus, .sf-navbar a:hover, .sf-navbar a:active { 43 | background: #BDD2FF; 44 | } 45 | .sf-navbar ul li:hover, 46 | .sf-navbar ul li.sfHover, 47 | ul.sf-navbar ul li:hover li, 48 | ul.sf-navbar ul li.sfHover li, 49 | .sf-navbar ul a:focus, .sf-navbar ul a:hover, .sf-navbar ul a:active { 50 | background: #D1DFFF; 51 | } 52 | ul.sf-navbar li li li:hover, 53 | ul.sf-navbar li li li.sfHover, 54 | .sf-navbar li li.current li.current, 55 | .sf-navbar ul li li a:focus, .sf-navbar ul li li a:hover, .sf-navbar ul li li a:active { 56 | background: #E6EEFF; 57 | } 58 | ul.sf-navbar .current ul, 59 | ul.sf-navbar ul li:hover ul, 60 | ul.sf-navbar ul li.sfHover ul { 61 | left: 0; 62 | top: 2.5em; /* match top ul list item height */ 63 | } 64 | ul.sf-navbar .current ul ul { 65 | top: -999em; 66 | } 67 | 68 | .sf-navbar li li.current > a { 69 | font-weight: bold; 70 | } 71 | 72 | /*** point all arrows down ***/ 73 | /* point right for anchors in subs */ 74 | .sf-navbar ul .sf-sub-indicator { background-position: -10px -100px; } 75 | .sf-navbar ul a > .sf-sub-indicator { background-position: 0 -100px; } 76 | /* apply hovers to modern browsers */ 77 | .sf-navbar ul a:focus > .sf-sub-indicator, 78 | .sf-navbar ul a:hover > .sf-sub-indicator, 79 | .sf-navbar ul a:active > .sf-sub-indicator, 80 | .sf-navbar ul li:hover > a > .sf-sub-indicator, 81 | .sf-navbar ul li.sfHover > a > .sf-sub-indicator { 82 | background-position: -10px -100px; /* arrow hovers for modern browsers*/ 83 | } 84 | 85 | /*** remove shadow on first submenu ***/ 86 | .sf-navbar > li > ul { 87 | background: transparent; 88 | padding: 0; 89 | -moz-border-radius-bottomleft: 0; 90 | -moz-border-radius-topright: 0; 91 | -webkit-border-top-right-radius: 0; 92 | -webkit-border-bottom-left-radius: 0; 93 | } -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Content/superfish-vertical.css: -------------------------------------------------------------------------------- 1 | /*** adding sf-vertical in addition to sf-menu creates a vertical menu ***/ 2 | .sf-vertical, .sf-vertical li { 3 | width: 10em; 4 | } 5 | /* this lacks ul at the start of the selector, so the styles from the main CSS file override it where needed */ 6 | .sf-vertical li:hover ul, 7 | .sf-vertical li.sfHover ul { 8 | left: 10em; /* match ul width */ 9 | top: 0; 10 | } 11 | 12 | /*** alter arrow directions ***/ 13 | .sf-vertical .sf-sub-indicator { background-position: -10px 0; } /* IE6 gets solid image only */ 14 | .sf-vertical a > .sf-sub-indicator { background-position: 0 0; } /* use translucent arrow for modern browsers*/ 15 | 16 | /* hover arrow direction for modern browsers*/ 17 | .sf-vertical a:focus > .sf-sub-indicator, 18 | .sf-vertical a:hover > .sf-sub-indicator, 19 | .sf-vertical a:active > .sf-sub-indicator, 20 | .sf-vertical li:hover > a > .sf-sub-indicator, 21 | .sf-vertical li.sfHover > a > .sf-sub-indicator { 22 | background-position: -10px 0; /* arrow hovers for modern browsers*/ 23 | } -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Content/themes/smoothness/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Content/uploadify.css: -------------------------------------------------------------------------------- 1 | /* 2 | Uploadify 3 | Copyright (c) 2012 Reactive Apps, Ronnie Garcia 4 | Released under the MIT License 5 | */ 6 | 7 | .uploadify { 8 | position: relative; 9 | margin-bottom: 1em; 10 | } 11 | .uploadify-button { 12 | background-color: #505050; 13 | background-image: linear-gradient(bottom, #505050 0%, #707070 100%); 14 | background-image: -o-linear-gradient(bottom, #505050 0%, #707070 100%); 15 | background-image: -moz-linear-gradient(bottom, #505050 0%, #707070 100%); 16 | background-image: -webkit-linear-gradient(bottom, #505050 0%, #707070 100%); 17 | background-image: -ms-linear-gradient(bottom, #505050 0%, #707070 100%); 18 | background-image: -webkit-gradient( 19 | linear, 20 | left bottom, 21 | left top, 22 | color-stop(0, #505050), 23 | color-stop(1, #707070) 24 | ); 25 | background-position: center top; 26 | background-repeat: no-repeat; 27 | -webkit-border-radius: 30px; 28 | -moz-border-radius: 30px; 29 | border-radius: 30px; 30 | border: 2px solid #808080; 31 | color: #FFF; 32 | font: bold 12px Arial, Helvetica, sans-serif; 33 | text-align: center; 34 | text-shadow: 0 -1px 0 rgba(0,0,0,0.25); 35 | width: 100%; 36 | } 37 | .uploadify:hover .uploadify-button { 38 | background-color: #606060; 39 | background-image: linear-gradient(top, #606060 0%, #808080 100%); 40 | background-image: -o-linear-gradient(top, #606060 0%, #808080 100%); 41 | background-image: -moz-linear-gradient(top, #606060 0%, #808080 100%); 42 | background-image: -webkit-linear-gradient(top, #606060 0%, #808080 100%); 43 | background-image: -ms-linear-gradient(top, #606060 0%, #808080 100%); 44 | background-image: -webkit-gradient( 45 | linear, 46 | left bottom, 47 | left top, 48 | color-stop(0, #606060), 49 | color-stop(1, #808080) 50 | ); 51 | background-position: center bottom; 52 | } 53 | .uploadify-button.disabled { 54 | background-color: #D0D0D0; 55 | color: #808080; 56 | } 57 | .uploadify-queue { 58 | margin-bottom: 1em; 59 | } 60 | .uploadify-queue-item { 61 | background-color: #F5F5F5; 62 | -webkit-border-radius: 3px; 63 | -moz-border-radius: 3px; 64 | border-radius: 3px; 65 | font: 11px Verdana, Geneva, sans-serif; 66 | margin-top: 5px; 67 | max-width: 350px; 68 | padding: 10px; 69 | } 70 | .uploadify-error { 71 | background-color: #FDE5DD !important; 72 | } 73 | .uploadify-queue-item .cancel a { 74 | background: url('../img/uploadify-cancel.png') 0 0 no-repeat; 75 | float: right; 76 | height: 16px; 77 | text-indent: -9999px; 78 | width: 16px; 79 | } 80 | .uploadify-queue-item.completed { 81 | background-color: #E5E5E5; 82 | } 83 | .uploadify-progress { 84 | background-color: #E5E5E5; 85 | margin-top: 10px; 86 | width: 100%; 87 | } 88 | .uploadify-progress-bar { 89 | background-color: #0099FF; 90 | height: 3px; 91 | width: 1px; 92 | } -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Content/uploadify.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Content/uploadify.swf -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Controllers/ControllerBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Web.Mvc; 3 | using System.Web.Security; 4 | 5 | namespace ByteartRetail.Web.MVC.Controllers 6 | { 7 | /// 8 | /// 表示“控制器”Controller类型的基类型,所有Byteart Retail项目下的Controller都 9 | /// 应该继承于此基类型。 10 | /// 11 | public abstract class ControllerBase : Controller 12 | { 13 | #region Private Constants 14 | private const string SuccessPageAction = "SuccessPage"; 15 | private const string SuccessPageController = "Home"; 16 | #endregion 17 | 18 | #region Protected Properties 19 | /// 20 | /// 获取当前登录用户的ID值。 21 | /// 22 | protected Guid UserID 23 | { 24 | get 25 | { 26 | if (Session["UserID"] != null) 27 | return (Guid)Session["UserID"]; 28 | var membershipUser = Membership.GetUser(); 29 | if (membershipUser != null) 30 | { 31 | if (membershipUser.ProviderUserKey != null) 32 | { 33 | var id = new Guid(membershipUser.ProviderUserKey.ToString()); 34 | Session["UserID"] = id; 35 | return id; 36 | } 37 | } 38 | return Guid.Empty; 39 | } 40 | } 41 | #endregion 42 | 43 | #region Protected Methods 44 | /// 45 | /// 将页面重定向到成功页面。 46 | /// 47 | /// 需要在成功页面显示的成功信息。 48 | /// 成功信息显示后返回的Action名称。默认值:Index。 49 | /// 成功信息显示后返回的Controller名称。默认值:Home。 50 | /// 在成功页面停留的时间(秒)。默认值:3。 51 | /// 执行的Action Result。 52 | protected ActionResult RedirectToSuccess(string pageTitle, string action = "Index", string controller = "Home", int waitSeconds = 3) 53 | { 54 | return RedirectToAction(SuccessPageAction, SuccessPageController, new { pageTitle = pageTitle, retAction = action, retController = controller, waitSeconds = waitSeconds }); 55 | } 56 | 57 | #endregion 58 | } 59 | } -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="ByteartRetail.Web.MVC.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | using System.Web.Optimization; 3 | using System.Web.Routing; 4 | using ByteartRetail.Web.MVC.App_Start; 5 | 6 | namespace ByteartRetail.Web.MVC 7 | { 8 | // Note: For instructions on enabling IIS6 or IIS7 classic mode, 9 | // visit http://go.microsoft.com/?LinkId=9394801 10 | public class MvcApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | AreaRegistration.RegisterAllAreas(); 15 | 16 | //WebApiConfig.Register(GlobalConfiguration.Configuration); 17 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 18 | RouteConfig.RegisterRoutes(RouteTable.Routes); 19 | BundleConfig.RegisterBundles(BundleTable.Bundles); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Add.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Add2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Add2.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Admin_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Admin_32.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Back.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Bag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Bag.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Cancel.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Category_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Category_32.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/CopyTo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/CopyTo.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Delete.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Disable.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Edit.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Enable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Enable.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Login.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Logout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Logout.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Product_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Product_32.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Products/29ebfc59_e14a_49bc_9a41_d0796f392475.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Products/29ebfc59_e14a_49bc_9a41_d0796f392475.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Products/2d3df03f_0663_4f9a_8f6c_cb0af683cd23.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Products/2d3df03f_0663_4f9a_8f6c_cb0af683cd23.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Products/333c0de9_cae2_4458_a675_3560e8525ae5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Products/333c0de9_cae2_4458_a675_3560e8525ae5.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Products/43dd3fe6_4203_41dd_b570_2c9eacb7c021.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Products/43dd3fe6_4203_41dd_b570_2c9eacb7c021.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Products/774f83b1_e90d_4ff1_a148_f90af591a865.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Products/774f83b1_e90d_4ff1_a148_f90af591a865.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Products/82d1556f_1238_43ce_a5fd_410cc246162e.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Products/82d1556f_1238_43ce_a5fd_410cc246162e.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Products/ProductImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Products/ProductImage.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Products/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Products/Thumbs.db -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Products/a1c1738a_eaba_4c4c_b683_7c5b4eb64306.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Products/a1c1738a_eaba_4c4c_b683_7c5b4eb64306.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Products/b182e978_85e1_474d_84e3_e505441e9000.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Products/b182e978_85e1_474d_84e3_e505441e9000.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Products/bc0d0d76_3d79_472e_86bb_63a9376d2bab.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Products/bc0d0d76_3d79_472e_86bb_63a9376d2bab.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Products/bc2dbf1a_699a_4eaf_a49f_4eccc199bb55.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Products/bc2dbf1a_699a_4eaf_a49f_4eccc199bb55.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Products/c9285a49_972c_4356_a893_3e2a4e45c17d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Products/c9285a49_972c_4356_a893_3e2a4e45c17d.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Products/d5d4367d_ab87_4687_8d7c_d1544acf50d1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Products/d5d4367d_ab87_4687_8d7c_d1544acf50d1.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Products/d633a09b_479f_4af2_af9d_635b7a59e1b7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Products/d633a09b_479f_4af2_af9d_635b7a59e1b7.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Products/dafeaaed_0b93_45ea_8b04_00dd86c62d5e.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Products/dafeaaed_0b93_45ea_8b04_00dd86c62d5e.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Products/dd34e809_b1fc_4c75_b8f9_c5444a64cb47.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Products/dd34e809_b1fc_4c75_b8f9_c5444a64cb47.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Role_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Role_32.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/SalesOrder_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/SalesOrder_32.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Save.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/ShoppingCart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/ShoppingCart.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/ShoppingCart.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/ShoppingCart.psd -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/ShoppingCart256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/ShoppingCart256.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/ShoppingCart32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/ShoppingCart32.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/ShoppingCart64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/ShoppingCart64.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Success_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Success_32.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Thumbs.db -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/Update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/Update.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/User_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/User_32.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/afterlogo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/afterlogo.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/arrows-ffffff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/arrows-ffffff.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/banner.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/byteartretail_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/byteartretail_logo.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/byteartretail_logo.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/byteartretail_logo.psd -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/byteartretail_logo_trans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/byteartretail_logo_trans.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/byteartretail_logo_trans.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/byteartretail_logo_trans.psd -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/category.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/category.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/close.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/close.gif -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/favicon.ico -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/footer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/footer.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/hard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/hard.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/header.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/logo.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/menu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/menu.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/menu_beforelogo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/menu_beforelogo.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/newtovar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/newtovar.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/op.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/op.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/pic1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/pic1.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/pic2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/pic2.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/pic3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/pic3.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/pic4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/pic4.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/picap.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/picap.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/popular.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/popular.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/shadow.png -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/spacer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/spacer.gif -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/taling.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/taling.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/taling_center.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/taling_center.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Images/trash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Images/trash.jpg -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Models/LoginModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace ByteartRetail.Web.MVC.Models 4 | { 5 | public class LoginModel 6 | { 7 | [Required] 8 | [Display(Name = "用户名")] 9 | public string UserName { get; set; } 10 | 11 | [Required] 12 | [DataType(DataType.Password)] 13 | [Display(Name = "密码")] 14 | public string Password { get; set; } 15 | 16 | [Display(Name = "记住密码?")] 17 | public bool RememberMe { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ByteartRetail.Web.MVC")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ByteartRetail.Web.MVC")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("6420ad6f-0d63-48d4-bfac-2f574c2a95e7")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Scripts/_references.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daxnet/ByteartRetail_Apworks/edb5051085578866056ad32893b0a03877191911/ByteartRetail.Web.MVC/Scripts/_references.js -------------------------------------------------------------------------------- /ByteartRetail.Web.MVC/Scripts/jquery.bgiframe.min.js: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net) 2 | * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 3 | * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. 4 | * 5 | * $LastChangedDate: 2007-06-19 20:25:28 -0500 (Tue, 19 Jun 2007) $ 6 | * $Rev: 2111 $ 7 | * 8 | * Version 2.1 9 | */ 10 | (function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&parseInt($.browser.version)<=6){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='