Exemplo n.º 1
0
        public static void Init(IList <Action <Type> > actions)
        {
            if (BrEngineContext.Current == null)
            {
                if (actions == null)
                {
                    actions = new List <Action <Type> >();
                }
                actions.Add(t =>
                {
                    //IRoutePublish
                    var routes = new List <IRoutePublish>();
                    if (typeof(IRoutePublish).IsAssignableFrom(t))
                    {
                        routes.Add((IRoutePublish)Activator.CreateInstance(t));
                    }
                    if (routes.Any())
                    {
                        routes.OrderBy(x => x.Order).ToList().ForEach(m => m.Publish(RouteTable.Routes));
                    }
                });

                BrEngineContext.Init(actions);
                //set dependency resolver
                DependencyResolver.SetResolver(new AutofacDependencyResolver(BrEngineContext.Current));
                //remove all view engines
                //ViewEngines.Engines.Clear();
                //except the themeable razor view engine we use
                //ViewEngines.Engines.Add(new DefaultViewEngine());
            }
        }
 public void Init()
 {
     BrEngineContext.Init(null);
     _RoleService = BrEngineContext.Current.Resolve <IAC_RoleService>();
     //BrMvcEngineContext.Init(null);
     //this._RoleService =
     //    BrMvcEngineContext.Current.Resolve<IAC_RoleService>();
 }
Exemplo n.º 3
0
 /// <summary>
 /// 应用程序的主入口点。
 /// </summary>
 static void Main()
 {
     BrEngineContext.Init(null);
     ServiceBase[] ServicesToRun;
     ServicesToRun = new ServiceBase[]
     {
         new RunService()
     };
     ServiceBase.Run(ServicesToRun);
 }
Exemplo n.º 4
0
        public static void Init(IList <Action <Type> > actions)
        {
            if (BrEngineContext.Current == null)
            {
                if (actions == null)
                {
                    actions = new List <Action <Type> >();
                }

                BrEngineContext.Init(actions);
                //set dependency resolver
                //var configuration = Configuration;
                GlobalConfiguration.Configuration.DependencyResolver = new AutofacWebApiDependencyResolver(BrEngineContext.Current);
            }
        }
Exemplo n.º 5
0
        public static void Main(string[] args)
        {
            BrEngineContext.Init(null);
            ILog log = LogManager.GetLogger("logger-name");

            IScheduler _scheduler = null;

            try
            {
                DateTimeOffset runTime = DateTimeOffset.UtcNow;
                DateTimeOffset.TryParse(DateTime.Now.ToShortDateString(), out runTime);
                int hour             = int.Parse(ConfigurationManager.AppSettings["Hour"]);
                int minute           = int.Parse(ConfigurationManager.AppSettings["Minute"]);
                ISchedulerFactory sf = new StdSchedulerFactory();//执行者
                _scheduler = sf.GetScheduler();


                IJobDetail job1 = JobBuilder.Create <CashBackJob>()
                                  .WithIdentity("CashBackJob", "group1").Build();
                //执行返现操作 每天固定时间执行
                ITrigger trigger1 = TriggerBuilder.Create()
                                    .StartNow()
                                    .WithDailyTimeIntervalSchedule(
                    a => a.WithIntervalInHours(24).OnEveryDay().StartingDailyAt(TimeOfDay.HourAndMinuteOfDay(hour, minute)))
                                    .Build();

                IJobDetail bounsJob = JobBuilder.Create <BounsJob>()
                                      .WithIdentity("会员购物订单返现订单生成服务", "BounsJobGroup")
                                      .Build();
                ITrigger orderTrigger = TriggerBuilder.Create()
                                        .WithIdentity(Guid.NewGuid().ToString(), "BounsJobName")
                                        .StartNow()
                                        .WithSimpleSchedule(x => x
                                                            .WithIntervalInMinutes(1)
                                                            .RepeatForever())
                                        .Build();
                _scheduler.ScheduleJob(bounsJob, orderTrigger);

                //_scheduler.ScheduleJob(job1, trigger1);
                _scheduler.Start();
                log.Info("Quartz服务成功启动");
            }
            catch (Exception ex)
            {
                log.Error(ex);
            }
        }
 public void Init()
 {
     BrEngineContext.Init(null);
     this._SKU_AttributesService = BrEngineContext.Current.Resolve <ISKU_AttributesService>();
 }
Exemplo n.º 7
0
 public void Init()
 {
     BrEngineContext.Init(null);
     _database             = BrEngineContext.Current.Resolve <IDatabaseHelper>();
     _floorCategoryService = BrEngineContext.Current.Resolve <IFloorCategoryService>();
 }
 public void SetUp()
 {
     BrEngineContext.Init(null);
     this._return_GoodsService = BrEngineContext.Current.Resolve <IReturnProductInfoService>();
 }
Exemplo n.º 9
0
 public void Init()
 {
     BrEngineContext.Init(null);
     _database            = BrEngineContext.Current.Resolve <IDatabaseHelper>();
     _paymentOrderService = BrEngineContext.Current.Resolve <IPaymentOrderService>();
 }
Exemplo n.º 10
0
 public void Init()
 {
     BrEngineContext.Init(null);
     this._bannerService = BrEngineContext.Current.Resolve <IbannerService>();
 }
Exemplo n.º 11
0
        public void SetUp()
        {
            BrEngineContext.Init(null);

            this._shoppingCartService = BrEngineContext.Current.Resolve <IShoppingCartService>();
        }
Exemplo n.º 12
0
 public void Init()
 {
     BrEngineContext.Init(null);
     this._userLoginLogService = BrEngineContext.Current.Resolve <IAC_OperateLogService>();
 }
Exemplo n.º 13
0
 public void Init()
 {
     BrEngineContext.Init(null);
     this.shipmentService = BrEngineContext.Current.Resolve <IShipmentService>();
 }
 public void Init()
 {
     BrEngineContext.Init(null);
     _database         = BrEngineContext.Current.Resolve <IDatabaseHelper>();
     _suppliersService = BrEngineContext.Current.Resolve <ISuppliersService>();
 }
Exemplo n.º 15
0
 public void Init()
 {
     BrEngineContext.Init(null);
     this._dbContext          = BrEngineContext.Current.Resolve <IBcDbContext>();
     this._userAddressService = BrEngineContext.Current.Resolve <IUserAddressService>();
 }
 public void Init()
 {
     BrEngineContext.Init(null);
     this._zJ_WithdrawOrderService = BrEngineContext.Current.Resolve <IZJ_WithdrawOrderService>();
 }
Exemplo n.º 17
0
 public void Init()
 {
     BrEngineContext.Init(null);
     this._OrderService      = BrEngineContext.Current.Resolve <IOrderService>();
     this._enctyptionService = BrEngineContext.Current.Resolve <IEncryptionService>();
 }
Exemplo n.º 18
0
 public void Init()
 {
     BrEngineContext.Init(null);
     this._dbContext     = BrEngineContext.Current.Resolve <IBcDbContext>();
     this._acUserService = BrEngineContext.Current.Resolve <IAC_UserService>();
 }
Exemplo n.º 19
0
 public void Init()
 {
     BrEngineContext.Init(null);
     _database            = BrEngineContext.Current.Resolve <IDatabaseHelper>();
     _salesProductService = BrEngineContext.Current.Resolve <ISalesProductService>();
 }
 public void Init()
 {
     BrEngineContext.Init(null);
     _aC_FunctionService = BrEngineContext.Current.Resolve <IAC_FunctionService>();
 }
 public void Init()
 {
     BrEngineContext.Init(null);
     this._zjRechargeOrderService = BrEngineContext.Current.Resolve <IZJ_RechargeOrderService>();
 }
 public void Init()
 {
     BrEngineContext.Init(null);
     _acDepartmentService = BrEngineContext.Current.Resolve <IAC_DepartmentService>();
 }
Exemplo n.º 23
0
 public void Init()
 {
     BrEngineContext.Init(null);
     _database            = BrEngineContext.Current.Resolve <IDatabaseHelper>();
     _productImageService = BrEngineContext.Current.Resolve <IProductImageService>();
 }
Exemplo n.º 24
0
 public void Init()
 {
     BrEngineContext.Init(null);
     this._dbContext           = BrEngineContext.Current.Resolve <IBcDbContext>();
     this._parameterSetService = BrEngineContext.Current.Resolve <IParameterSetService>();
 }
Exemplo n.º 25
0
 public void Init()
 {
     BrEngineContext.Init(null);
     this._zjUserBalanceChangeLogService = BrEngineContext.Current.Resolve <IZJ_UserBalanceChangeLogService>();
 }
Exemplo n.º 26
0
 public void SetUp()
 {
     BrEngineContext.Init(null);
     this._complaintsService = BrEngineContext.Current.Resolve <IComplaintsService>();
 }
 public void Init()
 {
     BrEngineContext.Init(null);
     this._sp_productCommentService = BrEngineContext.Current.Resolve <ISP_ProductCommentService>();
 }
Exemplo n.º 28
0
 public void Init()
 {
     BrEngineContext.Init(null);
     this._newInfoService = BrEngineContext.Current.Resolve <INewInfoService>();
 }
Exemplo n.º 29
0
 public void Init()
 {
     BrEngineContext.Init(null);
     this._dbContext   = BrEngineContext.Current.Resolve <IBcDbContext>();
     this._baseService = BrEngineContext.Current.Resolve <IBrandService>();
 }
Exemplo n.º 30
0
 public void Init()
 {
     BrEngineContext.Init(null);
     this._FloorConfigService = BrEngineContext.Current.Resolve <IFloorConfigService>();
 }