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注解 八.校验.及定制与扩展 九.跨域 ...
随机推荐
- iOS 自定义选项卡-CYLTabBarController
正常的选项卡流程 cocoapods就不说了 创建一个CYLTabBarControllerConfig类 #import <Foundation/Foundation.h> #impor ...
- 深入理解javascript--笔记
书写可维护的代码 1,最小全局变量 在js中不用声明变量就可以直接使用,因此注意不要没有声明就使用.(无意中创建的全局变量)比如使用任务链进行var声明.var a=b=12;正确写法为var ...
- python之模块安装
在python中,python官方提供了很多可以扩展的包,用以增强python的功能. 因为用到了excel的读写功能,需要安装xlrd的包,一下是安装步骤 1.首先从python的官方库下载相应的包 ...
- Shiro中的subject.login()
当调用ShiroHandler中的subject.login()的时候,会自动调用Realm中的doGetAuthenticationInfo方法.
- 开发时建议关闭chrome的缓存[Disable cache(while DevTools open)]
问题:修改了css,JS后,chrome看不到效果 具体情景:最近在写一个PHPbbs,在写CSS时,习惯性的按F5刷新,firefox ie等,都能即时见到效果,唯独chrome 怎么都不行,想了想 ...
- LeetCode----Linked List
Swap Nodes in Pairs 思路:需要构造一个头指针,指向链表.一次比较两个指针,将其翻转,临界条件是pre != null(链表长度为偶数) && pre.next != ...
- ubuntu安装php5.3
sudo -i wget http://in1.php.net/distributions/php-5.3.29.tar.bz2 .tar.bz2 cd php- apt-get install li ...
- 安装zabbix,make的时候报错
CDPATH= && /bin/bash /install/Mesa-/bin/missing aclocal-1.14 -I m4 /install/Mesa-/bin/missin ...
- asp.net动态设置标题title 关键字keywords 描述descrtptions
推荐的简单做法如下: protected void Page_Load(object sender, EventArgs e){//Page titlePage.Title = "This ...
- Intellij IDEA +MAVEN+Jetty实现Mybatis的HelloWorld
1 maven配置:pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="ht ...