/// <summary>
 /// 默认构造函数
 /// </summary>
 /// <param name="accountService">帐号服务接口</param>
 /// <param name="gloCache">全局缓存</param>
 public AccountController(IAccountService accountService,
     GlobalCache gloCache)
 {
     this.accountService = accountService;
     this.gloCache = gloCache;
     ViewBag.UserCount = gloCache.UserCount();
 }
 private ActionResult PublishHouse(BuyViewHouse house)
 {
     if (BuildHouse(house))
     {
         HouseBuyInfo transferhouse = MapperCar(house);
         buyService.SaveBuyHouse(transferhouse);
         RunJob();
         FxCacheService.FxSite.GlobalCache cache = System.Web.Mvc.DependencyResolver.Current.GetService <FxCacheService.FxSite.GlobalCache>();
         cache.InfoPublishAllCountAdd();
         return(View("Success"));
     }
     return(View("FaildTransfer"));
 }
 private ActionResult PublishCar(TransferViewCar car, List <HttpPostedFileBase> facefile, List <HttpPostedFileBase> otherfile, List <HttpPostedFileBase> badfile)
 {
     if (BuildCar(car, facefile, otherfile, badfile))
     {
         CarTransferInfo transfercar = MapperCar(car);
         transferService.SaveTransferCar(transfercar);
         RunJob();
         FxCacheService.FxSite.GlobalCache cache = System.Web.Mvc.DependencyResolver.Current.GetService <FxCacheService.FxSite.GlobalCache>();
         cache.InfoPublishAllCountAdd();
         return(View("Success"));
     }
     return(View("FaildTransfer"));
 }
示例#4
0
 /// <summary>
 /// 车辆发布
 /// </summary>
 /// <param name="car">车辆求购信息视图模型</param>
 /// <returns>跳转成功页面或者失败页面</returns>
 private ActionResult PublishCar(BuyViewCar car)
 {
     if (BuildCar(car))
     {
         CarBuyInfo buycar = MapperCar(car);
         buyService.SaveBuyCar(buycar);
         RunJob();
         FxCacheService.FxSite.GlobalCache cache = System.Web.Mvc.DependencyResolver.Current.GetService <FxCacheService.FxSite.GlobalCache>();
         cache.InfoPublishAllCountAdd();
         return(View("Success"));
     }
     return(View("FaildTransfer"));
 }
 private ActionResult PublishGoods(BuyViewGoods goods, List <HttpPostedFileBase> facefile, List <HttpPostedFileBase> otherfile, List <HttpPostedFileBase> badfile)
 {
     if (BuildGoods(goods, facefile, otherfile, badfile))
     {
         GoodsBuyInfo transfergoods = MapperGoods(goods);
         buyService.SaveBuyGoods(transfergoods);
         RunJob();
         FxCacheService.FxSite.GlobalCache cache = System.Web.Mvc.DependencyResolver.Current.GetService <FxCacheService.FxSite.GlobalCache>();
         cache.InfoPublishAllCountAdd();
         return(View("Success"));
     }
     return(View("FaildTransfer"));
 }
 public UserCenterController(GlobalCache gloablCache,
     ICarUserCenter carUserCenter,
     IGoodsUserCenter goodsUserCenter,
     IHouseUserCenter houseUserCenter,
     IPrivateMessage privateMessage,
     IFavorite favorite)
 {
     this.gloablCache = gloablCache;
     this.carUserCenter = carUserCenter;
     this.houseUserCenter = houseUserCenter;
     this.goodsUserCenter = goodsUserCenter;
     this.privateMessage = privateMessage;
     this.favorite = favorite;
 }
示例#7
0
        public AdminController(GlobalCache gloablCache,
            ICarUserCenter carUserCenter,
            IGoodsUserCenter goodsUserCenter,
            IHouseUserCenter houseUserCenter,
            ITopShow topShow,
            IBuyGoods buyGoods,
            ITransferGoods transferGoods,
            IBuyCar buyCar,
            ITransferCar transferCar,
            IBuyHouse buyHouse,
            ITransferHouse transferHouse,
            ICarBuyJob carBuyJob,
            ICarTransferJob carTransferJob,
            IHouseBuyJob houseBuyJob,
            IHouseTransferJob houseTransferJob,
            IGoodsBuyJob goodsBuyJob,
            IGoodsTransferJob goodsTransferJob)
        {
#if DEBUG

#else
            if (User == null || User.Identity == null || 
                User.Identity.Name == null || !User.Identity.Name.Equals("*****@*****.**"))
            {
                RedirectPermanent("http://yingtao.co.uk/Home/Index");
            }
#endif
            this.gloablCache = gloablCache;
            this.carUserCenter = carUserCenter;
            this.houseUserCenter = houseUserCenter;
            this.goodsUserCenter = goodsUserCenter;
            this.topShow = topShow;
            this.buyGoods = buyGoods;
            this.transferGoods = transferGoods;
            this.buyCar = buyCar;
            this.transferCar = transferCar;
            this.buyHouse = buyHouse;
            this.transferHouse = transferHouse;
            this.carBuyJob = carBuyJob;
            this.carTransferJob = carTransferJob;
            this.houseBuyJob = houseBuyJob;
            this.houseTransferJob = houseTransferJob;
            this.goodsBuyJob = goodsBuyJob;
            this.goodsTransferJob = goodsTransferJob;
        }
示例#8
0
        public BaseUnit()
        {
            container=SimpleInjectorInitializer.Initialize();

               gloCache = container.GetInstance<GlobalCache>();
        }