Nopcommerce 二次开发2 WEB
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Syndication;
using System.Web.Mvc;
using Nop.Core;
using Nop.Core.Caching;
using Nop.Core.Domain.Customers;
using Nop.Core.Domain.Localization;
using Nop.Core.Domain.Media;
using Nop.Core.Domain.Hotels;
using Nop.Services.Common;
using Nop.Services.Customers;
using Nop.Services.Helpers;
using Nop.Services.Localization;
using Nop.Services.Logging;
using Nop.Services.Media;
using Nop.Services.Messages;
using Nop.Services.Hotels;
using Nop.Services.Security;
using Nop.Services.Seo;
using Nop.Services.Stores;
using Nop.Web.Framework;
using Nop.Web.Framework.Controllers;
using Nop.Web.Framework.Security;
using Nop.Web.Framework.Security.Captcha;
using Nop.Web.Infrastructure.Cache;
//using Nop.Web.Models.Hotels; namespace Nop.Web.Controllers
{
public class HotelController : Controller
{ #region Fields private readonly IWorkContext _workContext;
private readonly IStoreContext _storeContext;
private readonly IPictureService _pictureService;
private readonly ILocalizationService _localizationService;
private readonly IDateTimeHelper _dateTimeHelper;
private readonly IWorkflowMessageService _workflowMessageService;
private readonly IWebHelper _webHelper;
private readonly ICacheManager _cacheManager;
private readonly ICustomerActivityService _customerActivityService;
private readonly IStoreMappingService _storeMappingService;
private readonly IPermissionService _permissionService;
private readonly MediaSettings _mediaSettings;
private readonly LocalizationSettings _localizationSettings;
private readonly CustomerSettings _customerSettings;
private readonly IHotelService _hotelService; #endregion #region Constructors public HotelController(IWorkContext workContext,
IStoreContext storeContext,
IPictureService pictureService,
ILocalizationService localizationService,
IDateTimeHelper dateTimeHelper,
IWorkflowMessageService workflowMessageService,
IWebHelper webHelper,
ICacheManager cacheManager,
ICustomerActivityService customerActivityService,
IStoreMappingService storeMappingService,
IPermissionService permissionService,
MediaSettings mediaSettings,
LocalizationSettings localizationSettings,
CustomerSettings customerSettings,
CaptchaSettings captchaSettings,
IHotelService hotelService)
{ this._workContext = workContext;
this._storeContext = storeContext;
this._pictureService = pictureService;
this._localizationService = localizationService;
this._dateTimeHelper = dateTimeHelper;
this._workflowMessageService = workflowMessageService;
this._webHelper = webHelper;
this._cacheManager = cacheManager;
this._customerActivityService = customerActivityService;
this._storeMappingService = storeMappingService;
this._permissionService = permissionService;
this._mediaSettings = mediaSettings;
this._localizationSettings = localizationSettings;
this._customerSettings = customerSettings;
this._hotelService = hotelService;
} #endregion
// GET: Hotel
public ActionResult Index()
{
return View();
} public ActionResult List()
{
var hotels= _hotelService.GetAllHotels();
return View(hotels);
}
}
}
@model IEnumerable<Hotel>
@using Nop.Core.Domain.Hotels;
@{
Layout = "~/Views/Shared/_ColumnsTwo.cshtml"; //title
Html.AddTitleParts(T("PageTitle.NewsArchive").Text);
//page class
Html.AppendPageCssClassParts("html-news-list-page");
}
<h2>Hotels</h2> @{
foreach (var hotel in Model)
{
<h1>
@hotel.Name
</h1>
<h2>
@hotel.Introduce
</h2>
}
}
Nopcommerce 二次开发2 WEB的更多相关文章
- Nopcommerce 二次开发0
Nopcommerce 是国外的一个高质量的开源b2c网站系统,基于EntityFramework6.0和MVC5.0,使用Razor模板引擎,有很强的插件机制,包括支付配送功能都是通过插件来实现的 ...
- Nopcommerce 二次开发2 Admin
Admin 菜单 增加 siteMap.config增加一行 <siteMapNode SystemName="Hotels" nopResource="Admin ...
- Nopcommerce 二次开发1 基础
1 Doamin 酒店 namespace Nop.Core.Domain.Hotels { /// <summary> /// 酒店 /// </summary> p ...
- nopcommerce 二次开发
http://www.cnblogs.com/nopcommerce-b2c/ http://www.nopchina.net/ 数据库结构 http://www.xcode.me/open/docu ...
- C# 开发XML Web Service与Java开发WebService
一.web service基本概念 Web Service也叫XML Web Service WebService是一种可以接收从Internet或者Intranet上的其它系统中传递过来的请求,轻量 ...
- C#进行Visio二次开发之文件导出及另存Web页面
在我前面很多关于Visio的开发过程中,介绍了各种Visio的C#开发应用场景,包括对Visio的文档.模具文档.形状.属性数据.各种事件等相关的基础处理,以及Visio本身的整体项目应用,虽然时间过 ...
- Python开发【第二十二篇】:Web框架之Django【进阶】
Python开发[第二十二篇]:Web框架之Django[进阶] 猛击这里:http://www.cnblogs.com/wupeiqi/articles/5246483.html 博客园 首页 ...
- NopCommerce上二次开发 触发器记录
最近要在NopCommerce上二次开发. 开发也就算了,该项目的架构设计很好,但性能不可谓不低. 扯远了,为了保持项目以后升级顺利,开次开发不允许在原项目基础上大改,只能以插件形式开发…… 因一个功 ...
- Solon Web 开发,二、开发知识准备
Solon Web 开发 一.开始 二.开发知识准备 三.打包与运行 四.请求上下文 五.数据访问.事务与缓存应用 六.过滤器.处理.拦截器 七.视图模板与Mvc注解 八.校验.及定制与扩展 九.跨域 ...
随机推荐
- python之模块安装
在python中,python官方提供了很多可以扩展的包,用以增强python的功能. 因为用到了excel的读写功能,需要安装xlrd的包,一下是安装步骤 1.首先从python的官方库下载相应的包 ...
- Ruby 方法
Ruby 方法 Ruby 方法与其他编程语言中的函数类似.Ruby 方法用于捆绑一个或多个重复的语句到一个单元中. 方法名应以小写字母开头.如果您以大写字母作为方法名的开头,Ruby 可能会把它当作常 ...
- LEETCODE —— Surrounded Regions
Total Accepted: 43584 Total Submissions: 284350 Difficulty: Medium Given a 2D board containing 'X' a ...
- 存储过程中使用事务,sql server 事务,sql事务
一.存储过程中使用事务的简单语法 在存储过程中使用事务时非常重要的,使用数据可以保持数据的关联完整性,在Sql server存储过程中使用事务也很简单,用一个例子来说明它的语法格式: 代码 ...
- SQLAlchemy 几种查询方式总结
转自:http://blog.csdn.net/shudaqi2010/article/details/51568219 几种常见sqlalchemy查询:#简单查询 print(session ...
- SQLSERVER 复制同一张表的递归结构
CREATE PROCEDURE [dbo].[Pro_Copy] @OLDJiFenSeriesId VARCHAR(), @NEWJiFenSeriesId VARCHAR() AS BEGIN ...
- LeetCode "Arranging Coins"
A simple math.. take care of data overflow though. class Solution { public: int arrangeCoins(int n) ...
- <<测试驱动开发的艺术>>读书笔记
TDD通过边测试边编写代码,然后重构来防止重构所引起的错误 通过自动化测试和持续集成工具,随时保持可以发布 TDD第一步: 1. 需求分解 2. 将需求转化成测试 3. 写一个失败的测试 4. 逐步通 ...
- EasyUI TreeGrid DataTable转换数据实现案例
C#部分 /// <summary> /// Handler1 的摘要说明 /// </summary> public class Handler1 : IHttpHandle ...
- 如何用Jupyter Notebook打开Spark
电脑已经装了anaconda python,然后下载了spark2.1.0.因为版本太新,所以网上和书上的一些内容已经不再适用.比如关于如何使用IPython和Jupyter,教程给出的方法是用如下语 ...