zoukankan      html  css  js  c++  java
  • 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>                  
        }
    }
  • 相关阅读:
    微软一站式技术框架(AllInOne Code Framework(AIO)) 登陆 MSDN中国首页
    The stepbystep guide of making a C# (or VB.NET) Windows 7 Trigger Start Service
    AllInOne Code Framework: 微软一站式开发技术框架 示例命名规则和目录结构说明
    Windows 7 新特性 Shell Library 编程接口介绍
    一步一步教你如何编写VC#,VB.NET或VC++代码玩转Windows Shell Known Folders
    微软一站式开发技术框架解决方案 年内展望
    AllInOne Code Framework: 微软一站式开发技术框架解决方案 2009730 新增sample code简介
    AllInOne Code Framework: 微软一站式开发技术框架 2009917 新增代码示例简介
    AllInOne Code Framework: 微软一站式开发技术框架解决方案 2009826 新增sample code简介
    微软 AllInOne Code Framework (AIO) 客户端应用程序 期待您的见解
  • 原文地址:https://www.cnblogs.com/imxh/p/6002785.html
Copyright © 2011-2022 走看看