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的更多相关文章

  1. Nopcommerce 二次开发0

    Nopcommerce  是国外的一个高质量的开源b2c网站系统,基于EntityFramework6.0和MVC5.0,使用Razor模板引擎,有很强的插件机制,包括支付配送功能都是通过插件来实现的 ...

  2. Nopcommerce 二次开发2 Admin

    Admin 菜单 增加 siteMap.config增加一行 <siteMapNode SystemName="Hotels" nopResource="Admin ...

  3. Nopcommerce 二次开发1 基础

    1  Doamin    酒店 namespace Nop.Core.Domain.Hotels { /// <summary> /// 酒店 /// </summary> p ...

  4. nopcommerce 二次开发

    http://www.cnblogs.com/nopcommerce-b2c/ http://www.nopchina.net/ 数据库结构 http://www.xcode.me/open/docu ...

  5. C# 开发XML Web Service与Java开发WebService

    一.web service基本概念 Web Service也叫XML Web Service WebService是一种可以接收从Internet或者Intranet上的其它系统中传递过来的请求,轻量 ...

  6. C#进行Visio二次开发之文件导出及另存Web页面

    在我前面很多关于Visio的开发过程中,介绍了各种Visio的C#开发应用场景,包括对Visio的文档.模具文档.形状.属性数据.各种事件等相关的基础处理,以及Visio本身的整体项目应用,虽然时间过 ...

  7. Python开发【第二十二篇】:Web框架之Django【进阶】

    Python开发[第二十二篇]:Web框架之Django[进阶]   猛击这里:http://www.cnblogs.com/wupeiqi/articles/5246483.html 博客园 首页 ...

  8. NopCommerce上二次开发 触发器记录

    最近要在NopCommerce上二次开发. 开发也就算了,该项目的架构设计很好,但性能不可谓不低. 扯远了,为了保持项目以后升级顺利,开次开发不允许在原项目基础上大改,只能以插件形式开发…… 因一个功 ...

  9. Solon Web 开发,二、开发知识准备

    Solon Web 开发 一.开始 二.开发知识准备 三.打包与运行 四.请求上下文 五.数据访问.事务与缓存应用 六.过滤器.处理.拦截器 七.视图模板与Mvc注解 八.校验.及定制与扩展 九.跨域 ...

随机推荐

  1. Git远程仓库(github

    一.创建远程仓库(github) 首先到https://github.com注册一个账号,创建自己的Git,点击repositories,再点new 名字自定义,比如叫fansik,选择public点 ...

  2. Android 图片上传

    上传方式:两种   1:Base64() (1):获取图片路径,将图片转为String 类型 (2):通过post提交的方式.以键值对的方式上传到服务器,和一般的提交关键字没有任何区别. (3):这种 ...

  3. java POI 解析excel 2003和2007 直接转为List<Map> 返回

    1.POI 官网下载jar包,3.5以上 2.项目导入jar包 3.参数:String数组--对应的excel列名对应的KEY,File  excel文件,sheetNumber ---excel的s ...

  4. 影响div背景色显示的问题

    说来惭愧,走上程序猿这条不归路已经一年了,却连自己的博客都没有.看到道上有脸面的大神博客都做得贼漂亮~~于是,按捺不住了~~ 今天终于开通了博客园博客,正式开始我的博客人生啦!!!~~吼吼~~ 废话少 ...

  5. 鼠标光标聚焦到可编辑div的最末尾

    <p> <div id='text' contenteditable=true style='width:100px;height:100px;border:1px #ccc;'&g ...

  6. ExtJs 学习之开篇(-)之define

    Ext.onReady(function(){    /**     * test1,声明一个类,定义类中的方法     */ Ext.define("demo.Demo",{   ...

  7. 【转】深入 Docker:容器和镜像

    在本专栏往期的 Flux7 系列教程 里,我们已经简单地探讨了 Docker 的基本操作.而在那篇教程中,我们一直是简单地将容器当成是"正在运行的镜像",并没有深入地区分镜像和容器 ...

  8. mybatis 与 日志

    如上图所示,mybatis默认支持7种日志记录的方式,也可以自己实现Log接口,然后将实现类通过LogFactory注入到日志工厂中. LogFactory是日志模块的入口,外层通过getLog获取L ...

  9. ionic 常见问题

    1.Couldn't find ionic.config.json file. ? a.在C:\Users\(Username)\.ionic目录下有ionic.config这个文件 添加后缀名jso ...

  10. [Linux] - Virtualbox-CentOS动态增加分区空间方法

    VirtualBox使用中,有时会因为当初分配空间不足导致出问题,可以使用如下方式增加分区空间: 一.VirtualBox设置: 1)到VirtualBox的安装目录下找到这个命令exe文件:vbox ...