Пример #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            //显示初始化提示框
            GuoKun.CustomControls.CustomMessageBox messageBox = new GuoKun.CustomControls.CustomMessageBox("系统正在初始化······");
            messageBox.Show();
            this.DispatcherUnhandledException          += App_DispatcherUnhandledException;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            //加载系统样式
            ResourceDictionary defaultDictionary = new ResourceDictionary()
            {
                Source = new Uri("/GuoKun.Themes;component/Themes/Default.xaml", UriKind.RelativeOrAbsolute),
            };

            this.Resources.MergedDictionaries.Add(defaultDictionary);

            //系统初始化
            BootstrapperConfiguration     bootstrapperConfiguration = ConfigurationManager.GetSection("account/bootstrapper") as BootstrapperConfiguration;
            CustomMefBootstrapper <Shell> bootstrapper = new CustomMefBootstrapper <Shell>(bootstrapperConfiguration);

            bootstrapper.Run(true);

            _log = UnityContainerFactory.GetUnityContainer().Resolve <ILog>();

            messageBox.Close();
            Application.Current.MainWindow.Show();
        }
Пример #2
0
 public VMMonthlyManagement(IEventAggregator eventAggregator)
 {
     this._start               = DateTime.Now.AddMonths(-3).ToString("yyyy-MM");
     this._end                 = DateTime.Now.Date.ToString("yyyy-MM");
     this._monthlys            = new ObservableCollection <MonthlyModel>();
     this._monthlyManager      = UnityContainerFactory.GetUnityContainer().Resolve <IMonthlyManager>();
     this._eventAggregator     = eventAggregator;
     this._scptManifestRefresh = this._eventAggregator.GetEvent <ManifestRefreshEvent>().Subscribe(this._manifestRefresh, ThreadOption.UIThread);
     this.Refresh              = new DelegateCommand <string>(RefreshExecute, CanExecuteRefresh);
     this.RefreshMonthly(false);
 }
        public static void Register(HttpConfiguration config)
        {
            // Web API 配置和服务

            // Web API 路由
            config.MapHttpAttributeRoutes();

            config.DependencyResolver = new UnityDependencyResolver(UnityContainerFactory.GetUnityContainer());

            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
                );
            config.Routes.MapHttpRoute(
                name: "CustomApi",
                routeTemplate: "customapi/{controller}/{action}/{id}",
                defaults: new { id = RouteParameter.Optional }
                );
        }
Пример #4
0
        public VMDailyManagement(IEventAggregator eventAggregator)
        {
            _eventAggregator = eventAggregator;
            DateTime now     = DateTime.Now.Date;
            int      subDays = (int)now.DayOfWeek;

            if (subDays == 0)
            {
                this._start = now.AddDays(-6);
            }
            else
            {
                this._start = now.AddDays(1 - subDays);
            }
            this._end            = DateTime.Now;
            this._dailys         = new ObservableCollection <DailyModel>();
            _container           = UnityContainerFactory.GetUnityContainer();
            _dailyManagement     = _container.Resolve <IDailyManager>();
            _scptManifestRefresh = _eventAggregator.GetEvent <ManifestRefreshEvent>().Subscribe(this._manifestRefresh, ThreadOption.UIThread);
            this.Refresh         = new DelegateCommand <string>(RefreshExecute, CanExecuteRefresh);
            this.RefreshDaily(false);
        }
Пример #5
0
 public VMAddOrUpdateManifest(ManifestModel model)
 {
     this._isAdd = model == null;
     if (_isAdd)
     {
         _model = new ManifestModel()
         {
             Date = DateTime.Now.Date
         };
     }
     else
     {
         _model = new ManifestModel()
         {
             ID     = model.ID,
             Date   = model.Date,
             Cost   = model.Cost,
             Remark = model.Remark
         };
     }
     this.Save             = new DelegateCommand(ExecuteSave);
     this._manifestManager = UnityContainerFactory.GetUnityContainer().Resolve <IManifestManager>();
 }
Пример #6
0
        public VMManifestManagement(IEventAggregator eventAggregator)
        {
            _container            = UnityContainerFactory.GetUnityContainer();
            _eventAggregator      = eventAggregator;
            this._manifestManager = _container.Resolve <IManifestManager>();
            DateTime now     = DateTime.Now.Date;
            int      subDays = (int)now.DayOfWeek;

            if (subDays == 0)
            {
                this._start = now.AddDays(-6);
            }
            else
            {
                this._start = now.AddDays(1 - subDays);
            }
            this._end       = DateTime.Now.Date;
            this._manifests = new ObservableCollection <ManifestModel>();
            this.Add        = new DelegateCommand(AddExecute, CanExecuteAdd);
            this.Update     = new DelegateCommand(UpdateExecute, CanExecuteUpdate);
            this.Delete     = new DelegateCommand(DeleteExecute, CanExecuteDelete);
            this.Refresh    = new DelegateCommand <string>(RefreshExecute, CanExecuteRefresh);
            this.RefreshManifest(false);
        }
Пример #7
0
 public ManifestManager()
 {
     _log     = UnityContainerFactory.GetUnityContainer().Resolve <ILog>();
     _service = new ManifestService();
 }
Пример #8
0
 public ManifestModule()
 {
     _container = UnityContainerFactory.GetUnityContainer();
 }
Пример #9
0
 public DailyModule()
 {
     _container = UnityContainerFactory.GetUnityContainer();
 }
Пример #10
0
 public DailyManager()
 {
     _log     = UnityContainerFactory.GetUnityContainer().Resolve <ILog>();
     _service = new DailyService();
 }