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注解 八.校验.及定制与扩展 九.跨域 ...
随机推荐
- CSS实现垂直居中的5种方法
利用 CSS 来实现对象的垂直居中有许多不同的方法,比较难的是选择那个正确的方法.我下面说明一下我看到的好的方法和怎么来创建一个好的居中网站. 使用 CSS 实现垂直居中并不容易.有些方法在一些浏览器 ...
- google gtest window 平台应用
下载gtest:https://code.google.com/p/googletest/downloads/detail?name=gtest-1.7.0.zip 编译: 会出现的问题:error ...
- Linux makefile 教程 非常详细,且易懂
最近在学习Linux下的C编程,买了一本叫<Linux环境下的C编程指南>读到makefile就越看越迷糊,可能是我的理解能不行. 于是google到了以下这篇文章.通俗易懂.然后把它贴出 ...
- java中的集合类(Collection)中的Set
set集合不包含重复元素及与我们无关的排序!我说hibernate实体类中的集合都用Set呢,难道是因为这个?
- Date 对象中的 getYear 和 getFullYear方法
生成一个新的日期对象 : var someDate=new Date(); 获取日期月份中的天数: var date=someDate.getDate(); 获取 4 位数的年份: var year= ...
- unity, 只发射一个粒子的粒子系统
- Android 手机蓝牙接收文件夹
网上很多都没用用,只能自己研究了 /mnt/emmc/downloads/bluetooth
- MVC 下 JsonResult 的使用方法(JsonRequestBehavior.AllowGet)【转】
MVC 默认 Request 方式为Get. actionpublic JsonResult GetPersonInfo(){var person = new{Name = "张三" ...
- Unexpected end of file from server 服务器访问问题导致
Caused by: java.net.SocketException: SocketException invoking http://xxxx/cxf/xh/creditInterface?wsd ...
- 免费提供UG、ProE二次开发、定制化开发服务
免费提供UG.ProE二次开发,定制开发服务. 拥有六年UG.ProE二次开发经验,相关项目经验. 从事过智能设计.计算机图形学相关研究. 联系方式: QQ:1787326383 微信号:begtos ...