Пример #1
0
 /// <summary>
 /// Регистрация сервисов модуля
 /// </summary>
 /// <param name="container"></param>
 public override void RegistServices(ServiceContainer container)
 {
     container.RegisterService(new FaceRecognizerService());
     container.RegisterService(new VoiceAssistantService());
     container.RegisterService(new DatabaseService());
     container.RegisterService(new HumanService());
 }
Пример #2
0
 public void ChildContainerShouldBeDisposed()
 {
     var ioc = new ServiceContainer();
       var childContainer = ioc.CreateChildContainer();
       ioc.Dispose();
       Assert.That(() => childContainer.Clear(), Throws.TypeOf(typeof(ObjectDisposedException)));
 }
Пример #3
0
 public App()
 {
     Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync(
         Microsoft.ApplicationInsights.WindowsCollectors.Metadata |
         Microsoft.ApplicationInsights.WindowsCollectors.Session);
     InitializeComponent();
     var container = new ServiceContainer();
     ServiceLocator.Current = container;
     CoreServicesInitializer.InitializeServices(container, new SystemInfoParam() { Platform = AppPlatform.Windows10Universal });
     MakabaEngineServicesInitializer.InitializeServices(container, new SystemInfoParam() { Platform = AppPlatform.Windows10Universal });
     EsentServicesInitializer.InitializeServices(container, new SystemInfoParam() { Platform = AppPlatform.Windows10Universal });
     container.RegisterService<INetworkProfileService>(new NetworkProfileService(container));
     container.RegisterService<IUiConfigurationService>(new UiConfigurationService(container));
     container.RegisterService<IPageNavigationService>(new PageNavigationService(container));
     container.RegisterService<ILocalFolderProvider>(new LocalFolderProvider(container));
     var keyInitializer = new ApiKeysInitializer();
     keyInitializer.SetContainer();
     Resuming += (sender, o) =>
     {
         AppEvents.AppResume.RaiseEvent(this, o);
         GC.Collect();
     };
     Suspending += (sender, e) =>
     {
         AppEvents.AppSuspend.RaiseEvent(this, e);
     };
     UnhandledException += OnUnhandledException;
 }
Пример #4
0
        public Project()
        {
            Uid = Guid.NewGuid();
            _services = new ServiceContainer();

            Name = "Project";

            _levels = new NamedResourceCollection<Level>();
            _levels.Modified += (s, e) => OnModified(EventArgs.Empty);

            _libraryManager = new LibraryManager();
            _libraryManager.Libraries.Modified += (s, e) => OnModified(EventArgs.Empty);

            Library defaultLibrary = new Library();

            _libraryManager.Libraries.Add(defaultLibrary);

            Extra = new List<XmlElement>();

            _texturePool = new MetaTexturePool();
            _texturePool.AddPool(defaultLibrary.Uid, defaultLibrary.TexturePool);

            _tilePools = new MetaTilePoolManager(_texturePool);
            _tilePools.AddManager(defaultLibrary.Uid, defaultLibrary.TilePoolManager);
            _objectPools = new MetaObjectPoolManager(_texturePool);
            _objectPools.AddManager(defaultLibrary.Uid, defaultLibrary.ObjectPoolManager);
            _tileBrushes = new MetaTileBrushManager();
            _tileBrushes.AddManager(defaultLibrary.Uid, defaultLibrary.TileBrushManager);

            SetDefaultLibrary(defaultLibrary);

            _services.AddService(typeof(TilePoolManager), _tilePools);

            ResetModified();
        }
Пример #5
0
		public TagLineListForm(IServiceProvider provider, IEnumerable<TagLineInfo> tagLines)
		{
			if (provider == null)
				throw new ArgumentNullException(nameof(provider));
			if (tagLines == null)
				throw new ArgumentNullException(nameof(tagLines));

			_serviceManager = new ServiceContainer(provider);

			_tagLines = new ObservableList<TagLineInfo>(tagLines);

			InitializeComponent();

			_serviceManager.Publish<ITagLineListFormService>(new TagLineListFormService(this));
			_serviceManager.Publish<IDefaultCommandService>(new DefaultCommandService("Janus.Forum.TagLine.Edit"));

			_toolbarGenerator = new StripMenuGenerator(_serviceManager, _toolStrip, "Forum.TagLine.Toolbar");
			_contextMenuGenerator = new StripMenuGenerator(_serviceManager, _contextMenuStrip, "Forum.TagLine.ContextMenu");

			_listImages.Images.Add(
				_serviceManager.GetRequiredService<IStyleImageManager>()
					.GetImage(@"MessageTree\Msg", StyleImageType.ConstSize));

			UpdateData();

			_tagLines.Changed += (sender, e) => UpdateData();
		}
Пример #6
0
        protected override void Initialize()
        {
            ServiceContainer services = new ServiceContainer();
            Content = new ContentManager(Services, "Content");

            sprites = new Dictionary<string, Texture2D>();

            frogger.Object.allObjects = new List<frogger.Object>();
            Row.allRows = new List<Row>();
            new Row(64 * 0, 2.5f);
            new Row(64 * 1, 2);
            new Row(64 * 2, 1.5f);
            new Row(64 * 3, 1, Spawns.LOG);
            Form1.score = 0;
            Form1.lives = Form1.startingLives;
            //put the player at the bottom of the screen
            Form1.player = new Player(new Vector2(200, 256));

            spriteBatch = new SpriteBatch(GraphicsDevice);
            font = Content.Load<SpriteFont>("Segoe");
            sprites.Add("placeholder", this.Content.Load<Texture2D>("placeholder"));
            sprites.Add("frog", this.Content.Load<Texture2D>("frog"));
            sprites.Add("road", this.Content.Load<Texture2D>("road"));
            sprites.Add("water", this.Content.Load<Texture2D>("water"));
            Form1.player.setSprite("frog");
        }
Пример #7
0
 public static void Register(ServiceContainer container)
 {
     container.Register<IBotManager, BotManager>();
     container.Register<IMessageHandler, MessageHandler>();
     container.Register<ICommandHelper, CommandHelper>();
     DataDependenciesConfig.Register(container);
 }
Пример #8
0
		public MessageForm(
			[NotNull] IServiceProvider provider,
			MessageFormMode mode,
			MessageInfo message)
		{
			if (provider == null)
				throw new ArgumentNullException(nameof(provider));

			_serviceManager = new ServiceContainer(provider);

			InitializeComponent();

			_formMode = mode;
			_messageInfo = message ?? new MessageInfo();
			_previewSourceNum = OutboxManager.RegisterPreviewSource(this);

			_serviceManager.Publish<IMessageEditorService>(
				new MessageEditorService(this));

			CustomInitializeComponent();

			_menuGenerator = new StripMenuGenerator(_serviceManager, _menuStrip, "MessageEditor.Menu");
			_toolbarGenerator = new StripMenuGenerator(_serviceManager, _toolStrip, "MessageEditor.Toolbar");
			_tagsbarGenerator = new SmilesToolbarGenerator(_serviceManager, "Forum.MessageEditor.TagsBar", _tagsBar);

			_syntaxExtSvc = provider.GetRequiredService<IEditorSyntaxExtensibilityService>();
		}
Пример #9
0
 private void RegisterContainer()
 {
     var container = new ServiceContainer();
     container.RegisterApiControllers();
     container.RegisterFrom<CompositionRoot>();
     container.EnableWebApi(this);
 }
Пример #10
0
 //monoFrameworkAlias.Microsoft.Xna.Framework.Graphics.GraphicsDevice monoDevice)
 //public monoFrameworkAlias.Microsoft.Xna.Framework.Graphics.GraphicsDevice MonoDevice { get; private set; }
 public LoadContentArgs(GraphicsDevice device, GraphicsDeviceService graphicsService, ServiceContainer services)
 {
     GraphicsDevice = device;
     GraphicsService = graphicsService;
     Services = services;
     //MonoDevice = monoDevice;
 }
Пример #11
0
        public MoveCreatorForm()
        {
            //set up defaults
            this.movelist = new Dictionary<String, Move>();
            this.directoryHome = "../../../HeroesOfRock";
            this.FormClosing += ContentList_FormClosing; ;
            this.appClose = true;

            //set up content manager
            GraphicsDeviceService gds = GraphicsDeviceService.AddRef(this.Handle,
                     this.ClientSize.Width, this.ClientSize.Height);
            ServiceContainer services = new ServiceContainer();
            services.AddService<IGraphicsDeviceService>(gds);
            this.content = new ContentManager(services, String.Concat(directoryHome, "/HeroesOfRock/bin/x86/Debug/Content"));

            //Load and/or parse predefined objects
            LoadMoveList(content.Load<Move[]>("Movelist"));
            this.audioClips = Directory.GetFiles(String.Concat(content.RootDirectory, "/Audio")).ToList<string>();
            this.particleFX = Directory.GetFiles(String.Concat(content.RootDirectory, "/ParticleFX")).ToList<string>();
            //if null, will back up to the content default
            BackUpMoveList(null);
            InitializeComponent();

            RefreshList();
        }
Пример #12
0
        public void GetInstance_NoServices_CallsAssemblyScannerOnlyOnce()
        {
            var scannerMock = new Mock<IAssemblyScanner>();
            var serviceContainer = new ServiceContainer();
            serviceContainer.AssemblyScanner = scannerMock.Object;
            try
            {
                serviceContainer.GetInstance<IFoo>();
            }
            catch
            {
                try
                {
                    serviceContainer.GetInstance<IFoo>();
                }
                catch
                {

                }
            }
            finally
            {
                scannerMock.Verify(a => a.Scan(typeof(IFoo).Assembly, It.IsAny<IServiceRegistry>(), LifeCycleType.Transient, It.IsAny<Func<Type, bool>>()), Times.Once());
            }
        }
Пример #13
0
        public void Create_WithCustomerOlderThan25_ShouldBeNotEmpty()
        {
            var container = new ServiceContainer();

            var directory = AppDomain.CurrentDomain.BaseDirectory;

            var finder = AssemblyFinder.Builder.UsePath(directory).Create;

            container.RegisterFrom<ServiceLocatorCompositionRoot>();

            var assemblies = finder.GetAssembliesTagged<AssemblyTagAttribute>();

            container.RegisterFactory(assemblies);

            container.Register<IDoSomething, DoSomething>(typeof(DoSomething).FullName);

            var factory = container.GetInstance<IObjectFactory>();

            var customer = new Customer(){Age = 25};

            var services = factory.Create<Customer, IDoSomething>(customer);

            services.ShouldNotBeEmpty();

            services.Length.ShouldBe(1);

            services[0].ShouldBeAssignableTo<IDoSomething>();

            services[0].ShouldBeOfType<DoSomething>();
        }
Пример #14
0
 private static IServiceLocator CreateServiceLocator()
 {
     var container = new ServiceContainer();
     container.Register<IFoo, Foo>();
     container.Register<IFoo, AnotherFoo>("AnotherFoo");
     return new LightInjectServiceLocator(container);
 }
Пример #15
0
        public static void Main(string[] args)
        {
            var argumentParser = ApplicationArgumentsConfigurationSetup.CreateCommandLineParser();

            ICommandLineParserResult parseResult = argumentParser.Parse(args);

            if (!parseResult.HasErrors && !parseResult.EmptyArgs)
            {
                using (var serviceContainer = new ServiceContainer())
                {
                    serviceContainer.RegisterFrom<CompositionRoot>();
                    IFileSystemMonitorServiceFactory factory = serviceContainer.GetInstance<IFileSystemMonitorServiceFactory>(CompositionRoot.LoggingFileSystemMonitorServiceFactory);
                    FileSystemMonitorServiceConfiguration configuration = CreateConfiguration(argumentParser.Object);

                    var logger = serviceContainer.GetInstance<ILogger>();
                    logger.Log(LogLevel.Trace, "From: {0} To: {1}", configuration.FolderToMonitor, configuration.TargetFolder);

                    FileSystemMonitorService service = factory.Create(configuration);

                    ServiceBase.Run(service);
                }
            }
            else
            {
                argumentParser.HelpOption.ShowHelp(argumentParser.Options);
            }
        }
Пример #16
0
		static void Main(string[] args)
		{
			Console.WriteLine("Start");

			var container = new ServiceContainer();
			container.Register<IDataBaseController, DataBaseController>();

			IDataBaseController _dbController = container.GetInstance<IDataBaseController>();

			Product p1 = new Product()
			{
				Id = 1
			};

			Product p2 = new Product()
			{
				Id = 2
			};

			Product p3 = null;

			_dbController.InsertProduct(p1);
			_dbController.InsertProduct(p3);
			_dbController.InsertProduct(p2);

			Console.WriteLine("End");

			Console.ReadLine();
		}
Пример #17
0
        public static void Main(string[] args)
        {
            var argumentParser = ApplicationArgumentsConfiguration.CreateCommandLineParser();

            ICommandLineParserResult parseResult = argumentParser.Parse(args);

            if (!parseResult.HasErrors && !parseResult.EmptyArgs)
            {
                var configuration = CreateConfiguration(argumentParser.Object);
                ConfigurationProvider.Instance.Configuration = configuration;

                using (var serviceContainer = new ServiceContainer())
                {
                    serviceContainer.RegisterFrom<CompositionRoot>();
                    var factory = serviceContainer.GetInstance<CentralHostServiceFactory>();

                    CentralHostService service = factory.Create(configuration);

                    var logger = serviceContainer.GetInstance<ILogger>();

                    logger.Trace("[Before Service base run]");
                    ServiceBase.Run(service);
                    logger.Trace("[After Service base run]");
                }
            }
            else
            {
                argumentParser.HelpOption.ShowHelp(argumentParser.Options);
            }
        }
Пример #18
0
        static void Main(string[] args)
        {
            MongoDBRepository.RegisterMongoDBContext(new TripperCenterDBContext());
            MongoDBRepository.RegisterMongoDBContext(new DeliveryCenterDBContext());
            MongoDBRepository.RegisterMongoDBContext(new StatusCenterDBContext());
            MongoDBRepository.RegisterMongoDBContext(new RelationCenterDBContext());
            MongoDBRepository.RegisterMongoIndex();

            var ass = WinAssemblyUtility.GetAssembly();
            HostInfo host = new HostInfo(ConfigurationManager.AppSettings["WcfHostAddress"]).LoadTypesFromAssemblies(ass);
            using (ServiceContainer container = new ServiceContainer())
            {
                container.Open(host);
                Console.WriteLine("press close to stop host");

                while (true)
                {
                    if ("close" == Console.ReadLine().ToLower())
                    {
                        container.Close(host);
                        break;
                    }
                }
                Console.WriteLine("press 'Enter' to quit");
                Console.ReadKey();
            }
        }
 public static IServiceContainer EnableLightInject(this HttpConfiguration configuration)
 {
     var container = new ServiceContainer();
     container.RegisterApiControllers();
     container.EnableWebApi(configuration);
     return container;
 }
        /// <summary>
        /// Инициализатор сервисов.
        /// </summary>
        /// <param name="sysInfo">Информация о системе.</param>
        /// <param name="container">Сервисы.</param>
        public static void InitializeServices(ServiceContainer container, SystemInfoParam sysInfo)
        {
            container.RegisterService<IRegexCacheService>(new RegexCacheService(container));
            container.RegisterService<IYoutubeIdService>(new YoutubeIdService(container));
            container.RegisterService<IDateService>(new DateService(container));
            container.RegisterService<ICaptchaService>(new CaptchaService(container));
            container.RegisterService<ILinkHashService>(new LinkHashService(container));
            container.RegisterService<ISerializerCacheService>(new SerializerCacheService(container));
            container.RegisterService<IStorageService>(new StorageService(container));
            container.RegisterService<ILinkTransformService>(new LinkTransformService(container));
            container.RegisterService<INetworkLogic>(new NetworkLogicService(container));
            container.RegisterService<ISystemInfo>(new SystemInfo(container, sysInfo));
            container.RegisterService<IThreadTreeProcessService>(new ThreadTreeProcessService(container));
            container.RegisterService<ILiveTileService>(new LiveTileService(container));
            container.RegisterService<IJsonService>(new JsonService(container));
            container.RegisterService<IYoutubeUriService>(new YoutubeUriService(container));
            container.RegisterService<IApiKeyService>(new ApiKeyService(container));
            container.RegisterService<INavigationKeyService>(new NavigationKeyService(container));
            container.RegisterService<IBoardLinkKeyService>(new BoardLinkKeyService(container));
            container.RegisterService<IMarkupService>(new MarkupService(container));

            var engines = new NetworkEngines(container);
            container.RegisterService<INetworkEngines>(engines);
            container.RegisterService<INetworkEngineInstaller>(engines);
        }
Пример #21
0
		internal static void Start(ref InfoTextEnterArea grayOut, ServiceContainer services, UIElement activeContainer, Rect activeRectInActiveContainer, string text)
		{
			Debug.Assert(services != null);
			Debug.Assert(activeContainer != null);
			DesignPanel designPanel = services.GetService<IDesignPanel>() as DesignPanel;
			OptionService optionService = services.GetService<OptionService>();
			if (designPanel != null && grayOut == null && optionService != null && optionService.GrayOutDesignSurfaceExceptParentContainerWhenDragging) {
				grayOut = new InfoTextEnterArea();
				grayOut.designSurfaceRectangle = new RectangleGeometry(
					new Rect(0, 0, ((Border)designPanel.Child).Child.RenderSize.Width, ((Border)designPanel.Child).Child.RenderSize.Height));
				grayOut.designPanel = designPanel;
				grayOut.adornerPanel = new AdornerPanel();
				grayOut.adornerPanel.Order = AdornerOrder.Background;
				grayOut.adornerPanel.SetAdornedElement(designPanel.Context.RootItem.View, null);
				grayOut.ActiveAreaGeometry = new RectangleGeometry(activeRectInActiveContainer, 0, 0, (Transform)activeContainer.TransformToVisual(grayOut.adornerPanel.AdornedElement));
				var tb = new TextBlock(){Text = text};
				tb.FontSize = 10;
				tb.ClipToBounds = true;
				tb.Width = ((FrameworkElement) activeContainer).ActualWidth;
				tb.Height = ((FrameworkElement) activeContainer).ActualHeight;
				tb.VerticalAlignment = VerticalAlignment.Top;
				tb.HorizontalAlignment = HorizontalAlignment.Left;
				tb.RenderTransform = (Transform)activeContainer.TransformToVisual(grayOut.adornerPanel.AdornedElement);
				grayOut.adornerPanel.Children.Add(tb);
								
				designPanel.Adorners.Add(grayOut.adornerPanel);
			}
		}
        protected virtual void WriteDataContextClass(ServiceContainer container)
        {
            foreach (ResourceAttribute att in container.Facets.Attributes)
                att.Apply(CodeBuilder);

            if (!Versioning.Server.SupportsV2Features && container.Workspace.ServiceModifications.Interfaces.IServiceProvider.Services.Any())
            {
                // we need to do something special, as V1 did not ask for IUpdatable from the service provider
#if !ClientSKUFramework
                // we include all interfaces defined in the V1 namespace that are not updatable (really this is just for the expand provider)
                CodeBuilder.WriteLine(ProviderWrapperGenerator.GenerateDerivedWrapper("InMemoryContextWrapper", typeof(InMemoryLinq.InMemoryContext),
                    container.Workspace.ServiceModifications.Interfaces.IServiceProvider.Services.Keys.ToArray()));
#endif
                CodeBuilder.WriteBeginClass(container.Workspace.ContextTypeName, "InMemoryContextWrapper", "Microsoft.OData.Service.IUpdatable", false);
            }
            else
            {
                if (container.Workspace.Settings.UpdatableImplementation == UpdatableImplementation.DataServiceUpdateProvider)
                    CodeBuilder.WriteBeginClass(container.Workspace.ContextTypeName, "InMemoryContext", "Microsoft.OData.Service.Providers.IDataServiceUpdateProvider", false);
                else
                    CodeBuilder.WriteBeginClass(container.Workspace.ContextTypeName, "InMemoryContext", "Microsoft.OData.Service.IUpdatable", false);
            }

            //Create the IQueryables
            foreach(ResourceContainer c in container.ResourceContainers)
            {
                if (c is ServiceOperation)
                    continue;
                CodeBuilder.CreateIQuerableGetProperty(c);
            }

            CodeBuilder.WriteEndClass(container.Name);
        }
Пример #23
0
 public void Scan_HostAssembly_DoesNotConfigureInternalServices()
 {
     var container = new ServiceContainer();
     container.RegisterAssembly(typeof(ServiceContainer).Assembly);
     var result = container.AvailableServices.Where(si => si.ImplementingType.Namespace == "LightInject");
     Assert.IsFalse(container.AvailableServices.Any(si => si.ImplementingType != null && si.ImplementingType.Namespace == "LightInject"));
 }
Пример #24
0
        public Project(Stream stream, ProjectResolver resolver)
        {
            _services = new ServiceContainer();
            _levels = new NamedResourceCollection<Level>();
            _levels.Modified += (s, e) => OnModified(EventArgs.Empty);

            _libraryManager = new LibraryManager();
            _libraryManager.Libraries.Modified += (s, e) => OnModified(EventArgs.Empty);

            Extra = new List<XmlElement>();

            XmlReaderSettings settings = new XmlReaderSettings() {
                CloseInput = true,
                IgnoreComments = true,
                IgnoreWhitespace = true,
            };

            using (XmlReader reader = XmlTextReader.Create(stream, settings)) {
                XmlSerializer serializer = new XmlSerializer(typeof(ProjectX));
                ProjectX proxy = serializer.Deserialize(reader) as ProjectX;

                FromXProxy(proxy, resolver, this);
            }

            ResetModified();
        }
Пример #25
0
        public override TestResult DoTest(ITestCase testCase, int testCasesNumber, bool singleton)
        {
            var result = new TestResult { Singleton = singleton, TestCasesNumber = testCasesNumber };
            var sw = new Stopwatch();

            var c = new ServiceContainer();
            if (singleton)
            {
                sw.Start();
                c = (ServiceContainer)testCase.SingletonRegister(c);
                sw.Stop();
            }
            else
            {
                sw.Start();
                c = (ServiceContainer)testCase.TransientRegister(c);
                sw.Stop();
            }
            result.RegisterTime = sw.ElapsedMilliseconds;

            sw.Reset();
            result.ResolveTime = DoResolve(sw, testCase, c, testCasesNumber, singleton);

            c.Dispose();

            return result;
        }
 public static void Register(HttpConfiguration configuration)
 {
     var container = new ServiceContainer();
     container.RegisterApiControllers();           
     container.Register<ITicketRepository, TicketRepository>(new PerContainerLifetime());
     container.EnableWebApi(configuration);
 }
Пример #27
0
 private static void InitializeLightInject(HttpConfiguration config)
 {
     var container = new ServiceContainer();
     container.RegisterFrom<Composition.CompositionModule>();
     container.RegisterApiControllers();
     container.EnableWebApi(config);
 }
        public void RegisterFactory_WithCompositionRoot_ShouldBeNotNull()
        {
            var container = new ServiceContainer();

            var directory = AppDomain.CurrentDomain.BaseDirectory;

            var finder = AssemblyFinder.Builder.UsePath(directory).Create;

            container.RegisterFrom<ServiceLocatorCompositionRoot>();

            var assemblies = finder.GetAssembliesTagged<AssemblyTagAttribute>();

            container.RegisterFactory(assemblies);

            container.Register<IDoSomething, DoSomething>(typeof(DoSomething).FullName);

            var instance = container.GetInstance<IObjectFactory>();

            instance.ShouldNotBeNull();

            instance.ConfigurationProvider.Configuration.Items.ShouldNotBeEmpty();

            instance.ConfigurationProvider.Configuration.Items.Count.ShouldBe(1);

            instance.ConfigurationProvider.Sources.ShouldNotBeEmpty();

            instance.ConfigurationProvider.Sources.Length.ShouldBe(2);

            instance.ShouldBeAssignableTo<IObjectFactory>();

            instance.ShouldBeOfType<ObjectFactory>();
        }
Пример #29
0
		public static void Register(ServiceContainer container, HttpConfiguration config)
		{
			container.RegisterControllers();
			container.RegisterApiControllers();

			#region Services
			container.Register<IPluralizeProxy, PluralizeProxy>();
			container.Register(factory => PluralizationService.CreateService(CultureInfo.GetCultureInfo("en")));
			container.Register<ISitemapGenerator, SitemapGenerator>();
			#endregion

			#region Tracing
			container.Register<IDiagnosticTrace, DiagnosticTrace>();
			#endregion

			#region Repositories
			container.Register<IDbContext, NhDbContext>();
			container.Register<IDataRepository<Repository>, DataRepository<Repository>>(new PerScopeLifetime());
			container.Register<IDataRepository<Session>, DataRepository<Session>>(new PerScopeLifetime());
			container.Register<IDataRepository<LogEntry>, DataRepository<LogEntry>>(new PerScopeLifetime());
			#endregion

			container.EnableMvc();
			container.EnablePerWebRequestScope();
			container.EnableWebApi(config);
		}
 public void Register_AssemblyWithFunc_CallsAssemblyScanner()
 {
     var scannerMock = new Mock<IAssemblyScanner>();
     var serviceContainer = new ServiceContainer();
     serviceContainer.AssemblyScanner = scannerMock.Object;
     serviceContainer.RegisterAssembly(typeof(IFoo).Assembly, (s,t) => true);
     scannerMock.Verify(a => a.Scan(typeof(IFoo).Assembly, It.IsAny<IServiceRegistry>(), It.IsAny<Func<ILifetime>>(), It.IsAny<Func<Type, Type, bool>>()), Times.Once());
 }
Пример #31
0
        /// <summary>
        /// Validate business of screen
        /// </summary>
        /// <param name="res"></param>
        /// <param name="tbt_SaleBasicData"></param>
        public void ValidateDataBusiness_CTS090(ObjectResultData res, tbt_SaleBasic tbt_SaleBasicData = null)
        {
            CTS090_RegisterCancelTargetData registerCancelData;
            IInstallationHandler            installHandler = ServiceContainer.GetService <IInstallationHandler>() as IInstallationHandler;

            try
            {
                if (tbt_SaleBasicData != null)
                {
                    registerCancelData = new CTS090_RegisterCancelTargetData();
                    registerCancelData.RegisterCancelData = tbt_SaleBasicData;
                }
                else
                {
                    CTS090_ScreenParameter sParam = GetScreenObject <CTS090_ScreenParameter>();
                    registerCancelData = sParam.CTS090_Session;
                }

                if (registerCancelData != null)
                {
                    //Check change type
                    if ((registerCancelData.RegisterCancelData != null && registerCancelData.RegisterCancelData.ChangeType != null) &&
                        ((registerCancelData.RegisterCancelData.ChangeType != SaleChangeType.C_SALE_CHANGE_TYPE_NEW_SALE) &&
                         (registerCancelData.RegisterCancelData.ChangeType != SaleChangeType.C_SALE_CHANGE_TYPE_ADD_SALE)))
                    {
                        res.AddErrorMessage(MessageUtil.MODULE_CONTRACT, MessageUtil.MessageList.MSG3168, null, null);
                        return;
                    }

                    //Check complete installation status
                    if ((registerCancelData.RegisterCancelData != null && registerCancelData.RegisterCancelData.InstallationCompleteFlag != null) &&
                        (registerCancelData.RegisterCancelData.InstallationCompleteFlag == FlagType.C_FLAG_ON))
                    {
                        res.AddErrorMessage(MessageUtil.MODULE_CONTRACT, MessageUtil.MessageList.MSG3058, null, null);
                        return;
                    }

                    //Check cancel status
                    if ((registerCancelData.RegisterCancelData != null && registerCancelData.RegisterCancelData.SaleProcessManageStatus != null) &&
                        (registerCancelData.RegisterCancelData.SaleProcessManageStatus == SaleProcessManageStatus.C_SALE_PROCESS_STATUS_CANCEL))
                    {
                        res.AddErrorMessage(MessageUtil.MODULE_CONTRACT, MessageUtil.MessageList.MSG3105, null, null);
                        return;
                    }

                    //Add by Jutarat A. on 06062013
                    //Check installation status
                    //Get installation basic
                    List <tbt_InstallationBasic> doTbt_InstallationBasicValidate = installHandler.GetTbt_InstallationBasicData(registerCancelData.RegisterCancelData.ContractCode);
                    if (doTbt_InstallationBasicValidate != null && doTbt_InstallationBasicValidate.Count > 0 &&
                        doTbt_InstallationBasicValidate[0].InstallationStatus != InstallationStatus.C_INSTALL_STATUS_INSTALL_NOT_REGISTERED)
                    {
                        res.AddErrorMessage(MessageUtil.MODULE_CONTRACT, MessageUtil.MessageList.MSG3309, null, null);
                        return;
                    }
                    //End Add
                }
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }
        }
Пример #32
0
            public TableSource()
            {
                expenseViewModel = ServiceContainer.Resolve <ExpenseViewModel>();

                categoryCell = new UITableViewCell(UITableViewCellStyle.Default, null);
                categoryCell.TextLabel.Text = "Category";
                categoryCell.AccessoryView  = category = new UILabel(new RectangleF(0, 0, 200, 36))
                {
                    TextAlignment   = UITextAlignment.Right,
                    BackgroundColor = UIColor.Clear,
                };
                categoryCell.SelectionStyle = UITableViewCellSelectionStyle.None;

                costCell = new UITableViewCell(UITableViewCellStyle.Default, null);
                costCell.TextLabel.Text = "Cost";
                costCell.SelectionStyle = UITableViewCellSelectionStyle.None;
                costCell.AccessoryView  = cost = new UITextField(new RectangleF(0, 0, 200, 36))
                {
                    VerticalAlignment = UIControlContentVerticalAlignment.Center,
                    TextAlignment     = UITextAlignment.Right,
                };
                cost.SetDidChangeNotification(c =>
                {
                    string text = c.Text.Replace("$", string.Empty);
                    decimal value;
                    if (decimal.TryParse(text, out value))
                    {
                        expenseViewModel.SelectedExpense.Cost = Math.Abs(value);
                    }
                    else
                    {
                        expenseViewModel.SelectedExpense.Cost = 0;
                    }
                });

                descriptionCell = new UITableViewCell(UITableViewCellStyle.Default, null);
                descriptionCell.AccessoryView = description = new PlaceholderTextView(new RectangleF(0, 0, Theme.IsiOS7 ? 515 : 470, 90))
                {
                    BackgroundColor = UIColor.Clear,
                    Placeholder     = "Please enter notes here",
                };
                descriptionCell.SelectionStyle = UITableViewCellSelectionStyle.None;
                description.SetDidChangeNotification(d => {
                    if (description.Text != description.Placeholder)
                    {
                        expenseViewModel.SelectedExpense.Description = d.Text;
                    }
                    else
                    {
                        expenseViewModel.SelectedExpense.Description = string.Empty;
                    }
                });

                photoCell = new UITableViewCell(UITableViewCellStyle.Default, null);
                photoCell.SelectionStyle = UITableViewCellSelectionStyle.None;
                photoButton = UIButton.FromType(UIButtonType.Custom);
                photoButton.SetBackgroundImage(Theme.AddPhoto, UIControlState.Normal);
                photoButton.SetTitle("Add Photo", UIControlState.Normal);
                photoButton.SetTitleColor(Theme.LabelColor, UIControlState.Normal);
                photoButton.ContentEdgeInsets = new UIEdgeInsets(0, 0, 2, 0);
                photoButton.Frame             = new RectangleF(210, 130, 115, 40);
                photoButton.TouchUpInside    += (sender, e) => {
                    if (photoSheet == null)
                    {
                        photoSheet = new PhotoAlertSheet();

                        //Set the desired size for the resulting image
                        var size  = photo.Frame.Size;
                        var scale = UIScreen.MainScreen.Scale;
                        size.Width            *= scale;
                        size.Height           *= scale;
                        photoSheet.DesiredSize = size;

                        //Set the callback for when the image is selected
                        photoSheet.Callback = image => {
                            if (expenseViewModel.Photo == null)
                            {
                                expenseViewModel.Photo = new ExpensePhoto {
                                    ExpenseId = expenseViewModel.SelectedExpense.Id
                                }
                            }
                            ;
                            expenseViewModel.Photo.Image = image.ToByteArray();
                            Load(enabled);
                        };
                    }
                    photoSheet.ShowFrom(photoButton.Frame, photoCell, true);
                };
                photoCell.AddSubview(photoButton);
                var frame = photoCell.Frame;

                frame.X                   = 18;
                frame.Width              -= 34;
                photo                     = new UIImageView(frame);
                photo.AutoresizingMask    = UIViewAutoresizing.All;
                photo.ContentMode         = UIViewContentMode.ScaleAspectFit;
                photo.Layer.BorderWidth   = 1;
                photo.Layer.BorderColor   = new CGColor(0xcf, 0xcf, 0xcf, 0x7f);
                photo.Layer.CornerRadius  = 10;
                photo.Layer.MasksToBounds = true;
                photoCell.AddSubview(photo);
            }
Пример #33
0
        /// <summary>
        /// Import quotation data
        /// </summary>
        /// <param name="ScreenID"></param>
        /// <param name="DataList"></param>
        /// <returns></returns>
        public ActionResult QUS050_ImportData(string ScreenID, List <string> DataList)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                dsImportData importData = new dsImportData()
                {
                    dtTbt_QuotationCustomer           = new List <tbt_QuotationCustomer>(),
                    dtTbt_QuotationSite               = new List <tbt_QuotationSite>(),
                    dtTbt_QuotationTarget             = new List <tbt_QuotationTarget>(),
                    dtTbt_QuotationBasic              = new List <tbt_QuotationBasic>(),
                    dtTbt_QuotationOperationType      = new List <tbt_QuotationOperationType>(),
                    dtTbt_QuotationInstrumentDetails  = new List <tbt_QuotationInstrumentDetails>(),
                    dtTbt_QuotationFacilityDetails    = new List <tbt_QuotationFacilityDetails>(),
                    dtTbt_QuotationBeatGuardDetails   = new List <tbt_QuotationBeatGuardDetails>(),
                    dtTbt_QuotationSentryGuardDetails = new List <tbt_QuotationSentryGuardDetails>(),
                    dtTbt_QuotationMaintenanceLinkage = new List <tbt_QuotationMaintenanceLinkage>()
                };

                #region Mapping Data

                List <object> impLst = new List <object>()
                {
                    importData.dtTbt_QuotationCustomer,
                    importData.dtTbt_QuotationSite,
                    importData.dtTbt_QuotationTarget,
                    importData.dtTbt_QuotationBasic,
                    importData.dtTbt_QuotationOperationType,
                    importData.dtTbt_QuotationInstrumentDetails,
                    importData.dtTbt_QuotationFacilityDetails,
                    importData.dtTbt_QuotationBeatGuardDetails,
                    importData.dtTbt_QuotationSentryGuardDetails,
                    importData.dtTbt_QuotationMaintenanceLinkage
                };

                string      filePath = CommonUtil.WebPath + SECOM_AJIS.Common.Util.ConstantValue.CommonValue.IMPORT_TEMPLATE_FILE;
                XmlDocument doc      = new XmlDocument();
                doc.Load(filePath);
                XmlNodeList nodes = doc.SelectNodes("tables/table");

                bool          isError     = false;
                List <string> setFailList = new List <string>();
                int           lineIdx     = 0;
                int           nodeIdx     = 0;
                for (; nodeIdx < nodes.Count; nodeIdx++)
                {
                    if (lineIdx < DataList.Count)
                    {
                        /* --- Check Table name --- */
                        string[] tbName = DataList[lineIdx].Split(",".ToCharArray());
                        if (nodes[nodeIdx].Attributes["name"].Value != tbName[0] ||
                            lineIdx + 1 >= DataList.Count)
                        {
                            isError = true;
                            break;
                        }

                        lineIdx += 1;

                        /* --- Check Column --- */
                        bool     isSameCol = false;
                        string[] cols      = DataList[lineIdx].Split(",".ToCharArray());
                        if (cols != null)
                        {
                            if (nodes[nodeIdx].ChildNodes.Count <= cols.Length)
                            {
                                int colIdx = 0;
                                for (; colIdx < nodes[nodeIdx].ChildNodes.Count; colIdx++)
                                {
                                    string colName  = cols[colIdx] == null ? "" : cols[colIdx];
                                    string cColName = nodes[nodeIdx].ChildNodes[colIdx].Attributes["name"].Value;
                                    if (cColName == null)
                                    {
                                        cColName = "";
                                    }

                                    colName  = colName.Trim().ToUpper();
                                    cColName = cColName.Trim().ToUpper();

                                    if (colName != cColName)
                                    {
                                        break;
                                    }
                                }

                                bool isColOver = false;
                                if (colIdx < cols.Length)
                                {
                                    for (int nColIdx = colIdx; nColIdx < cols.Length; nColIdx++)
                                    {
                                        if (CommonUtil.IsNullOrEmpty(cols[nColIdx]) == false)
                                        {
                                            isColOver = true;
                                            break;
                                        }
                                    }
                                }
                                if (isColOver == false &&
                                    colIdx == nodes[nodeIdx].ChildNodes.Count)
                                {
                                    isSameCol = true;
                                }
                            }
                        }
                        if (isSameCol == false)
                        {
                            isError = true;
                            break;
                        }

                        /* --- Get next Table --- */
                        string nextTable = null;
                        if (nodeIdx + 1 < nodes.Count)
                        {
                            nextTable = nodes[nodeIdx + 1].Attributes["name"].Value;
                        }

                        /* --- Loop fill data to each table --- */
                        lineIdx += 1;
                        while (lineIdx < DataList.Count)
                        {
                            tbName = DataList[lineIdx].Split(",".ToCharArray());
                            if (nextTable == tbName[0])
                            {
                                break;
                            }

                            bool isEmpty = true;
                            foreach (string d in tbName)
                            {
                                if (CommonUtil.IsNullOrEmpty(d) == false)
                                {
                                    isEmpty = false;
                                    break;
                                }
                            }
                            if (isEmpty)
                            {
                                isError = true;
                                break;
                            }

                            string data = DataList[lineIdx];

                            string[] lst = new string[nodes[nodeIdx].ChildNodes.Count];
                            for (int dIdx = 0; dIdx < nodes[nodeIdx].ChildNodes.Count; dIdx++)
                            {
                                if (data.Length <= 0 && dIdx < nodes[nodeIdx].ChildNodes.Count - 1)
                                {
                                    isError = true;
                                    break;
                                }

                                int tIdx  = 0;
                                int cmIdx = data.IndexOf(",");
                                int ccIdx = data.IndexOf("\"");

                                string val = string.Empty;
                                if (cmIdx < 0)
                                {
                                    val = data;
                                }
                                else if (cmIdx < ccIdx || ccIdx < 0)
                                {
                                    val   = data.Substring(tIdx, cmIdx);
                                    tIdx += cmIdx + 1;
                                }
                                else
                                {
                                    int cceIdx = data.IndexOf("\"", ccIdx + 1);
                                    if (cceIdx <= 0)
                                    {
                                        val = data;
                                    }
                                    else
                                    {
                                        val   = data.Substring(tIdx + 1, cceIdx - 1);
                                        tIdx += cceIdx + 2;
                                    }
                                }

                                lst[dIdx] = val;
                                data      = data.Substring(tIdx);
                            }

                            lineIdx += 1;
                            if (isError)
                            {
                                break;
                            }
                            else
                            {
                                if (nodeIdx < impLst.Count)
                                {
                                    object obj = impLst[nodeIdx];

                                    /* --- Create Object --- */
                                    object objDo = Activator.CreateInstance(obj.GetType().GetGenericArguments()[0]);

                                    MethodInfo mf = obj.GetType().GetMethod("Add");
                                    if (mf != null)
                                    {
                                        mf.Invoke(obj, new object[] { objDo });
                                    }

                                    for (int colIdx = 0; colIdx < nodes[nodeIdx].ChildNodes.Count; colIdx++)
                                    {
                                        bool canSetValue = CommonUtil.SetObjectValue(objDo, nodes[nodeIdx].ChildNodes[colIdx].Attributes["name"].Value, lst[colIdx] != string.Empty ? lst[colIdx] : null);
                                        if (canSetValue == false)
                                        {
                                            string v = nodes[nodeIdx].ChildNodes[colIdx].Attributes["name"].Value;
                                            if (setFailList.IndexOf(v) < 0)
                                            {
                                                setFailList.Add(v);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }

                    if (isError)
                    {
                        break;
                    }
                }

                if (nodeIdx < nodes.Count)
                {
                    res.AddErrorMessage(MessageUtil.MODULE_QUOTATION, MessageUtil.MessageList.MSG2020);
                    return(Json(res));
                }
                if (setFailList.Count > 0)
                {
                    string txt = CommonUtil.TextList(setFailList.ToArray());
                    res.AddErrorMessage(MessageUtil.MODULE_QUOTATION, MessageUtil.MessageList.MSG2084, new string[] { txt });
                    return(Json(res));
                }

                #endregion
                #region Check Mandatory

                ValidatorUtil validator = new ValidatorUtil();
                List <object> objLst    = new List <object>();
                if (ScreenID == SECOM_AJIS.Common.Util.ConstantValue.ScreenID.C_SCREEN_ID_QTN_TARGET)
                {
                    if (importData.dtTbt_QuotationCustomer.Count == 0)
                    {
                        validator.AddErrorMessage(
                            MessageUtil.MODULE_COMMON,
                            MessageUtil.MessageList.MSG0007,
                            "CustomerList",
                            "CustPartTypeCode, CustCode (or CustNameEN, CustNameLC, CustTypeCode, RegionCode)");
                    }
                    else
                    {
                        int cidx = 1;
                        foreach (tbt_QuotationCustomer cust in importData.dtTbt_QuotationCustomer)
                        {
                            if (CommonUtil.IsNullOrEmpty(cust.CustPartTypeCode))
                            {
                                validator.AddErrorMessage(
                                    MessageUtil.MODULE_COMMON,
                                    MessageUtil.MessageList.MSG0007,
                                    "CustPartTypeCode" + cidx,
                                    "CustPartTypeCode" + cidx);
                            }
                            if (CommonUtil.IsNullOrEmpty(cust.CustCode))
                            {
                                List <string> eLst = new List <string>();

                                if (CommonUtil.IsNullOrEmpty(cust.CustNameEN))
                                {
                                    eLst.Add("CustNameEN" + cidx);
                                }
                                if (CommonUtil.IsNullOrEmpty(cust.CustNameLC))
                                {
                                    eLst.Add("CustNameLC" + cidx);
                                }
                                if (CommonUtil.IsNullOrEmpty(cust.CustTypeCode))
                                {
                                    eLst.Add("CustTypeCode" + cidx);
                                }
                                if (CommonUtil.IsNullOrEmpty(cust.RegionCode))
                                {
                                    eLst.Add("RegionCode" + cidx);
                                }

                                if (eLst.Count == 4)
                                {
                                    validator.AddErrorMessage(
                                        MessageUtil.MODULE_COMMON,
                                        MessageUtil.MessageList.MSG0007,
                                        "Customer" + cidx,
                                        string.Format("CustCode{0} (or CustNameEN{0}, CustNameLC{0}, CustTypeCode{0}, RegionCode{0})", cidx));
                                }
                                else
                                {
                                    foreach (string s in eLst)
                                    {
                                        validator.AddErrorMessage(
                                            MessageUtil.MODULE_COMMON,
                                            MessageUtil.MessageList.MSG0007,
                                            s,
                                            s);
                                    }
                                }
                            }

                            cidx++;
                        }
                    }

                    tbt_QuotationSite site = new tbt_QuotationSite();
                    if (importData.dtTbt_QuotationSite.Count > 0)
                    {
                        site = importData.dtTbt_QuotationSite[0];
                    }
                    if (CommonUtil.IsNullOrEmpty(site.SiteNo))
                    {
                        List <string> eLst = new List <string>();
                        if (CommonUtil.IsNullOrEmpty(site.SiteNameEN))
                        {
                            eLst.Add("SiteNameEN");
                        }
                        if (CommonUtil.IsNullOrEmpty(site.SiteNameLC))
                        {
                            eLst.Add("SiteNameLC");
                        }
                        if (CommonUtil.IsNullOrEmpty(site.AddressEN))
                        {
                            eLst.Add("AddressEN");
                        }
                        if (CommonUtil.IsNullOrEmpty(site.AddressLC))
                        {
                            eLst.Add("AddressLC");
                        }
                        //if (CommonUtil.IsNullOrEmpty(site.RoadEN))
                        //    eLst.Add("RoadEN");
                        //if (CommonUtil.IsNullOrEmpty(site.RoadLC))
                        //    eLst.Add("RoadLC");
                        if (CommonUtil.IsNullOrEmpty(site.SubDistrictEN))
                        {
                            eLst.Add("SubDistrictEN");
                        }
                        if (CommonUtil.IsNullOrEmpty(site.SubDistrictLC))
                        {
                            eLst.Add("SubDistrictLC");
                        }
                        if (CommonUtil.IsNullOrEmpty(site.BuildingUsageCode))
                        {
                            eLst.Add("BuildingUsageCode");
                        }
                        if (CommonUtil.IsNullOrEmpty(site.ProvinceCode))
                        {
                            eLst.Add("ProvinceCode");
                        }
                        if (CommonUtil.IsNullOrEmpty(site.ProvinceCode))
                        {
                            eLst.Add("DistrictCode");
                        }

                        if (eLst.Count == 11)
                        {
                            validator.AddErrorMessage(
                                MessageUtil.MODULE_COMMON,
                                MessageUtil.MessageList.MSG0007,
                                "Site",
                                "SiteNo (or SiteNameEN, SiteNameLC, AddressEN, AddressLC, SubDistrictEN, SubDistrictLC, BuildingUsageCode, ProvinceCode, DistrictCode)");
                        }
                        else
                        {
                            foreach (string s in eLst)
                            {
                                validator.AddErrorMessage(
                                    MessageUtil.MODULE_COMMON,
                                    MessageUtil.MessageList.MSG0007,
                                    s,
                                    s);
                            }
                        }
                    }

                    if (importData.dtTbt_QuotationTarget.Count == 0)
                    {
                        importData.dtTbt_QuotationTarget.Add(new tbt_QuotationTarget());
                    }
                    foreach (tbt_QuotationTarget target in importData.dtTbt_QuotationTarget)
                    {
                        objLst.Add(CommonUtil.CloneObject <tbt_QuotationTarget, QUS050_tbt_QuotationTarget>(target));
                    }
                }
                else
                {
                    if (importData.dtTbt_QuotationTarget.Count == 0)
                    {
                        importData.dtTbt_QuotationTarget.Add(new tbt_QuotationTarget());
                    }
                    foreach (tbt_QuotationTarget target in importData.dtTbt_QuotationTarget)
                    {
                        objLst.Add(CommonUtil.CloneObject <tbt_QuotationTarget, QUS050_tbt_QuotationTarget_D>(target));
                    }

                    if (importData.dtTbt_QuotationBasic.Count == 0)
                    {
                        importData.dtTbt_QuotationBasic.Add(new tbt_QuotationBasic());
                    }
                    foreach (tbt_QuotationBasic basic in importData.dtTbt_QuotationBasic)
                    {
                        /* --- Update QuotationTargetCode --- */
                        /* ---------------------------------- */
                        basic.QuotationTargetCode = importData.dtTbt_QuotationTarget[0].QuotationTargetCode;
                        /* ---------------------------------- */

                        objLst.Add(CommonUtil.CloneObject <tbt_QuotationBasic, QUS050_tbt_QuotationBasic>(basic));
                    }
                }

                ValidatorUtil.BuildErrorMessage(res, validator, objLst.ToArray());
                if (res.IsError)
                {
                    return(Json(res));
                }

                #endregion
                #region Business Check

                if (ScreenID == SECOM_AJIS.Common.Util.ConstantValue.ScreenID.C_SCREEN_ID_QTN_TARGET)
                {
                    bool isFoundTarget = false;
                    bool isFoundReal   = false;
                    if (importData.dtTbt_QuotationCustomer.Count > 0 && importData.dtTbt_QuotationCustomer.Count <= 2)
                    {
                        foreach (tbt_QuotationCustomer cust in importData.dtTbt_QuotationCustomer)
                        {
                            if (cust.CustPartTypeCode != SECOM_AJIS.Common.Util.ConstantValue.CustPartType.C_CUST_PART_TYPE_CONTRACT_TARGET &&
                                cust.CustPartTypeCode != SECOM_AJIS.Common.Util.ConstantValue.CustPartType.C_CUST_PART_TYPE_REAL_CUST)
                            {
                                res.AddErrorMessage(MessageUtil.MODULE_QUOTATION, MessageUtil.MessageList.MSG2025);
                                return(Json(res));
                            }

                            if (cust.CustPartTypeCode == SECOM_AJIS.Common.Util.ConstantValue.CustPartType.C_CUST_PART_TYPE_CONTRACT_TARGET)
                            {
                                if (isFoundTarget == true)
                                {
                                    res.AddErrorMessage(MessageUtil.MODULE_QUOTATION, MessageUtil.MessageList.MSG2093);
                                    return(Json(res));
                                }
                                else
                                {
                                    isFoundTarget = true;
                                }
                            }
                            else if (cust.CustPartTypeCode == SECOM_AJIS.Common.Util.ConstantValue.CustPartType.C_CUST_PART_TYPE_REAL_CUST)
                            {
                                if (isFoundReal == true)
                                {
                                    res.AddErrorMessage(MessageUtil.MODULE_QUOTATION, MessageUtil.MessageList.MSG2093);
                                    return(Json(res));
                                }
                                else
                                {
                                    isFoundReal = true;
                                }
                            }

                            QUS050_tbt_QuotationCustomer_BC custBC =
                                CommonUtil.CloneObject <tbt_QuotationCustomer, QUS050_tbt_QuotationCustomer_BC>(cust);
                            ObjectResultData r = ValidatorUtil.BuildErrorMessage(custBC);
                            if (r != null)
                            {
                                if (r.IsError)
                                {
                                    res.AddErrorMessage(MessageUtil.MODULE_QUOTATION, MessageUtil.MessageList.MSG2021);
                                    return(Json(res));
                                }
                            }
                        }
                        if (isFoundTarget == false)
                        {
                            res.AddErrorMessage(MessageUtil.MODULE_QUOTATION, MessageUtil.MessageList.MSG2024);
                            return(Json(res));
                        }
                    }
                    else
                    {
                        res.AddErrorMessage(MessageUtil.MODULE_QUOTATION, MessageUtil.MessageList.MSG2026);
                        return(Json(res));
                    }

                    if (importData.dtTbt_QuotationSite != null)
                    {
                        if (importData.dtTbt_QuotationSite.Count > 0)
                        {
                            QUS050_tbt_QuotationSite_BC siteBC =
                                CommonUtil.CloneObject <tbt_QuotationSite, QUS050_tbt_QuotationSite_BC>(importData.dtTbt_QuotationSite[0]);
                            ValidatorUtil.BuildErrorMessage(res, new object[] { siteBC });
                            if (res.IsError)
                            {
                                return(Json(res));
                            }
                        }
                    }
                }

                #endregion
                #region Data Authority Check

                string QuotationOfficeCode = null;
                if (ScreenID == SECOM_AJIS.Common.Util.ConstantValue.ScreenID.C_SCREEN_ID_QTN_TARGET)
                {
                    if (importData.dtTbt_QuotationTarget != null)
                    {
                        if (importData.dtTbt_QuotationTarget.Count > 0)
                        {
                            QuotationOfficeCode = importData.dtTbt_QuotationTarget[0].QuotationOfficeCode;
                        }
                    }
                }
                else
                {
                    IQuotationHandler handler = ServiceContainer.GetService <IQuotationHandler>() as IQuotationHandler;
                    if (importData.dtTbt_QuotationBasic.Count > 0)
                    {
                        CommonUtil cmm = new CommonUtil();
                        string     qt  = cmm.ConvertQuotationTargetCode(importData.dtTbt_QuotationBasic[0].QuotationTargetCode, CommonUtil.CONVERT_TYPE.TO_LONG);

                        doGetQuotationDataCondition cond = new doGetQuotationDataCondition()
                        {
                            QuotationTargetCode = qt
                        };
                        List <tbt_QuotationTarget> lst = handler.GetTbt_QuotationTarget(cond);
                        if (lst.Count <= 0)
                        {
                            ISaleContractHandler shandler = ServiceContainer.GetService <ISaleContractHandler>() as ISaleContractHandler;
                            List <tbt_SaleBasic> sLst     = shandler.GetTbt_SaleBasic(qt, null, true);
                            if (sLst.Count <= 0)
                            {
                                IRentralContractHandler        rhandler = ServiceContainer.GetService <IRentralContractHandler>() as IRentralContractHandler;
                                List <tbt_RentalContractBasic> rLst     = rhandler.GetTbt_RentalContractBasic(qt, null);
                                if (rLst.Count <= 0)
                                {
                                    res.AddErrorMessage(MessageUtil.MODULE_QUOTATION, MessageUtil.MessageList.MSG2003, new string[] { importData.dtTbt_QuotationBasic[0].QuotationTargetCode });
                                    return(Json(res));
                                }
                                else
                                {
                                    if (rLst[0].ContractStatus == ContractStatus.C_CONTRACT_STATUS_BEF_START)
                                    {
                                        QuotationOfficeCode = rLst[0].ContractOfficeCode;
                                    }
                                    else
                                    {
                                        QuotationOfficeCode = rLst[0].OperationOfficeCode;
                                    }
                                }
                            }
                            else
                            {
                                if (sLst[0].ContractStatus == ContractStatus.C_CONTRACT_STATUS_BEF_START)
                                {
                                    QuotationOfficeCode = sLst[0].ContractOfficeCode;
                                }
                                else
                                {
                                    QuotationOfficeCode = sLst[0].OperationOfficeCode;
                                }
                            }
                        }
                        else
                        {
                            QuotationOfficeCode = lst[0].OperationOfficeCode;
                        }
                    }
                }

                if (QuotationOfficeCode != null && CommonUtil.dsTransData.dtOfficeData != null)
                {
                    bool isFound = false;
                    foreach (OfficeDataDo office in CommonUtil.dsTransData.dtOfficeData)
                    {
                        if (office.OfficeCode == QuotationOfficeCode)
                        {
                            isFound = true;
                            break;
                        }
                    }
                    if (isFound == false)
                    {
                        res.AddErrorMessage(MessageUtil.MODULE_QUOTATION, MessageUtil.MessageList.MSG2023);
                        return(Json(res));
                    }
                }

                #endregion

                QUS050_ScreenParameter param = GetScreenObject <QUS050_ScreenParameter>();
                if (param != null)
                {
                    param.ImportData = importData;
                }

                res.ResultData = new object[] { importData, GetCurrentKey() };
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }
            return(Json(res));
        }
Пример #34
0
 public static void Init()
 {
     ServiceContainer.Register <IFileService>(() => new FileService());
 }
 public override void Dispose()
 {
     // Allow the container and everything it references to be garbage collected.
     this.container = null;
 }
Пример #36
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            var eventUploadIntent = new Intent(this, typeof(EventUploadReceiver));

            _eventUploadPendingIntent = PendingIntent.GetBroadcast(this, 0, eventUploadIntent,
                                                                   PendingIntentFlags.UpdateCurrent);
            var alarmIntent = new Intent(this, typeof(LockAlarmReceiver));

            _vaultTimeoutAlarmPendingIntent = PendingIntent.GetBroadcast(this, 0, alarmIntent,
                                                                         PendingIntentFlags.UpdateCurrent);
            var clearClipboardIntent = new Intent(this, typeof(ClearClipboardAlarmReceiver));

            _clearClipboardPendingIntent = PendingIntent.GetBroadcast(this, 0, clearClipboardIntent,
                                                                      PendingIntentFlags.UpdateCurrent);

            var policy = new StrictMode.ThreadPolicy.Builder().PermitAll().Build();

            StrictMode.SetThreadPolicy(policy);

            _deviceActionService = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService");
            _messagingService    = ServiceContainer.Resolve <IMessagingService>("messagingService");
            _broadcasterService  = ServiceContainer.Resolve <IBroadcasterService>("broadcasterService");
            _userService         = ServiceContainer.Resolve <IUserService>("userService");
            _appIdService        = ServiceContainer.Resolve <IAppIdService>("appIdService");
            _storageService      = ServiceContainer.Resolve <IStorageService>("storageService");
            _eventService        = ServiceContainer.Resolve <IEventService>("eventService");

            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            UpdateTheme(ThemeManager.GetTheme(true));
            base.OnCreate(savedInstanceState);
            if (!CoreHelpers.InDebugMode())
            {
                Window.AddFlags(Android.Views.WindowManagerFlags.Secure);
            }

#if !FDROID
            var appCenterHelper = new AppCenterHelper(_appIdService, _userService);
            var appCenterTask   = appCenterHelper.InitAsync();
#endif

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            Xamarin.Forms.Forms.Init(this, savedInstanceState);
            _appOptions = GetOptions();
            LoadApplication(new App.App(_appOptions));

            _broadcasterService.Subscribe(_activityKey, (message) =>
            {
                if (message.Command == "scheduleVaultTimeoutTimer")
                {
                    var alarmManager        = GetSystemService(AlarmService) as AlarmManager;
                    var vaultTimeoutMinutes = (int)message.Data;
                    var vaultTimeoutMs      = vaultTimeoutMinutes * 60000;
                    var triggerMs           = Java.Lang.JavaSystem.CurrentTimeMillis() + vaultTimeoutMs + 10;
                    alarmManager.Set(AlarmType.RtcWakeup, triggerMs, _vaultTimeoutAlarmPendingIntent);
                }
                else if (message.Command == "cancelVaultTimeoutTimer")
                {
                    var alarmManager = GetSystemService(AlarmService) as AlarmManager;
                    alarmManager.Cancel(_vaultTimeoutAlarmPendingIntent);
                }
                else if (message.Command == "startEventTimer")
                {
                    StartEventAlarm();
                }
                else if (message.Command == "stopEventTimer")
                {
                    var task = StopEventAlarmAsync();
                }
                else if (message.Command == "finishMainActivity")
                {
                    Xamarin.Forms.Device.BeginInvokeOnMainThread(() => Finish());
                }
                else if (message.Command == "listenYubiKeyOTP")
                {
                    ListenYubiKey((bool)message.Data);
                }
                else if (message.Command == "updatedTheme")
                {
                    RestartApp();
                }
                else if (message.Command == "exit")
                {
                    ExitApp();
                }
                else if (message.Command == "copiedToClipboard")
                {
                    var task = ClearClipboardAlarmAsync(message.Data as Tuple <string, int?, bool>);
                }
            });
        }
        public override void ViewDidAppear(bool animated)
        {
            base.ViewDidAppear(animated);

            ServiceContainer.Resolve <ITracker> ().CurrentScreen = "Select Client";
        }
Пример #38
0
 public ServiceManager(EntityManager entityManager, ServiceContainer serviceContainer)
 {
     _entityManager    = entityManager;
     _serviceContainer = serviceContainer;
 }
Пример #39
0
 public static void RegisterAppDependencies(this ServiceContainer container)
 {
     //register other services
     container.RegisterScoped <ITestClass, TestClass>();
     container.RegisterSingleton <IOcrEnginePoolManager, OcrEnginePoolManager>();
 }
Пример #40
0
        // Creates a test scene with a lot of randomly placed objects.
        internal static void CreateScene(ServiceContainer services, ContentManager content, DeferredGraphicsScreen graphicsScreen)
        {
            var gameObjectService = services.GetInstance <IGameObjectService>();
            var graphicsService   = services.GetInstance <IGraphicsService>();

            gameObjectService.Objects.Add(new DynamicSkyObject(services, true, false, true)
            {
                EnableAmbientLight = false, // Disable ambient light of sky to make shadows more visible.
                EnableCloudShadows = false
            });

            gameObjectService.Objects.Add(new GroundObject(services));
            gameObjectService.Objects.Add(new DynamicObject(services, 1));
            gameObjectService.Objects.Add(new DynamicObject(services, 2));
            gameObjectService.Objects.Add(new DynamicObject(services, 3));
            gameObjectService.Objects.Add(new DynamicObject(services, 5));
            gameObjectService.Objects.Add(new DynamicObject(services, 6));
            gameObjectService.Objects.Add(new DynamicObject(services, 7));
            gameObjectService.Objects.Add(new ObjectCreatorObject(services));
            gameObjectService.Objects.Add(new LavaBallsObject(services));

            var random = new Random();

            // Spheres
            var sphereMesh = SampleHelper.CreateMesh(content, graphicsService, new SphereShape(1));

            for (int i = 0; i < 100; i++)
            {
                Vector3F position = new Vector3F(random.NextFloat(-100, 100), random.NextFloat(0, 3), random.NextFloat(-100, 100));
                float    scale    = random.NextFloat(0.5f, 3f);
                var      meshNode = new MeshNode(sphereMesh)
                {
                    PoseLocal  = new Pose(position),
                    ScaleLocal = new Vector3F(scale),
                    IsStatic   = true,
                };
                graphicsScreen.Scene.Children.Add(meshNode);
            }

            // Boxes
            var boxMesh = SampleHelper.CreateMesh(content, graphicsService, new BoxShape(1, 1, 1));

            for (int i = 0; i < 100; i++)
            {
                Vector3F    position    = new Vector3F(random.NextFloat(-100, 100), random.NextFloat(0, 3), random.NextFloat(-100, 100));
                QuaternionF orientation = random.NextQuaternionF();
                Vector3F    scale       = random.NextVector3F(0.1f, 4f);
                var         meshNode    = new MeshNode(boxMesh)
                {
                    PoseLocal  = new Pose(position, orientation),
                    ScaleLocal = scale,
                    IsStatic   = true,
                };
                graphicsScreen.Scene.Children.Add(meshNode);
            }

            // Height field with smooth hills.
            var numberOfSamplesX = 20;
            var numberOfSamplesZ = 20;
            var samples          = new float[numberOfSamplesX * numberOfSamplesZ];

            for (int z = 0; z < numberOfSamplesZ; z++)
            {
                for (int x = 0; x < numberOfSamplesX; x++)
                {
                    if (x == 0 || z == 0 || x == 19 || z == 19)
                    {
                        // Set this boundary elements to a low height, so that the height field is connected
                        // to the ground.
                        samples[z * numberOfSamplesX + x] = -1;
                    }
                    else
                    {
                        // A sine/cosine function that creates some interesting waves.
                        samples[z * numberOfSamplesX + x] = 1 + (float)(Math.Cos(z / 2f) * Math.Sin(x / 2f) * 1);
                    }
                }
            }
            var heightField         = new HeightField(0, 0, 20, 20, samples, numberOfSamplesX, numberOfSamplesZ);
            var heightFieldMesh     = SampleHelper.CreateMesh(content, graphicsService, heightField);
            var heightFieldMeshNode = new MeshNode(heightFieldMesh)
            {
                PoseLocal  = new Pose(new Vector3F(20, 0, -20)),
                ScaleLocal = new Vector3F(1, 2, 1),
                IsStatic   = true,
            };

            graphicsScreen.Scene.Children.Add(heightFieldMeshNode);

            // Dudes.
            for (int i = 0; i < 10; i++)
            {
                Vector3F  position    = new Vector3F(random.NextFloat(-20, 20), 0, random.NextFloat(-20, 20));
                Matrix33F orientation = Matrix33F.CreateRotationY(random.NextFloat(0, ConstantsF.TwoPi));
                gameObjectService.Objects.Add(new DudeObject(services)
                {
                    Pose = new Pose(position, orientation)
                });
            }

            // Palm trees.
            for (int i = 0; i < 100; i++)
            {
                Vector3F  position    = new Vector3F(random.NextFloat(-80, 80), 0, random.NextFloat(-100, 100));
                Matrix33F orientation = Matrix33F.CreateRotationY(random.NextFloat(0, ConstantsF.TwoPi));
                float     scale       = random.NextFloat(0.5f, 1.2f);
                gameObjectService.Objects.Add(new StaticObject(services, "PalmTree/palm_tree", scale, new Pose(position, orientation)));
            }

            // Rocks
            for (int i = 0; i < 100; i++)
            {
                Vector3F    position    = new Vector3F(random.NextFloat(-80, 80), 1, random.NextFloat(-100, 100));
                QuaternionF orientation = RandomHelper.Random.NextQuaternionF();
                float       scale       = random.NextFloat(0.5f, 1.2f);
                gameObjectService.Objects.Add(new StaticObject(services, "Rock/rock_05", scale, new Pose(position, orientation)));
            }

            // Grass
            for (int i = 0; i < 100; i++)
            {
                Vector3F  position    = new Vector3F(random.NextFloat(-20, 20), 0, random.NextFloat(-20, 20));
                Matrix33F orientation = Matrix33F.CreateRotationY(random.NextFloat(0, ConstantsF.TwoPi));
                float     scale       = random.NextFloat(0.5f, 1.2f);
                gameObjectService.Objects.Add(new StaticObject(services, "Grass/Grass", scale, new Pose(position, orientation)));
            }

            // More plants
            for (int i = 0; i < 100; i++)
            {
                Vector3F  position    = new Vector3F(random.NextFloat(-20, 20), 0, random.NextFloat(-20, 20));
                Matrix33F orientation = Matrix33F.CreateRotationY(random.NextFloat(0, ConstantsF.TwoPi));
                float     scale       = random.NextFloat(0.5f, 1.2f);
                gameObjectService.Objects.Add(new StaticObject(services, "Parviflora/Parviflora", scale, new Pose(position, orientation)));
            }

            // "Skyscrapers"
            for (int i = 0; i < 20; i++)
            {
                Vector3F  position    = new Vector3F(random.NextFloat(90, 100), 0, random.NextFloat(-100, 100));
                Matrix33F orientation = Matrix33F.CreateRotationY(random.NextFloat(0, ConstantsF.TwoPi));
                Vector3F  scale       = new Vector3F(random.NextFloat(6, 20), random.NextFloat(10, 100), random.NextFloat(6, 20));
                var       meshNode    = new MeshNode(boxMesh)
                {
                    PoseLocal  = new Pose(position, orientation),
                    ScaleLocal = scale,
                    IsStatic   = true,
                    UserFlags  = 1, // Mark the distant huge objects. Used in render callbacks in the CompositeShadowSample.
                };
                graphicsScreen.Scene.Children.Add(meshNode);
            }

            // "Hills"
            for (int i = 0; i < 20; i++)
            {
                Vector3F position = new Vector3F(random.NextFloat(-90, -100), 0, random.NextFloat(-100, 100));
                Vector3F scale    = new Vector3F(random.NextFloat(10, 20), random.NextFloat(10, 30), random.NextFloat(10, 20));
                var      meshNode = new MeshNode(sphereMesh)
                {
                    PoseLocal  = new Pose(position),
                    ScaleLocal = scale,
                    IsStatic   = true,
                    UserFlags  = 1, // Mark the distant huge objects. Used in render callbacks in the CompositeShadowSample.
                };
                graphicsScreen.Scene.Children.Add(meshNode);
            }
        }
Пример #41
0
 public void Init(ServiceContainer sp)
 {
 }
Пример #42
0
 public virtual void LocalSetUp()
 {
     // initialize data for every test found in this testfixture class
     svcContainer = new ServiceContainer();
 }
Пример #43
0
        private DefaultFilterProvider CreateProvider()
        {
            var services = new ServiceContainer();

            return(new DefaultFilterProvider(services));
        }
Пример #44
0
        public AddEditPageViewModel()
        {
            _deviceActionService    = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService");
            _cipherService          = ServiceContainer.Resolve <ICipherService>("cipherService");
            _folderService          = ServiceContainer.Resolve <IFolderService>("folderService");
            _userService            = ServiceContainer.Resolve <IUserService>("userService");
            _platformUtilsService   = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService");
            _auditService           = ServiceContainer.Resolve <IAuditService>("auditService");
            _messagingService       = ServiceContainer.Resolve <IMessagingService>("messagingService");
            _collectionService      = ServiceContainer.Resolve <ICollectionService>("collectionService");
            _eventService           = ServiceContainer.Resolve <IEventService>("eventService");
            _policyService          = ServiceContainer.Resolve <IPolicyService>("policyService");
            GeneratePasswordCommand = new Command(GeneratePassword);
            TogglePasswordCommand   = new Command(TogglePassword);
            ToggleCardCodeCommand   = new Command(ToggleCardCode);
            CheckPasswordCommand    = new Command(CheckPasswordAsync);
            UriOptionsCommand       = new Command <LoginUriView>(UriOptions);
            FieldOptionsCommand     = new Command <AddEditPageFieldViewModel>(FieldOptions);
            Uris          = new ExtendedObservableCollection <LoginUriView>();
            Fields        = new ExtendedObservableCollection <AddEditPageFieldViewModel>();
            Collections   = new ExtendedObservableCollection <CollectionViewModel>();
            AllowPersonal = true;

            TypeOptions = new List <KeyValuePair <string, CipherType> >
            {
                new KeyValuePair <string, CipherType>(AppResources.TypeLogin, CipherType.Login),
                new KeyValuePair <string, CipherType>(AppResources.TypeCard, CipherType.Card),
                new KeyValuePair <string, CipherType>(AppResources.TypeIdentity, CipherType.Identity),
                new KeyValuePair <string, CipherType>(AppResources.TypeSecureNote, CipherType.SecureNote),
            };
            CardBrandOptions = new List <KeyValuePair <string, string> >
            {
                new KeyValuePair <string, string>($"-- {AppResources.Select} --", null),
                new KeyValuePair <string, string>("Visa", "Visa"),
                new KeyValuePair <string, string>("Mastercard", "Mastercard"),
                new KeyValuePair <string, string>("American Express", "Amex"),
                new KeyValuePair <string, string>("Discover", "Discover"),
                new KeyValuePair <string, string>("Diners Club", "Diners Club"),
                new KeyValuePair <string, string>("JCB", "JCB"),
                new KeyValuePair <string, string>("Maestro", "Maestro"),
                new KeyValuePair <string, string>("UnionPay", "UnionPay"),
                new KeyValuePair <string, string>(AppResources.Other, "Other")
            };
            CardExpMonthOptions = new List <KeyValuePair <string, string> >
            {
                new KeyValuePair <string, string>($"-- {AppResources.Select} --", null),
                new KeyValuePair <string, string>($"01 - {AppResources.January}", "1"),
                new KeyValuePair <string, string>($"02 - {AppResources.February}", "2"),
                new KeyValuePair <string, string>($"03 - {AppResources.March}", "3"),
                new KeyValuePair <string, string>($"04 - {AppResources.April}", "4"),
                new KeyValuePair <string, string>($"05 - {AppResources.May}", "5"),
                new KeyValuePair <string, string>($"06 - {AppResources.June}", "6"),
                new KeyValuePair <string, string>($"07 - {AppResources.July}", "7"),
                new KeyValuePair <string, string>($"08 - {AppResources.August}", "8"),
                new KeyValuePair <string, string>($"09 - {AppResources.September}", "9"),
                new KeyValuePair <string, string>($"10 - {AppResources.October}", "10"),
                new KeyValuePair <string, string>($"11 - {AppResources.November}", "11"),
                new KeyValuePair <string, string>($"12 - {AppResources.December}", "12")
            };
            IdentityTitleOptions = new List <KeyValuePair <string, string> >
            {
                new KeyValuePair <string, string>($"-- {AppResources.Select} --", null),
                new KeyValuePair <string, string>(AppResources.Mr, AppResources.Mr),
                new KeyValuePair <string, string>(AppResources.Mrs, AppResources.Mrs),
                new KeyValuePair <string, string>(AppResources.Ms, AppResources.Ms),
                new KeyValuePair <string, string>(AppResources.Dr, AppResources.Dr),
            };
            FolderOptions    = new List <KeyValuePair <string, string> >();
            OwnershipOptions = new List <KeyValuePair <string, string> >();
        }
Пример #45
0
        public MainForm()
        {
            InitializeComponent();

            removeToolStripMenuItem.Image  = DefaultTaskList.RemoveImage;
            removeToolStripMenuItem1.Image = DefaultTaskList.RemoveImage;
            btnRemoveFarmServer.Image      = DefaultTaskList.RemoveImage;
            toolStripMenuItem44.Image      = DefaultTaskList.RemoveImage;

            Icon = Resources.iis;
            imageList1.Images.Add(Resources.iis_16);
            imageList1.Images.Add(Resources.server_16);
            imageList1.Images.Add(Resources.application_pools_16);
            imageList1.Images.Add(Resources.sites_16);
            imageList1.Images.Add(Resources.site_16);
            imageList1.Images.Add(Resources.application_16);
            imageList1.Images.Add(Resources.physical_directory_16);
            imageList1.Images.Add(Resources.virtual_directory_16);
            imageList1.Images.Add(Resources.farm_16);
            imageList1.Images.Add(Resources.farm_server_16);
            imageList1.Images.Add(Resources.servers_16);
            btnAbout.Text = string.Format("About Jexus Manager {0}", Assembly.GetExecutingAssembly().GetName().Version);
            treeView1.Nodes.Add(new HomePageTreeNode {
                ContextMenuStrip = cmsIis
            });

            _providers = new List <ModuleProvider>
            {
                new AuthenticationModuleProvider(),
                new AuthorizationModuleProvider(),
                new CgiModuleProvider(),
                new CompressionModuleProvider(),
                new DefaultDocumentModuleProvider(),
                new DirectoryBrowseModuleProvider(),
                new FastCgiModuleProvider(),
                new HttpErrorsModuleProvider(),
                new HandlersModuleProvider(),
                new HttpRedirectModuleProvider(),
                new ResponseHeadersModuleProvider(),
                new IpSecurityModuleProvider(),
                new IsapiCgiRestrictionModuleProvider(),
                new IsapiFiltersModuleProvider(),
                new LoggingModuleProvider(),
                new MimeMapModuleProvider(),
                new ModulesModuleProvider(),
                new CachingModuleProvider(),
                new RequestFilteringModuleProvider(),
                new AccessModuleProvider(),
                new CertificatesModuleProvider(),
                new RewriteModuleProvider(),
                new HttpApiModuleProvider(),
                new JexusModuleProvider()
            };

            _navigationService = new NavigationService(this);
            _navigationService.NavigationPerformed += (sender, args) =>
            {
                var item = new ExplorerNavigationHistoryItem("");
                item.Tag = args.NewItem;
                eanLocation.Navigation.AddHistory(item);
            };
            UIService         = new ManagementUIService(this);
            _serviceContainer = new ServiceContainer();
            _serviceContainer.AddService(typeof(INavigationService), _navigationService);
            _serviceContainer.AddService(typeof(IManagementUIService), UIService);

            LoadIisExpress();
            LoadIis();
            LoadJexus();

            Text = PublicNativeMethods.IsProcessElevated ? string.Format("{0} (Administrator)", Text) : Text;
        }
Пример #46
0
        public CharactersViewModel()
        {
            var service = ServiceContainer.Resolve <ICharacterService>();

            Characters = service.GetCharacters();
        }
Пример #47
0
        private void ResetSyncProgressBar()
        {
            var syncManager = ServiceContainer.Resolve <ISyncManager> ();

            ToggleProgressBar(syncManager.IsRunning);
        }
Пример #48
0
        public void MixedDependentSystems()
        {
            var builder = new PipelineBuilder();

            // Stage 0
            builder.AddSystem <SoloSystem>()
            .Produces("GBuffer", "Cleared")
            .InSequence();

            // Stage 1
            builder.AddSystem <MonoSystem>()
            .Requires("GBuffer", "Cleared")
            .Produces("GBuffer", "Materials")
            .InSequence();

            // Stage 2
            builder.AddSystem <DuoSystem>()
            .Requires("GBuffer", "Materials")
            .Produces("GBuffer", "Point-Lights")
            .InSequence();

            // Stage 3
            builder.AddSystem <MonoSystem>()
            .Requires("GBuffer", "Point-Lights")
            .Produces("Foo", "Bar")
            .Parallel();

            builder.AddSystem <MonoSystem>()
            .Requires("GBuffer", "Point-Lights")
            .Produces("Foo", "Bar2")
            .Parallel();

            // Stage 4
            builder.AddSystem <MonoSystem>()
            .Requires("GBuffer", "Cleared")
            .Requires("Foo", "Bar")
            .Produces("Zzz", "yyy")
            .Parallel();

            // Stage 5
            builder.AddSystem <MonoSystem>()
            .Requires("Foo", "Bar")
            .Requires("Foo", "Bar2")
            .InSequence();

            var dictA = new Dictionary <int, ComponentA>
            {
                { 1, new ComponentA(1, "1-ONE-A") },
                { 2, new ComponentA(2, "2-ONE-A") },
                { 3, new ComponentA(3, "3-ONE-A") },
                { 4, new ComponentA(4, "4-ONE-A") }
            };

            var dictB = new Dictionary <int, ComponentB>
            {
                { 1, new ComponentB(1, "1-TWO-B") },
                { 3, new ComponentB(3, "3-TWO-B") },
                { 5, new ComponentB(5, "5-TWO-B") }
            };

            builder.AddComponentContainer(dictA)
            .AddComponentContainer(dictB);

            var serviceContainer = new ServiceContainer(ContainerOptions.Default);

            serviceContainer.SetDefaultLifetime <PerContainerLifetime>();

            serviceContainer.Register <SoloSystem>();
            serviceContainer.Register <MonoSystem>();
            serviceContainer.Register <DuoSystem>();

            var parallelPipeline = builder.Build(serviceContainer);

            Assert.That(parallelPipeline.PipelineStages.Count, Is.EqualTo(6));
        }
Пример #49
0
 public static ServiceContainer Congiguration(ServiceContainer container)
 {
     container.Register(typeof(IGenericRepository <>), typeof(GenericRepository <>));
     return(container);
 }
Пример #50
0
        public void IterationSetup()
        {
            _container = new ServiceContainer();

            RegisterServices();
        }
Пример #51
0
 /// <summary>
 /// Load Configuration.
 /// </summary>
 /// <param name="container">Service Container.</param>
 public static void LoadConfiguration(this ServiceContainer container)
 {
     container.Register <IECommerceReader, ECommerceReader>();
     container.Register <IECommerceDataReader, ECommerceDataReader>();
 }
Пример #52
0
        ///<summary>
        ///Purpose:
        ///     Check report template file path is existing but not valid.
        ///
        ///Parameters:
        ///     refer to "SECOM-AJIS-STC.CMP010-Process of generating document" tab 'Test Data'
        ///
        ///Expected:
        ///     refer to "SECOM-AJIS-STC.CMP010-Process of generating document" tab 'Expected result'
        ///</summary>
        public string Case6()
        {
            IDocumentHandler       target = ServiceContainer.GetService <IDocumentHandler>() as IDocumentHandler;
            doDocumentDataGenerate param  = new doDocumentDataGenerate();

            string expected = null;
            string actual   = null;

            try {
                // TODO Akat K. ContactOffice is wrong name
                DateTime start = new DateTime(2011, 1, 1);
                param.DocumentCode = "BLR010"; param.DocumentNo = "000001"; param.DocumentData = ""; param.OtherKey.ContractCode = "N1230000014"; param.OtherKey.ContractOCC = "0001"; param.OtherKey.QuotationTargetCode = "FN0000000013"; param.OtherKey.Alphabet = "01"; param.OtherKey.ProjectCode = "P0000015"; param.OtherKey.BillingTargetCode = "1230000014-001"; param.OtherKey.InstrumentCode = "ICTest01"; param.OtherKey.ContractOffice = "0001"; param.OtherKey.OperationOffice = "0002"; param.OtherKey.BillingOffice = "0003"; param.OtherKey.InstallationSlipIssueOffice = "0005"; param.OtherKey.MonthYear = start;
                target.GenerateDocument(param);
                param.DocumentCode = "BLR020"; param.DocumentNo = "000002"; param.DocumentData = ""; param.OtherKey.ContractCode = "N1230000014"; param.OtherKey.ContractOCC = "0002"; param.OtherKey.QuotationTargetCode = "FN0000000022"; param.OtherKey.Alphabet = "02"; param.OtherKey.ProjectCode = "P0000023"; param.OtherKey.BillingTargetCode = "1230000026-001"; param.OtherKey.InstrumentCode = "ICTest02"; param.OtherKey.ContractOffice = "0002"; param.OtherKey.OperationOffice = "0003"; param.OtherKey.BillingOffice = "0004"; param.OtherKey.InstallationSlipIssueOffice = "0006"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "CTR010"; param.DocumentNo = "000003"; param.DocumentData = ""; param.OtherKey.ContractCode = "N1230000014"; param.OtherKey.ContractOCC = "0003"; param.OtherKey.QuotationTargetCode = "FN0000000034"; param.OtherKey.Alphabet = "03"; param.OtherKey.ProjectCode = "P0000036"; param.OtherKey.BillingTargetCode = "1230000031-001"; param.OtherKey.InstrumentCode = "ICTest03"; param.OtherKey.ContractOffice = "0003"; param.OtherKey.OperationOffice = "0004"; param.OtherKey.BillingOffice = "0005"; param.OtherKey.InstallationSlipIssueOffice = "0007"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "CTR011"; param.DocumentNo = "000004"; param.DocumentData = ""; param.OtherKey.ContractCode = "N1230000014"; param.OtherKey.ContractOCC = "0004"; param.OtherKey.QuotationTargetCode = "FN0000000041"; param.OtherKey.Alphabet = "04"; param.OtherKey.ProjectCode = "P0000049"; param.OtherKey.BillingTargetCode = "1230000046-001"; param.OtherKey.InstrumentCode = "ICTest04"; param.OtherKey.ContractOffice = "0004"; param.OtherKey.OperationOffice = "0005"; param.OtherKey.BillingOffice = "0006"; param.OtherKey.InstallationSlipIssueOffice = "0008"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "CTR020"; param.DocumentNo = "000005"; param.DocumentData = ""; param.OtherKey.ContractCode = "N1230000014"; param.OtherKey.ContractOCC = "0005"; param.OtherKey.QuotationTargetCode = "FN0000000059"; param.OtherKey.Alphabet = "05"; param.OtherKey.ProjectCode = "P0000055"; param.OtherKey.BillingTargetCode = "1230000051-001"; param.OtherKey.InstrumentCode = "ICTest05"; param.OtherKey.ContractOffice = "0005"; param.OtherKey.OperationOffice = "0006"; param.OtherKey.BillingOffice = "0007"; param.OtherKey.InstallationSlipIssueOffice = "0009"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "CTR030"; param.DocumentNo = "000006"; param.DocumentData = ""; param.OtherKey.ContractCode = "N1230000014"; param.OtherKey.ContractOCC = "0006"; param.OtherKey.QuotationTargetCode = "FN0000000060"; param.OtherKey.Alphabet = "06"; param.OtherKey.ProjectCode = "P0000067"; param.OtherKey.BillingTargetCode = "1230000060-001"; param.OtherKey.InstrumentCode = "ICTest06"; param.OtherKey.ContractOffice = "0006"; param.OtherKey.OperationOffice = "0007"; param.OtherKey.BillingOffice = "0008"; param.OtherKey.InstallationSlipIssueOffice = "0010"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "CTR050"; param.DocumentNo = "000007"; param.DocumentData = ""; param.OtherKey.ContractCode = "N1230000014"; param.OtherKey.ContractOCC = "0007"; param.OtherKey.QuotationTargetCode = "FN0000000073"; param.OtherKey.Alphabet = "07"; param.OtherKey.ProjectCode = "P0000076"; param.OtherKey.BillingTargetCode = "1230000077-001"; param.OtherKey.InstrumentCode = "ICTest07"; param.OtherKey.ContractOffice = "0007"; param.OtherKey.OperationOffice = "0008"; param.OtherKey.BillingOffice = "0009"; param.OtherKey.InstallationSlipIssueOffice = "0011"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "CTR060"; param.DocumentNo = "000008"; param.DocumentData = ""; param.OtherKey.ContractCode = "N1230000014"; param.OtherKey.ContractOCC = "0008"; param.OtherKey.QuotationTargetCode = "FN0000000084"; param.OtherKey.Alphabet = "08"; param.OtherKey.ProjectCode = "P0000081"; param.OtherKey.BillingTargetCode = "1230000083-001"; param.OtherKey.InstrumentCode = "ICTest08"; param.OtherKey.ContractOffice = "0008"; param.OtherKey.OperationOffice = "0009"; param.OtherKey.BillingOffice = "0010"; param.OtherKey.InstallationSlipIssueOffice = "0012"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "CTR070"; param.DocumentNo = "000009"; param.DocumentData = ""; param.OtherKey.ContractCode = "N1230000014"; param.OtherKey.ContractOCC = "0009"; param.OtherKey.QuotationTargetCode = "FN0000000091"; param.OtherKey.Alphabet = "09"; param.OtherKey.ProjectCode = "P0000090"; param.OtherKey.BillingTargetCode = "1230000091-001"; param.OtherKey.InstrumentCode = "ICTest09"; param.OtherKey.ContractOffice = "0009"; param.OtherKey.OperationOffice = "0010"; param.OtherKey.BillingOffice = "0011"; param.OtherKey.InstallationSlipIssueOffice = "0013"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "CTR080"; param.DocumentNo = "000010"; param.DocumentData = ""; param.OtherKey.ContractCode = "N1230000014"; param.OtherKey.ContractOCC = "0010"; param.OtherKey.QuotationTargetCode = "FN0000000108"; param.OtherKey.Alphabet = "10"; param.OtherKey.ProjectCode = "P0000105"; param.OtherKey.BillingTargetCode = "1230000101-001"; param.OtherKey.InstrumentCode = "ICTest10"; param.OtherKey.ContractOffice = "0010"; param.OtherKey.OperationOffice = "0011"; param.OtherKey.BillingOffice = "0012"; param.OtherKey.InstallationSlipIssueOffice = "0014"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "CTR100"; param.DocumentNo = "000011"; param.DocumentData = ""; param.OtherKey.ContractCode = "N1230000014"; param.OtherKey.ContractOCC = "0011"; param.OtherKey.QuotationTargetCode = "FN0000000117"; param.OtherKey.Alphabet = "11"; param.OtherKey.ProjectCode = "P0000115"; param.OtherKey.BillingTargetCode = "1230000114-001"; param.OtherKey.InstrumentCode = "ICTest11"; param.OtherKey.ContractOffice = "0011"; param.OtherKey.OperationOffice = "0012"; param.OtherKey.BillingOffice = "0013"; param.OtherKey.InstallationSlipIssueOffice = "0015"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "CTR110"; param.DocumentNo = "000012"; param.DocumentData = ""; param.OtherKey.ContractCode = "N1230000014"; param.OtherKey.ContractOCC = "0012"; param.OtherKey.QuotationTargetCode = "FN0000000123"; param.OtherKey.Alphabet = "12"; param.OtherKey.ProjectCode = "P0000127"; param.OtherKey.BillingTargetCode = "1230000126-001"; param.OtherKey.InstrumentCode = "ICTest12"; param.OtherKey.ContractOffice = "0012"; param.OtherKey.OperationOffice = "0013"; param.OtherKey.BillingOffice = "0014"; param.OtherKey.InstallationSlipIssueOffice = "0016"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "CTR120"; param.DocumentNo = "000013"; param.DocumentData = ""; param.OtherKey.ContractCode = "N1230000014"; param.OtherKey.ContractOCC = "0013"; param.OtherKey.QuotationTargetCode = "FN0000000132"; param.OtherKey.Alphabet = "13"; param.OtherKey.ProjectCode = "P0000139"; param.OtherKey.BillingTargetCode = "1230000132-001"; param.OtherKey.InstrumentCode = "ICTest13"; param.OtherKey.ContractOffice = "0013"; param.OtherKey.OperationOffice = "0014"; param.OtherKey.BillingOffice = "0015"; param.OtherKey.InstallationSlipIssueOffice = "0017"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "CTR130"; param.DocumentNo = "000014"; param.DocumentData = ""; param.OtherKey.ContractCode = "N1230000014"; param.OtherKey.ContractOCC = "0014"; param.OtherKey.QuotationTargetCode = "FN0000000143"; param.OtherKey.Alphabet = "14"; param.OtherKey.ProjectCode = "P0000148"; param.OtherKey.BillingTargetCode = "1230000149-001"; param.OtherKey.InstrumentCode = "ICTest14"; param.OtherKey.ContractOffice = "0014"; param.OtherKey.OperationOffice = "0015"; param.OtherKey.BillingOffice = "0016"; param.OtherKey.InstallationSlipIssueOffice = "0018"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ICR010"; param.DocumentNo = "000015"; param.DocumentData = ""; param.OtherKey.ContractCode = "N1230000014"; param.OtherKey.ContractOCC = "0015"; param.OtherKey.QuotationTargetCode = "FN0000000151"; param.OtherKey.Alphabet = "15"; param.OtherKey.ProjectCode = "P0000153"; param.OtherKey.BillingTargetCode = "1230000153-001"; param.OtherKey.InstrumentCode = "ICTest15"; param.OtherKey.ContractOffice = "0015"; param.OtherKey.OperationOffice = "0016"; param.OtherKey.BillingOffice = "0017"; param.OtherKey.InstallationSlipIssueOffice = "0019"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ICR020"; param.DocumentNo = "000016"; param.DocumentData = ""; param.OtherKey.ContractCode = "Q1230000014"; param.OtherKey.ContractOCC = "0016"; param.OtherKey.QuotationTargetCode = "FN0000000160"; param.OtherKey.Alphabet = "16"; param.OtherKey.ProjectCode = "P0000164"; param.OtherKey.BillingTargetCode = "1230000166-001"; param.OtherKey.InstrumentCode = "ICTest16"; param.OtherKey.ContractOffice = "0016"; param.OtherKey.OperationOffice = "0017"; param.OtherKey.BillingOffice = "0018"; param.OtherKey.InstallationSlipIssueOffice = "0020"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ICR030"; param.DocumentNo = "000017"; param.DocumentData = ""; param.OtherKey.ContractCode = "Q1230000014"; param.OtherKey.ContractOCC = "0017"; param.OtherKey.QuotationTargetCode = "FN0000000172"; param.OtherKey.Alphabet = "17"; param.OtherKey.ProjectCode = "P0000173"; param.OtherKey.BillingTargetCode = "1230000178-001"; param.OtherKey.InstrumentCode = "ICTest17"; param.OtherKey.ContractOffice = "0017"; param.OtherKey.OperationOffice = "0018"; param.OtherKey.BillingOffice = "0019"; param.OtherKey.InstallationSlipIssueOffice = "0021"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR010"; param.DocumentNo = "000018"; param.DocumentData = ""; param.OtherKey.ContractCode = "Q1230000014"; param.OtherKey.ContractOCC = "0018"; param.OtherKey.QuotationTargetCode = "FN0000000183"; param.OtherKey.Alphabet = "18"; param.OtherKey.ProjectCode = "P0000187"; param.OtherKey.BillingTargetCode = "1230000180-001"; param.OtherKey.InstrumentCode = "ICTest18"; param.OtherKey.ContractOffice = "0018"; param.OtherKey.OperationOffice = "0019"; param.OtherKey.BillingOffice = "0020"; param.OtherKey.InstallationSlipIssueOffice = "0022"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR011"; param.DocumentNo = "000019"; param.DocumentData = ""; param.OtherKey.ContractCode = "Q1230000014"; param.OtherKey.ContractOCC = "0019"; param.OtherKey.QuotationTargetCode = "FN0000000191"; param.OtherKey.Alphabet = "19"; param.OtherKey.ProjectCode = "P0000192"; param.OtherKey.BillingTargetCode = "1230000194-001"; param.OtherKey.InstrumentCode = "ICTest19"; param.OtherKey.ContractOffice = "0019"; param.OtherKey.OperationOffice = "0020"; param.OtherKey.BillingOffice = "0021"; param.OtherKey.InstallationSlipIssueOffice = "0023"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR012"; param.DocumentNo = "000020"; param.DocumentData = ""; param.OtherKey.ContractCode = "Q1230000014"; param.OtherKey.ContractOCC = "0020"; param.OtherKey.QuotationTargetCode = "FN0000000206"; param.OtherKey.Alphabet = "20"; param.OtherKey.ProjectCode = "P0000200"; param.OtherKey.BillingTargetCode = "1230000207-001"; param.OtherKey.InstrumentCode = "ICTest20"; param.OtherKey.ContractOffice = "0020"; param.OtherKey.OperationOffice = "0021"; param.OtherKey.BillingOffice = "0022"; param.OtherKey.InstallationSlipIssueOffice = "0024"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR013"; param.DocumentNo = "000021"; param.DocumentData = ""; param.OtherKey.ContractCode = "Q1230000014"; param.OtherKey.ContractOCC = "0021"; param.OtherKey.QuotationTargetCode = "FN0000000214"; param.OtherKey.Alphabet = "21"; param.OtherKey.ProjectCode = "P0000214"; param.OtherKey.BillingTargetCode = "1230000218-001"; param.OtherKey.InstrumentCode = "ICTest21"; param.OtherKey.ContractOffice = "0021"; param.OtherKey.OperationOffice = "0022"; param.OtherKey.BillingOffice = "0023"; param.OtherKey.InstallationSlipIssueOffice = "0025"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR020"; param.DocumentNo = "000022"; param.DocumentData = ""; param.OtherKey.ContractCode = "Q1230000014"; param.OtherKey.ContractOCC = "0022"; param.OtherKey.QuotationTargetCode = "FN0000000228"; param.OtherKey.Alphabet = "22"; param.OtherKey.ProjectCode = "P0000226"; param.OtherKey.BillingTargetCode = "1230000220-001"; param.OtherKey.InstrumentCode = "ICTest22"; param.OtherKey.ContractOffice = "0022"; param.OtherKey.OperationOffice = "0023"; param.OtherKey.BillingOffice = "0024"; param.OtherKey.InstallationSlipIssueOffice = "0026"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR021"; param.DocumentNo = "000023"; param.DocumentData = ""; param.OtherKey.ContractCode = "Q1230000014"; param.OtherKey.ContractOCC = "0023"; param.OtherKey.QuotationTargetCode = "FN0000000239"; param.OtherKey.Alphabet = "23"; param.OtherKey.ProjectCode = "P0000239"; param.OtherKey.BillingTargetCode = "1230000231-001"; param.OtherKey.InstrumentCode = "ICTest23"; param.OtherKey.ContractOffice = "0023"; param.OtherKey.OperationOffice = "0024"; param.OtherKey.BillingOffice = "0025"; param.OtherKey.InstallationSlipIssueOffice = "0027"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR022"; param.DocumentNo = "000024"; param.DocumentData = ""; param.OtherKey.ContractCode = "Q1230000014"; param.OtherKey.ContractOCC = "0024"; param.OtherKey.QuotationTargetCode = "FN0000000243"; param.OtherKey.Alphabet = "24"; param.OtherKey.ProjectCode = "P0000246"; param.OtherKey.BillingTargetCode = "1230000246-001"; param.OtherKey.InstrumentCode = "ICTest24"; param.OtherKey.ContractOffice = "0024"; param.OtherKey.OperationOffice = "0025"; param.OtherKey.BillingOffice = "0026"; param.OtherKey.InstallationSlipIssueOffice = "0028"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR023"; param.DocumentNo = "000025"; param.DocumentData = ""; param.OtherKey.ContractCode = "Q1230000014"; param.OtherKey.ContractOCC = "0025"; param.OtherKey.QuotationTargetCode = "FN0000000254"; param.OtherKey.Alphabet = "25"; param.OtherKey.ProjectCode = "P0000256"; param.OtherKey.BillingTargetCode = "1230000258-001"; param.OtherKey.InstrumentCode = "ICTest25"; param.OtherKey.ContractOffice = "0025"; param.OtherKey.OperationOffice = "0026"; param.OtherKey.BillingOffice = "0027"; param.OtherKey.InstallationSlipIssueOffice = "0029"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR030"; param.DocumentNo = "000026"; param.DocumentData = ""; param.OtherKey.ContractCode = "Q1230000014"; param.OtherKey.ContractOCC = "0026"; param.OtherKey.QuotationTargetCode = "FN0000000265"; param.OtherKey.Alphabet = "26"; param.OtherKey.ProjectCode = "P0000265"; param.OtherKey.BillingTargetCode = "1230000264-001"; param.OtherKey.InstrumentCode = "ICTest26"; param.OtherKey.ContractOffice = "0026"; param.OtherKey.OperationOffice = "0027"; param.OtherKey.BillingOffice = "0028"; param.OtherKey.InstallationSlipIssueOffice = "0030"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR031"; param.DocumentNo = "000027"; param.DocumentData = ""; param.OtherKey.ContractCode = "Q1230000014"; param.OtherKey.ContractOCC = "0027"; param.OtherKey.QuotationTargetCode = "FN0000000272"; param.OtherKey.Alphabet = "27"; param.OtherKey.ProjectCode = "P0000274"; param.OtherKey.BillingTargetCode = "1230000279-001"; param.OtherKey.InstrumentCode = "ICTest27"; param.OtherKey.ContractOffice = "0027"; param.OtherKey.OperationOffice = "0028"; param.OtherKey.BillingOffice = "0029"; param.OtherKey.InstallationSlipIssueOffice = "0031"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR032"; param.DocumentNo = "000028"; param.DocumentData = ""; param.OtherKey.ContractCode = "Q1230000014"; param.OtherKey.ContractOCC = "0028"; param.OtherKey.QuotationTargetCode = "FN0000000281"; param.OtherKey.Alphabet = "28"; param.OtherKey.ProjectCode = "P0000282"; param.OtherKey.BillingTargetCode = "1230000287-001"; param.OtherKey.InstrumentCode = "ICTest28"; param.OtherKey.ContractOffice = "0028"; param.OtherKey.OperationOffice = "0029"; param.OtherKey.BillingOffice = "0030"; param.OtherKey.InstallationSlipIssueOffice = "0032"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR033"; param.DocumentNo = "000029"; param.DocumentData = ""; param.OtherKey.ContractCode = "Q1230000014"; param.OtherKey.ContractOCC = "0029"; param.OtherKey.QuotationTargetCode = "FN0000000297"; param.OtherKey.Alphabet = "29"; param.OtherKey.ProjectCode = "P0000294"; param.OtherKey.BillingTargetCode = "1230000292-001"; param.OtherKey.InstrumentCode = "ICTest29"; param.OtherKey.ContractOffice = "0029"; param.OtherKey.OperationOffice = "0030"; param.OtherKey.BillingOffice = "0031"; param.OtherKey.InstallationSlipIssueOffice = "0033"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR040"; param.DocumentNo = "000030"; param.DocumentData = ""; param.OtherKey.ContractCode = "Q1230000014"; param.OtherKey.ContractOCC = "0030"; param.OtherKey.QuotationTargetCode = "FN0000000304"; param.OtherKey.Alphabet = "30"; param.OtherKey.ProjectCode = "P0000300"; param.OtherKey.BillingTargetCode = "1230000303-001"; param.OtherKey.InstrumentCode = "ICTest30"; param.OtherKey.ContractOffice = "0030"; param.OtherKey.OperationOffice = "0031"; param.OtherKey.BillingOffice = "0032"; param.OtherKey.InstallationSlipIssueOffice = "0034"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR041"; param.DocumentNo = "000031"; param.DocumentData = ""; param.OtherKey.ContractCode = "MA1230000014"; param.OtherKey.ContractOCC = "0031"; param.OtherKey.QuotationTargetCode = "FN0000000316"; param.OtherKey.Alphabet = "31"; param.OtherKey.ProjectCode = "P0000313"; param.OtherKey.BillingTargetCode = "1230000314-001"; param.OtherKey.InstrumentCode = "ICTest31"; param.OtherKey.ContractOffice = "0031"; param.OtherKey.OperationOffice = "0032"; param.OtherKey.BillingOffice = "0033"; param.OtherKey.InstallationSlipIssueOffice = "0035"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR042"; param.DocumentNo = "000032"; param.DocumentData = ""; param.OtherKey.ContractCode = "MA1230000014"; param.OtherKey.ContractOCC = "0032"; param.OtherKey.QuotationTargetCode = "FN0000000328"; param.OtherKey.Alphabet = "32"; param.OtherKey.ProjectCode = "P0000328"; param.OtherKey.BillingTargetCode = "1230000321-001"; param.OtherKey.InstrumentCode = "ICTest32"; param.OtherKey.ContractOffice = "0032"; param.OtherKey.OperationOffice = "0033"; param.OtherKey.BillingOffice = "0034"; param.OtherKey.InstallationSlipIssueOffice = "0036"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR043"; param.DocumentNo = "000033"; param.DocumentData = ""; param.OtherKey.ContractCode = "MA1230000014"; param.OtherKey.ContractOCC = "0033"; param.OtherKey.QuotationTargetCode = "FN0000000339"; param.OtherKey.Alphabet = "33"; param.OtherKey.ProjectCode = "P0000339"; param.OtherKey.BillingTargetCode = "1230000330-001"; param.OtherKey.InstrumentCode = "ICTest33"; param.OtherKey.ContractOffice = "0033"; param.OtherKey.OperationOffice = "0034"; param.OtherKey.BillingOffice = "0035"; param.OtherKey.InstallationSlipIssueOffice = "0037"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR044"; param.DocumentNo = "000034"; param.DocumentData = ""; param.OtherKey.ContractCode = "MA1230000014"; param.OtherKey.ContractOCC = "0034"; param.OtherKey.QuotationTargetCode = "FN0000000342"; param.OtherKey.Alphabet = "34"; param.OtherKey.ProjectCode = "P0000344"; param.OtherKey.BillingTargetCode = "1230000345-001"; param.OtherKey.InstrumentCode = "ICTest34"; param.OtherKey.ContractOffice = "0034"; param.OtherKey.OperationOffice = "0035"; param.OtherKey.BillingOffice = "0036"; param.OtherKey.InstallationSlipIssueOffice = "0038"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR045"; param.DocumentNo = "000035"; param.DocumentData = ""; param.OtherKey.ContractCode = "MA1230000014"; param.OtherKey.ContractOCC = "0035"; param.OtherKey.QuotationTargetCode = "FN0000000354"; param.OtherKey.Alphabet = "35"; param.OtherKey.ProjectCode = "P0000351"; param.OtherKey.BillingTargetCode = "1230000359-001"; param.OtherKey.InstrumentCode = "ICTest35"; param.OtherKey.ContractOffice = "0035"; param.OtherKey.OperationOffice = "0036"; param.OtherKey.BillingOffice = "0037"; param.OtherKey.InstallationSlipIssueOffice = "0039"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR050"; param.DocumentNo = "000036"; param.DocumentData = ""; param.OtherKey.ContractCode = "MA1230000014"; param.OtherKey.ContractOCC = "0036"; param.OtherKey.QuotationTargetCode = "FN0000000360"; param.OtherKey.Alphabet = "36"; param.OtherKey.ProjectCode = "P0000362"; param.OtherKey.BillingTargetCode = "1230000367-001"; param.OtherKey.InstrumentCode = "ICTest36"; param.OtherKey.ContractOffice = "0036"; param.OtherKey.OperationOffice = "0037"; param.OtherKey.BillingOffice = "0038"; param.OtherKey.InstallationSlipIssueOffice = "0040"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR051"; param.DocumentNo = "000037"; param.DocumentData = ""; param.OtherKey.ContractCode = "MA1230000014"; param.OtherKey.ContractOCC = "0037"; param.OtherKey.QuotationTargetCode = "FN0000000374"; param.OtherKey.Alphabet = "37"; param.OtherKey.ProjectCode = "P0000374"; param.OtherKey.BillingTargetCode = "1230000377-001"; param.OtherKey.InstrumentCode = "ICTest37"; param.OtherKey.ContractOffice = "0037"; param.OtherKey.OperationOffice = "0038"; param.OtherKey.BillingOffice = "0039"; param.OtherKey.InstallationSlipIssueOffice = "0041"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR060"; param.DocumentNo = "000038"; param.DocumentData = ""; param.OtherKey.ContractCode = "MA1230000014"; param.OtherKey.ContractOCC = "0038"; param.OtherKey.QuotationTargetCode = "FN0000000385"; param.OtherKey.Alphabet = "38"; param.OtherKey.ProjectCode = "P0000385"; param.OtherKey.BillingTargetCode = "1230000388-001"; param.OtherKey.InstrumentCode = "ICTest38"; param.OtherKey.ContractOffice = "0038"; param.OtherKey.OperationOffice = "0039"; param.OtherKey.BillingOffice = "0040"; param.OtherKey.InstallationSlipIssueOffice = "0042"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR070"; param.DocumentNo = "000039"; param.DocumentData = ""; param.OtherKey.ContractCode = "MA1230000014"; param.OtherKey.ContractOCC = "0039"; param.OtherKey.QuotationTargetCode = "FN0000000393"; param.OtherKey.Alphabet = "39"; param.OtherKey.ProjectCode = "P0000396"; param.OtherKey.BillingTargetCode = "1230000398-001"; param.OtherKey.InstrumentCode = "ICTest39"; param.OtherKey.ContractOffice = "0039"; param.OtherKey.OperationOffice = "0040"; param.OtherKey.BillingOffice = "0041"; param.OtherKey.InstallationSlipIssueOffice = "0043"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR080"; param.DocumentNo = "000040"; param.DocumentData = ""; param.OtherKey.ContractCode = "MA1230000014"; param.OtherKey.ContractOCC = "0040"; param.OtherKey.QuotationTargetCode = "FN0000000405"; param.OtherKey.Alphabet = "40"; param.OtherKey.ProjectCode = "P0000407"; param.OtherKey.BillingTargetCode = "1230000400-001"; param.OtherKey.InstrumentCode = "ICTest40"; param.OtherKey.ContractOffice = "0040"; param.OtherKey.OperationOffice = "0041"; param.OtherKey.BillingOffice = "0042"; param.OtherKey.InstallationSlipIssueOffice = "0044"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "ISR090"; param.DocumentNo = "000041"; param.DocumentData = ""; param.OtherKey.ContractCode = "MA1230000014"; param.OtherKey.ContractOCC = "0041"; param.OtherKey.QuotationTargetCode = "FN0000000416"; param.OtherKey.Alphabet = "41"; param.OtherKey.ProjectCode = "P0000410"; param.OtherKey.BillingTargetCode = "1230000415-001"; param.OtherKey.InstrumentCode = "ICTest41"; param.OtherKey.ContractOffice = "0041"; param.OtherKey.OperationOffice = "0042"; param.OtherKey.BillingOffice = "0043"; param.OtherKey.InstallationSlipIssueOffice = "0045"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "IVR010"; param.DocumentNo = "000042"; param.DocumentData = ""; param.OtherKey.ContractCode = "MA1230000014"; param.OtherKey.ContractOCC = "0042"; param.OtherKey.QuotationTargetCode = "FN0000000422"; param.OtherKey.Alphabet = "42"; param.OtherKey.ProjectCode = "P0000428"; param.OtherKey.BillingTargetCode = "1230000426-001"; param.OtherKey.InstrumentCode = "ICTest42"; param.OtherKey.ContractOffice = "0042"; param.OtherKey.OperationOffice = "0043"; param.OtherKey.BillingOffice = "0044"; param.OtherKey.InstallationSlipIssueOffice = "0046"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "IVR020"; param.DocumentNo = "000043"; param.DocumentData = ""; param.OtherKey.ContractCode = "MA1230000014"; param.OtherKey.ContractOCC = "0043"; param.OtherKey.QuotationTargetCode = "FN0000000431"; param.OtherKey.Alphabet = "43"; param.OtherKey.ProjectCode = "P0000439"; param.OtherKey.BillingTargetCode = "1230000434-001"; param.OtherKey.InstrumentCode = "ICTest43"; param.OtherKey.ContractOffice = "0043"; param.OtherKey.OperationOffice = "0044"; param.OtherKey.BillingOffice = "0045"; param.OtherKey.InstallationSlipIssueOffice = "0047"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "IVR030"; param.DocumentNo = "000044"; param.DocumentData = ""; param.OtherKey.ContractCode = "MA1230000014"; param.OtherKey.ContractOCC = "0044"; param.OtherKey.QuotationTargetCode = "FN0000000447"; param.OtherKey.Alphabet = "44"; param.OtherKey.ProjectCode = "P0000446"; param.OtherKey.BillingTargetCode = "1230000442-001"; param.OtherKey.InstrumentCode = "ICTest44"; param.OtherKey.ContractOffice = "0044"; param.OtherKey.OperationOffice = "0045"; param.OtherKey.BillingOffice = "0046"; param.OtherKey.InstallationSlipIssueOffice = "0048"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "IVR040"; param.DocumentNo = "000045"; param.DocumentData = ""; param.OtherKey.ContractCode = "MA1230000014"; param.OtherKey.ContractOCC = "0045"; param.OtherKey.QuotationTargetCode = "FN0000000459"; param.OtherKey.Alphabet = "45"; param.OtherKey.ProjectCode = "P0000453"; param.OtherKey.BillingTargetCode = "1230000451-001"; param.OtherKey.InstrumentCode = "ICTest45"; param.OtherKey.ContractOffice = "0045"; param.OtherKey.OperationOffice = "0046"; param.OtherKey.BillingOffice = "0047"; param.OtherKey.InstallationSlipIssueOffice = "0049"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "IVR050"; param.DocumentNo = "000046"; param.DocumentData = ""; param.OtherKey.ContractCode = "SG1230000014"; param.OtherKey.ContractOCC = "0046"; param.OtherKey.QuotationTargetCode = "FN0000000464"; param.OtherKey.Alphabet = "46"; param.OtherKey.ProjectCode = "P0000465"; param.OtherKey.BillingTargetCode = "1230000468-001"; param.OtherKey.InstrumentCode = "ICTest46"; param.OtherKey.ContractOffice = "0046"; param.OtherKey.OperationOffice = "0047"; param.OtherKey.BillingOffice = "0048"; param.OtherKey.InstallationSlipIssueOffice = "0050"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "IVR060"; param.DocumentNo = "000047"; param.DocumentData = ""; param.OtherKey.ContractCode = "SG1230000014"; param.OtherKey.ContractOCC = "0047"; param.OtherKey.QuotationTargetCode = "FN0000000474"; param.OtherKey.Alphabet = "47"; param.OtherKey.ProjectCode = "P0000474"; param.OtherKey.BillingTargetCode = "1230000473-001"; param.OtherKey.InstrumentCode = "ICTest47"; param.OtherKey.ContractOffice = "0047"; param.OtherKey.OperationOffice = "0048"; param.OtherKey.BillingOffice = "0049"; param.OtherKey.InstallationSlipIssueOffice = "0051"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "IVR070"; param.DocumentNo = "000048"; param.DocumentData = ""; param.OtherKey.ContractCode = "SG1230000014"; param.OtherKey.ContractOCC = "0048"; param.OtherKey.QuotationTargetCode = "FN0000000486"; param.OtherKey.Alphabet = "48"; param.OtherKey.ProjectCode = "P0000481"; param.OtherKey.BillingTargetCode = "1230000487-001"; param.OtherKey.InstrumentCode = "ICTest48"; param.OtherKey.ContractOffice = "0048"; param.OtherKey.OperationOffice = "0049"; param.OtherKey.BillingOffice = "0050"; param.OtherKey.InstallationSlipIssueOffice = "0052"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "IVR080"; param.DocumentNo = "000049"; param.DocumentData = ""; param.OtherKey.ContractCode = "SG1230000014"; param.OtherKey.ContractOCC = "0049"; param.OtherKey.QuotationTargetCode = "FN0000000492"; param.OtherKey.Alphabet = "49"; param.OtherKey.ProjectCode = "P0000490"; param.OtherKey.BillingTargetCode = "1230000494-001"; param.OtherKey.InstrumentCode = "ICTest49"; param.OtherKey.ContractOffice = "0049"; param.OtherKey.OperationOffice = "0050"; param.OtherKey.BillingOffice = "0051"; param.OtherKey.InstallationSlipIssueOffice = "0053"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "IVR090"; param.DocumentNo = "000050"; param.DocumentData = ""; param.OtherKey.ContractCode = "SG1230000014"; param.OtherKey.ContractOCC = "0050"; param.OtherKey.QuotationTargetCode = "FN0000000508"; param.OtherKey.Alphabet = "50"; param.OtherKey.ProjectCode = "P0000502"; param.OtherKey.BillingTargetCode = "1230000505-001"; param.OtherKey.InstrumentCode = "ICTest50"; param.OtherKey.ContractOffice = "0050"; param.OtherKey.OperationOffice = "0051"; param.OtherKey.BillingOffice = "0052"; param.OtherKey.InstallationSlipIssueOffice = "0054"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "IVR110"; param.DocumentNo = "000051"; param.DocumentData = ""; param.OtherKey.ContractCode = "SG1230000014"; param.OtherKey.ContractOCC = "0051"; param.OtherKey.QuotationTargetCode = "FN0000000512"; param.OtherKey.Alphabet = "51"; param.OtherKey.ProjectCode = "P0000516"; param.OtherKey.BillingTargetCode = "1230000519-001"; param.OtherKey.InstrumentCode = "ICTest51"; param.OtherKey.ContractOffice = "0051"; param.OtherKey.OperationOffice = "0052"; param.OtherKey.BillingOffice = "0053"; param.OtherKey.InstallationSlipIssueOffice = "0055"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "IVR120"; param.DocumentNo = "000052"; param.DocumentData = ""; param.OtherKey.ContractCode = "SG1230000014"; param.OtherKey.ContractOCC = "0052"; param.OtherKey.QuotationTargetCode = "FN0000000523"; param.OtherKey.Alphabet = "52"; param.OtherKey.ProjectCode = "P0000525"; param.OtherKey.BillingTargetCode = "1230000520-001"; param.OtherKey.InstrumentCode = "ICTest52"; param.OtherKey.ContractOffice = "0052"; param.OtherKey.OperationOffice = "0053"; param.OtherKey.BillingOffice = "0054"; param.OtherKey.InstallationSlipIssueOffice = "0056"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "IVR130"; param.DocumentNo = "000053"; param.DocumentData = ""; param.OtherKey.ContractCode = "SG1230000014"; param.OtherKey.ContractOCC = "0053"; param.OtherKey.QuotationTargetCode = "FN0000000539"; param.OtherKey.Alphabet = "53"; param.OtherKey.ProjectCode = "P0000535"; param.OtherKey.BillingTargetCode = "1230000535-001"; param.OtherKey.InstrumentCode = "ICTest53"; param.OtherKey.ContractOffice = "0053"; param.OtherKey.OperationOffice = "0054"; param.OtherKey.BillingOffice = "0055"; param.OtherKey.InstallationSlipIssueOffice = "0057"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "IVR140"; param.DocumentNo = "000054"; param.DocumentData = ""; param.OtherKey.ContractCode = "SG1230000014"; param.OtherKey.ContractOCC = "0054"; param.OtherKey.QuotationTargetCode = "FN0000000544"; param.OtherKey.Alphabet = "54"; param.OtherKey.ProjectCode = "P0000542"; param.OtherKey.BillingTargetCode = "1230000546-001"; param.OtherKey.InstrumentCode = "ICTest54"; param.OtherKey.ContractOffice = "0054"; param.OtherKey.OperationOffice = "0055"; param.OtherKey.BillingOffice = "0056"; param.OtherKey.InstallationSlipIssueOffice = "0058"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "IVR150"; param.DocumentNo = "000055"; param.DocumentData = ""; param.OtherKey.ContractCode = "SG1230000014"; param.OtherKey.ContractOCC = "0055"; param.OtherKey.QuotationTargetCode = "FN0000000554"; param.OtherKey.Alphabet = "55"; param.OtherKey.ProjectCode = "P0000553"; param.OtherKey.BillingTargetCode = "1230000553-001"; param.OtherKey.InstrumentCode = "ICTest55"; param.OtherKey.ContractOffice = "0055"; param.OtherKey.OperationOffice = "0056"; param.OtherKey.BillingOffice = "0057"; param.OtherKey.InstallationSlipIssueOffice = "0059"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "IVR170"; param.DocumentNo = "000056"; param.DocumentData = ""; param.OtherKey.ContractCode = "SG1230000014"; param.OtherKey.ContractOCC = "0056"; param.OtherKey.QuotationTargetCode = "FN0000000562"; param.OtherKey.Alphabet = "56"; param.OtherKey.ProjectCode = "P0000569"; param.OtherKey.BillingTargetCode = "1230000567-001"; param.OtherKey.InstrumentCode = "ICTest56"; param.OtherKey.ContractOffice = "0056"; param.OtherKey.OperationOffice = "0057"; param.OtherKey.BillingOffice = "0058"; param.OtherKey.InstallationSlipIssueOffice = "0060"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "IVR180"; param.DocumentNo = "000057"; param.DocumentData = ""; param.OtherKey.ContractCode = "SG1230000014"; param.OtherKey.ContractOCC = "0057"; param.OtherKey.QuotationTargetCode = "FN0000000578"; param.OtherKey.Alphabet = "57"; param.OtherKey.ProjectCode = "P0000578"; param.OtherKey.BillingTargetCode = "1230000574-001"; param.OtherKey.InstrumentCode = "ICTest57"; param.OtherKey.ContractOffice = "0057"; param.OtherKey.OperationOffice = "0058"; param.OtherKey.BillingOffice = "0059"; param.OtherKey.InstallationSlipIssueOffice = "0061"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "IVR190"; param.DocumentNo = "000058"; param.DocumentData = ""; param.OtherKey.ContractCode = "SG1230000014"; param.OtherKey.ContractOCC = "0058"; param.OtherKey.QuotationTargetCode = "FN0000000583"; param.OtherKey.Alphabet = "58"; param.OtherKey.ProjectCode = "P0000587"; param.OtherKey.BillingTargetCode = "1230000580-001"; param.OtherKey.InstrumentCode = "ICTest58"; param.OtherKey.ContractOffice = "0058"; param.OtherKey.OperationOffice = "0059"; param.OtherKey.BillingOffice = "0060"; param.OtherKey.InstallationSlipIssueOffice = "0062"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
                param.DocumentCode = "IVR191"; param.DocumentNo = "000059"; param.DocumentData = ""; param.OtherKey.ContractCode = "SG1230000014"; param.OtherKey.ContractOCC = "0059"; param.OtherKey.QuotationTargetCode = "FN0000000599"; param.OtherKey.Alphabet = "59"; param.OtherKey.ProjectCode = "P0000594"; param.OtherKey.BillingTargetCode = "1230000598-001"; param.OtherKey.InstrumentCode = "ICTest59"; param.OtherKey.ContractOffice = "0059"; param.OtherKey.OperationOffice = "0060"; param.OtherKey.BillingOffice = "0061"; param.OtherKey.InstallationSlipIssueOffice = "0063"; param.OtherKey.MonthYear = start.AddDays(1);
                target.GenerateDocument(param);
            } catch (ApplicationErrorException ex) {
                actual = ex.ErrorResult.Message.Code;
            } catch (Exception ex) {
                actual = ex.StackTrace;
            }

            // TODO Akat K. : compare result
            return(string.Format(RESULT_FORMAT, 6, expected, actual, CompareResult_String(expected, actual)));
        }
 public override void PrepareBasic()
 {
     this.container = new ServiceContainer();
     this.RegisterBasic();
 }
Пример #54
0
        public static async Task <bool> PerformMigrationAsync()
        {
            if (!NeedsMigration() || Migrating)
            {
                return(false);
            }

            Migrating = true;
            var settingsShim            = ServiceContainer.Resolve <SettingsShim>("settingsShim");
            var oldSecureStorageService = ServiceContainer.Resolve <Abstractions.IOldSecureStorageService>(
                "oldSecureStorageService");

            var messagingService          = ServiceContainer.Resolve <IMessagingService>("messagingService");
            var storageService            = ServiceContainer.Resolve <IStorageService>("storageService");
            var secureStorageService      = ServiceContainer.Resolve <IStorageService>("secureStorageService");
            var cryptoService             = ServiceContainer.Resolve <ICryptoService>("cryptoService");
            var tokenService              = ServiceContainer.Resolve <ITokenService>("tokenService");
            var userService               = ServiceContainer.Resolve <IUserService>("userService");
            var environmentService        = ServiceContainer.Resolve <IEnvironmentService>("environmentService");
            var passwordGenerationService = ServiceContainer.Resolve <IPasswordGenerationService>(
                "passwordGenerationService");
            var syncService = ServiceContainer.Resolve <ISyncService>("syncService");
            var lockService = ServiceContainer.Resolve <ILockService>("lockService");

            // Get old data

            var oldTokenBytes = oldSecureStorageService.Retrieve("accessToken");
            var oldToken      = oldTokenBytes == null ? null : Encoding.UTF8.GetString(
                oldTokenBytes, 0, oldTokenBytes.Length);
            var oldKeyBytes = oldSecureStorageService.Retrieve("key");
            var oldKey      = oldKeyBytes == null ? null : new Models.SymmetricCryptoKey(oldKeyBytes);
            var oldUserId   = settingsShim.GetValueOrDefault("userId", null);

            var isAuthenticated = oldKey != null && !string.IsNullOrWhiteSpace(oldToken) &&
                                  !string.IsNullOrWhiteSpace(oldUserId);

            if (!isAuthenticated)
            {
                Migrating = false;
                return(false);
            }

            var oldRefreshTokenBytes = oldSecureStorageService.Retrieve("refreshToken");
            var oldRefreshToken      = oldRefreshTokenBytes == null ? null : Encoding.UTF8.GetString(
                oldRefreshTokenBytes, 0, oldRefreshTokenBytes.Length);
            var oldPinBytes = oldSecureStorageService.Retrieve("pin");
            var oldPin      = oldPinBytes == null ? null : Encoding.UTF8.GetString(
                oldPinBytes, 0, oldPinBytes.Length);

            var oldEncKey        = settingsShim.GetValueOrDefault("encKey", null);
            var oldEncPrivateKey = settingsShim.GetValueOrDefault("encPrivateKey", null);
            var oldEmail         = settingsShim.GetValueOrDefault("email", null);
            var oldKdf           = (KdfType)settingsShim.GetValueOrDefault("kdf", (int)KdfType.PBKDF2_SHA256);
            var oldKdfIterations = settingsShim.GetValueOrDefault("kdfIterations", 5000);

            var oldTwoFactorTokenBytes = oldSecureStorageService.Retrieve(
                string.Format("twoFactorToken_{0}", Convert.ToBase64String(Encoding.UTF8.GetBytes(oldEmail))));
            var oldTwoFactorToken = oldTwoFactorTokenBytes == null ? null : Encoding.UTF8.GetString(
                oldTwoFactorTokenBytes, 0, oldTwoFactorTokenBytes.Length);

            var oldAppIdBytes     = oldSecureStorageService.Retrieve("appId");
            var oldAppId          = oldAppIdBytes == null ? null : new Guid(oldAppIdBytes).ToString();
            var oldAnonAppIdBytes = oldSecureStorageService.Retrieve("anonymousAppId");
            var oldAnonAppId      = oldAnonAppIdBytes == null ? null : new Guid(oldAnonAppIdBytes).ToString();
            var oldFingerprint    = settingsShim.GetValueOrDefault("setting:fingerprintUnlockOn", false);

            // Save settings

            await storageService.SaveAsync(Constants.AccessibilityAutofillPersistNotificationKey,
                                           settingsShim.GetValueOrDefault("setting:persistNotification", false));

            await storageService.SaveAsync(Constants.AccessibilityAutofillPasswordFieldKey,
                                           settingsShim.GetValueOrDefault("setting:autofillPasswordField", false));

            await storageService.SaveAsync(Constants.DisableAutoTotpCopyKey,
                                           settingsShim.GetValueOrDefault("setting:disableAutoCopyTotp", false));

            await storageService.SaveAsync(Constants.DisableFaviconKey,
                                           settingsShim.GetValueOrDefault("setting:disableWebsiteIcons", false));

            await storageService.SaveAsync(Constants.AddSitePromptShownKey,
                                           settingsShim.GetValueOrDefault("addedSiteAlert", false));

            await storageService.SaveAsync(Constants.PushInitialPromptShownKey,
                                           settingsShim.GetValueOrDefault("push:initialPromptShown", false));

            await storageService.SaveAsync(Constants.PushCurrentTokenKey,
                                           settingsShim.GetValueOrDefault("push:currentToken", null));

            await storageService.SaveAsync(Constants.PushRegisteredTokenKey,
                                           settingsShim.GetValueOrDefault("push:registeredToken", null));

            // For some reason "push:lastRegistrationDate" isn't getting pulled from settingsShim correctly.
            // We don't really need it anyways.
            // var lastReg = settingsShim.GetValueOrDefault("push:lastRegistrationDate", DateTime.MinValue);
            // await storageService.SaveAsync(Constants.PushLastRegistrationDateKey, lastReg);
            await storageService.SaveAsync("rememberedEmail",
                                           settingsShim.GetValueOrDefault("other:lastLoginEmail", null));

            await storageService.SaveAsync("appExtensionStarted",
                                           settingsShim.GetValueOrDefault("extension:started", false));

            await storageService.SaveAsync("appExtensionActivated",
                                           settingsShim.GetValueOrDefault("extension:activated", false));

            await environmentService.SetUrlsAsync(new Core.Models.Data.EnvironmentUrlData
            {
                Base     = settingsShim.GetValueOrDefault("other:baseUrl", null),
                Api      = settingsShim.GetValueOrDefault("other:apiUrl", null),
                WebVault = settingsShim.GetValueOrDefault("other:webVaultUrl", null),
                Identity = settingsShim.GetValueOrDefault("other:identityUrl", null),
                Icons    = settingsShim.GetValueOrDefault("other:iconsUrl", null)
            });

            await passwordGenerationService.SaveOptionsAsync(new Core.Models.Domain.PasswordGenerationOptions
            {
                Ambiguous     = settingsShim.GetValueOrDefault("pwGenerator:ambiguous", false),
                Length        = settingsShim.GetValueOrDefault("pwGenerator:length", 15),
                Uppercase     = settingsShim.GetValueOrDefault("pwGenerator:uppercase", true),
                Lowercase     = settingsShim.GetValueOrDefault("pwGenerator:lowercase", true),
                Number        = settingsShim.GetValueOrDefault("pwGenerator:numbers", true),
                MinNumber     = settingsShim.GetValueOrDefault("pwGenerator:minNumbers", 0),
                Special       = settingsShim.GetValueOrDefault("pwGenerator:special", true),
                MinSpecial    = settingsShim.GetValueOrDefault("pwGenerator:minSpecial", 0),
                WordSeparator = "-",
                NumWords      = 3
            });

            // Save lock options

            int?lockOptionsSeconds = settingsShim.GetValueOrDefault("setting:lockSeconds", -10);

            if (lockOptionsSeconds == -10)
            {
                lockOptionsSeconds = 60 * 15;
            }
            else if (lockOptionsSeconds == -1)
            {
                lockOptionsSeconds = null;
            }
            await storageService.SaveAsync(Constants.LockOptionKey,
                                           lockOptionsSeconds == null?(int?)null : lockOptionsSeconds.Value / 60);

            // Save app ids

            await storageService.SaveAsync("appId", oldAppId);

            await storageService.SaveAsync("anonymousAppId", oldAnonAppId);

            // Save new authed data

            await tokenService.SetTwoFactorTokenAsync(oldTwoFactorToken, oldEmail);

            await tokenService.SetTokensAsync(oldToken, oldRefreshToken);

            await userService.SetInformationAsync(oldUserId, oldEmail, oldKdf, oldKdfIterations);

            var newKey = new Core.Models.Domain.SymmetricCryptoKey(oldKey.Key);
            await cryptoService.SetKeyAsync(newKey);

            // Key hash is unavailable in old version, store old key until we can move it to key hash
            await secureStorageService.SaveAsync("oldKey", newKey.KeyB64);

            await cryptoService.SetEncKeyAsync(oldEncKey);

            await cryptoService.SetEncPrivateKeyAsync(oldEncPrivateKey);

            // Save fingerprint/pin

            if (oldFingerprint)
            {
                await storageService.SaveAsync(Constants.FingerprintUnlockKey, true);
            }
            else if (!string.IsNullOrWhiteSpace(oldPin))
            {
                var pinKey = await cryptoService.MakePinKeyAysnc(oldPin, oldEmail, oldKdf, oldKdfIterations);

                var pinProtectedKey = await cryptoService.EncryptAsync(oldKeyBytes, pinKey);

                await storageService.SaveAsync(Constants.PinProtectedKey, pinProtectedKey.EncryptedString);
            }

            // Post migration tasks
            await cryptoService.ToggleKeyAsync();

            await storageService.SaveAsync(Constants.LastActiveKey, DateTime.UtcNow.AddYears(-1));

            await lockService.CheckLockAsync();

            // Remove "needs migration" flag
            settingsShim.Remove(Constants.OldUserIdKey);
            await storageService.SaveAsync(Constants.MigratedFromV1, true);

            Migrating = false;
            messagingService.Send("migrated");
            if (Xamarin.Essentials.Connectivity.NetworkAccess != Xamarin.Essentials.NetworkAccess.None)
            {
                var task = Task.Run(() => syncService.FullSyncAsync(true));
            }
            return(true);
        }
Пример #55
0
 public AddExpenseController(IntPtr handle) : base(handle)
 {
     assignmentViewModel = ServiceContainer.Resolve <AssignmentViewModel>();
     expenseViewModel    = ServiceContainer.Resolve <ExpenseViewModel>();
 }
Пример #56
0
 public static bool NeedsMigration()
 {
     return(ServiceContainer.Resolve <SettingsShim>("settingsShim")
            .GetValueOrDefault(Constants.OldUserIdKey, null) != null);;
 }
        private void SetUp()
        {
            const string Original     = @"original.config";
            const string OriginalMono = @"original.mono.config";

            if (Helper.IsRunningOnMono())
            {
                File.Copy("Website1/original.config", "Website1/web.config", true);
                File.Copy(OriginalMono, Current, true);
            }
            else
            {
                File.Copy("Website1\\original.config", "Website1\\web.config", true);
                File.Copy(Original, Current, true);
            }

            Environment.SetEnvironmentVariable(
                "JEXUS_TEST_HOME",
                Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));

            _server = new IisExpressServerManager(Current);

            var serviceContainer = new ServiceContainer();

            serviceContainer.RemoveService(typeof(IConfigurationService));
            serviceContainer.RemoveService(typeof(IControlPanel));
            var scope = ManagementScope.Site;

            serviceContainer.AddService(typeof(IControlPanel), new ControlPanel());
            serviceContainer.AddService(
                typeof(IConfigurationService),
                new ConfigurationService(
                    null,
                    _server.Sites[0].GetWebConfiguration(),
                    scope,
                    null,
                    _server.Sites[0],
                    null,
                    null,
                    null, _server.Sites[0].Name));

            serviceContainer.RemoveService(typeof(IManagementUIService));
            var mock = new Mock <IManagementUIService>();

            mock.Setup(
                action =>
                action.ShowMessage(
                    It.IsAny <string>(),
                    It.IsAny <string>(),
                    It.IsAny <MessageBoxButtons>(),
                    It.IsAny <MessageBoxIcon>(),
                    It.IsAny <MessageBoxDefaultButton>())).Returns(DialogResult.Yes);
            serviceContainer.AddService(typeof(IManagementUIService), mock.Object);

            var module = new RequestFilteringModule();

            module.TestInitialize(serviceContainer, null);

            _feature = new HiddenSegmentsFeature(module);
            _feature.Load();
        }
Пример #58
0
 public DefaultErrorService(DesignContext context)
 {
     this.services = context.Services;
 }
Пример #59
0
        /// <summary>
        /// Check system suspending, user’s permission and user’s authority of screen
        /// </summary>
        /// <param name="sParam"></param>
        /// <returns></returns>
        public ActionResult CTS090_Authority(CTS090_ScreenParameter sParam)
        {
            ObjectResultData     res     = new ObjectResultData();
            CommonUtil           comUtil = new CommonUtil();
            ISaleContractHandler saleHandler;
            List <tbt_SaleBasic> tbtSaleBasicList;
            tbt_SaleBasic        tbt_SaleBasicData = null;
            string strContractCodeLong             = string.Empty;
            string strOccCode = string.Empty;
            CTS090_doSaleBasicDataAuthority doSaleBasicDataAuthority;

            try
            {
                //CheckSystemStatus
                if (CheckIsSuspending(res) == true)
                {
                    return(Json(res));
                }

                /*--- HasAuthority ---*/
                //Check screen permission
                if (CheckUserPermission(ScreenID.C_SCREEN_ID_CANCEL_SALE_CONTRACT, FunctionID.C_FUNC_ID_OPERATE) == false)
                {
                    res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0053);
                    return(Json(res));
                }

                //if (String.IsNullOrEmpty(sParam.ContractCode))
                //    sParam.ContractCode = CommonUtil.dsTransData.dtCommonSearch.ContractCode;
                if (String.IsNullOrEmpty(sParam.ContractCode) && sParam.CommonSearch != null)
                {
                    if (CommonUtil.IsNullOrEmpty(sParam.CommonSearch.ContractCode) == false)
                    {
                        sParam.ContractCode = sParam.CommonSearch.ContractCode;
                    }
                }

                //Check required field
                if (String.IsNullOrEmpty(sParam.ContractCode))
                {
                    //res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0007, new string[] { "ContractCode" });
                    //res.AddErrorMessage(MessageUtil.MODULE_CONTRACT,
                    //                    ScreenID.C_SCREEN_ID_CANCEL_SALE_CONTRACT,
                    //                    MessageUtil.MODULE_COMMON,
                    //                    MessageUtil.MessageList.MSG0007,
                    //                    new string[] { "lblContractCode" },
                    //                    null);
                    res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0147);

                    return(Json(res));
                }
                strContractCodeLong = comUtil.ConvertContractCode(sParam.ContractCode, CommonUtil.CONVERT_TYPE.TO_LONG);

                //RetrieveSaleContractData
                saleHandler      = ServiceContainer.GetService <ISaleContractHandler>() as ISaleContractHandler;
                strOccCode       = saleHandler.GetLastOCC(strContractCodeLong);
                tbtSaleBasicList = saleHandler.GetTbt_SaleBasic(strContractCodeLong, strOccCode, FlagType.C_FLAG_ON);

                //Check existing of sale contract data
                if (tbtSaleBasicList == null || tbtSaleBasicList.Count < 1)
                {
                    //res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0093, new string[] { sParam.ContractCode });
                    res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0124);
                    return(Json(res));
                }

                //CheckDataAuthority
                tbt_SaleBasicData        = tbtSaleBasicList[0];
                doSaleBasicDataAuthority = CommonUtil.CloneObject <tbt_SaleBasic, CTS090_doSaleBasicDataAuthority>(tbt_SaleBasicData);
                if (CommonUtil.IsNullOrEmpty(doSaleBasicDataAuthority.OperationOfficeCode) == false)
                {
                    ValidatorUtil.BuildErrorMessage(res, new object[] { doSaleBasicDataAuthority }, null, false);
                    if (res.IsError)
                    {
                        return(Json(res));
                    }
                }
                /*-------------------------*/


                //ValidateDataBusiness
                ValidateDataBusiness_CTS090(res, tbt_SaleBasicData);
                if (res.IsError)
                {
                    return(Json(res));
                }

                //sParam = new CTS090_ScreenParameter();
                sParam.CTS090_Session             = new CTS090_RegisterCancelTargetData();
                sParam.CTS090_Session.InitialData = new CTS090_InitialRegisterCancelTargetData();
                sParam.CTS090_Session.InitialData.ContractCode = strContractCodeLong;
                sParam.CTS090_Session.InitialData.OCCCode      = strOccCode;
                sParam.CTS090_Session.RegisterCancelData       = tbt_SaleBasicData;
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
                return(Json(res));
            }

            //**** Change Session ****//
            //return InitialScreenEnvironment("CTS090", new object[] { strContractCodeLong, strOccCode, tbt_SaleBasicData});
            return(InitialScreenEnvironment <CTS090_RegisterCancelTargetData>("CTS090", sParam, res));
        }
Пример #60
0
        /// <summary>
        /// Update data to database when click [Confirm] button in ‘Action button’ section
        /// </summary>
        /// <param name="doCancalReason"></param>
        /// <returns></returns>
        public ActionResult CTS090_ConfirmRegisterCancelData(CTS090_doCancelReason doCancalReason)
        {
            ObjectResultData res = new ObjectResultData();
            CTS090_RegisterCancelTargetData registerCancelData;
            List <tbt_SaleBasic>            tbt_SaleBasicList;
            ISaleContractHandler            saleHandler;
            IBillingTempHandler             billingHandler;
            List <tbt_BillingTemp>          tbt_BillingTempList;
            IQuotationHandler     guotHandler;
            doUpdateQuotationData doUpdateQuotation;

            try
            {
                //CheckSystemStatus
                if (CheckIsSuspending(res) == true)
                {
                    return(Json(res));
                }

                //Check screen permission
                if (CheckUserPermission(ScreenID.C_SCREEN_ID_CANCEL_SALE_CONTRACT, FunctionID.C_FUNC_ID_OPERATE) == false)
                {
                    res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0053);
                    return(Json(res));
                }


                //ValidateScreenBusiness
                res.MessageType = MessageModel.MESSAGE_TYPE.WARNING;
                if (doCancalReason.CancelDate > DateTime.Now.Date)
                {
                    res.AddErrorMessage(MessageUtil.MODULE_CONTRACT, MessageUtil.MessageList.MSG3154, null, new string[] { "dpCancelDate" });
                    return(Json(res));
                }

                //ValidateDataBusiness
                res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION;
                ValidateDataBusiness_CTS090(res);
                if (res.IsError)
                {
                    return(Json(res));
                }


                CTS090_ScreenParameter sParam = GetScreenObject <CTS090_ScreenParameter>();
                using (TransactionScope scope = new TransactionScope())
                {
                    /*--- RegisterCancelContract ---*/
                    saleHandler        = ServiceContainer.GetService <ISaleContractHandler>() as ISaleContractHandler;
                    registerCancelData = sParam.CTS090_Session;
                    if (registerCancelData.RegisterCancelData != null)
                    {
                        string strContractCode        = registerCancelData.RegisterCancelData.ContractCode;
                        string strOCCCode             = registerCancelData.RegisterCancelData.OCC;
                        string strQuotationTargetCode = registerCancelData.RegisterCancelData.QuotationTargetCode;
                        string strAlphabet            = registerCancelData.RegisterCancelData.Alphabet;

                        //MapSaleContractData
                        bool isUpdateQuotation = false;
                        if (registerCancelData.RegisterCancelData.ChangeType == SaleChangeType.C_SALE_CHANGE_TYPE_NEW_SALE)
                        {
                            registerCancelData.RegisterCancelData.ContractStatus = ContractStatus.C_CONTRACT_STATUS_CANCEL;
                            isUpdateQuotation = true;
                        }
                        registerCancelData.RegisterCancelData.OCC        = registerCancelData.InitialData.OCCCode;
                        registerCancelData.RegisterCancelData.ChangeType = SaleChangeType.C_SALE_CHANGE_TYPE_CANCEL;
                        registerCancelData.RegisterCancelData.SaleProcessManageStatus = SaleProcessManageStatus.C_SALE_PROCESS_STATUS_CANCEL;
                        registerCancelData.RegisterCancelData.ApproveNo1          = doCancalReason.ApproveNo1;
                        registerCancelData.RegisterCancelData.CancelReasonType    = doCancalReason.CancelReasonType;
                        registerCancelData.RegisterCancelData.CancelDate          = doCancalReason.CancelDate;
                        registerCancelData.RegisterCancelData.CancelProcessDate   = CommonUtil.dsTransData.dtOperationData.ProcessDateTime;
                        registerCancelData.RegisterCancelData.ChangeImplementDate = doCancalReason.CancelDate;

                        //Save cancel contract data
                        tbt_SaleBasicList = saleHandler.UpdateTbt_SaleBasic(registerCancelData.RegisterCancelData);

                        //Delete billing temp
                        billingHandler      = ServiceContainer.GetService <IBillingTempHandler>() as IBillingTempHandler;
                        tbt_BillingTempList = billingHandler.DeleteBillingTempByContractCodeOCC(strContractCode, strOCCCode);

                        //Lock quotation
                        guotHandler = ServiceContainer.GetService <IQuotationHandler>() as IQuotationHandler;
                        bool isLockQuotComplete = guotHandler.LockQuotation(strQuotationTargetCode, strAlphabet, LockStyle.C_LOCK_STYLE_ALL);

                        if (isUpdateQuotation)
                        {
                            //Update quotation data
                            doUpdateQuotation = new doUpdateQuotationData();
                            doUpdateQuotation.QuotationTargetCode = strQuotationTargetCode;
                            doUpdateQuotation.Alphabet            = strAlphabet;
                            doUpdateQuotation.LastUpdateDate      = DateTime.MinValue; //null;
                            doUpdateQuotation.ContractCode        = strContractCode;
                            doUpdateQuotation.ActionTypeCode      = ActionType.C_ACTION_TYPE_CANCEL;
                            int iUpdateQuotRowCount = guotHandler.UpdateQuotationData(doUpdateQuotation);
                        }

                        //Delete installation basic
                        IInstallationHandler installHandler = ServiceContainer.GetService <IInstallationHandler>() as IInstallationHandler;
                        bool blnProcessResult = installHandler.DeleteInstallationBasicData(strContractCode);

                        //Cancel book
                        IInventoryHandler inventHandler = ServiceContainer.GetService <IInventoryHandler>() as IInventoryHandler;
                        doBooking         booking       = new doBooking();
                        booking.ContractCode = registerCancelData.RegisterCancelData.ContractCode;
                        bool isCancelBookComplete = inventHandler.CancelBooking(booking);
                    }
                    /*--------------------------*/

                    scope.Complete();
                    res.ResultData = MessageUtil.GetMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0046);
                }
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }

            return(Json(res));
        }