Exemplo n.º 1
0
        public Object Any(Services.Activate request)
        {
            var command = request.ConvertTo<Activate>();

            command.UserId = this.Profile.UserId;
            return _bus.Send(command).IsCommand<Command>();
        }
Exemplo n.º 2
0
 void listen(Services.Post post)
 {
     if (post.category == Services.PostCategory.END_GAME)
     {
         sticky_ = false;
     }
 }
Exemplo n.º 3
0
 internal Gold(Services.Dto.StaticData.GoldDto goldDto)
 {
     this.BasePrice = goldDto.@base;
     this.Purchasable = goldDto.purchasable;
     this.Sell = goldDto.sell;
     this.Total = goldDto.total;
 }
Exemplo n.º 4
0
 public EggGroupsController(Services.ServerService ServerService, Services.EggGroupService Service,
     SLLog Log)
 {
     Log_ = Log;
     Service_ = Service;
     this.ServerService_ = ServerService;
 }
Exemplo n.º 5
0
 internal Info(Services.Dto.StaticData.InfoDto infoDto)
 {
     this.Attack = infoDto.attack;
     this.Defense = infoDto.defense;
     this.Difficulty = infoDto.difficulty;
     this.Magic = infoDto.magic;
 }
Exemplo n.º 6
0
 internal Passive(Services.Dto.StaticData.PassiveDto passiveDto)
 {
     this.Description = passiveDto.description;
     this.image_full = passiveDto.image.full;
     this.Name = passiveDto.name;
     this.SanitizedDescription = passiveDto.sanitizedDescription;
 }
Exemplo n.º 7
0
        public Object Post(Services.Create request)
        {
            var command = request.ConvertTo<Domain.Configuration.AccountType.Commands.Create>();
            command.DeferralMethod = DEFERRAL_METHOD.FromValue(request.DeferralMethod);

            return _bus.Send(command).IsCommand<Command>();
        }
Exemplo n.º 8
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(IDataService dataService, Services.IQaStringGeneratorService generator)
        {
            _dataService = dataService;
            _generator = generator;

            _generatedTexts = new System.Collections.ObjectModel.ObservableCollection<TextItemViewModel>();

            this.PropertyChanged += MainViewModel_PropertyChanged;

            _dataService.GetData(
                (item, error) =>
                {
                    if (error != null)
                    {
                        // Report error here
                        return;
                    }

                    _pattern = item.LastPattern;
                    _numberOfCharacters = item.LastCount;
                    _qAApproved = item.LastQa;
                    _countList = item.LastCountList;

                    _results = _generator.Generate(this.NumberOfCharacters, this.Pattern, this.QAApproved);

                    generateCountList();
                });
        }
Exemplo n.º 9
0
 public GameController(Services.ServerService ServerService,
     Services.GameService GameService, Services.PokedexService PokedexService)
 {
     this.ServerService_ = ServerService;
     this.GameService_ = GameService;
     this.PokedexService_ = PokedexService;
 }
 private static void CreateTestProject(bool useOAuthEndpoints)
 {
     V1Connector connector;
     if (useOAuthEndpoints)
     {
         connector = V1Connector.WithInstanceUrl(ConfigurationManager.AppSettings.Get("V1Url"))
             .WithUserAgentHeader("IntegrationTests", "1.0")
             .WithAccessToken(ConfigurationManager.AppSettings.Get("V1AccessToken"))
             .UseOAuthEndpoints()
             .Build();
     }
     else
     {
         connector = V1Connector.WithInstanceUrl(ConfigurationManager.AppSettings.Get("V1Url"))
             .WithUserAgentHeader("IntegrationTests", "1.0")
             .WithAccessToken(ConfigurationManager.AppSettings.Get("V1AccessToken"))
             .Build();
     }
     var services = new Services(connector);
     var assetType = services.Meta.GetAssetType("Scope");
     var nameAttribute = assetType.GetAttributeDefinition("Name");
     var projectId = services.GetOid("Scope:0");
     var newAsset = services.New(assetType, projectId);
     newAsset.SetAttributeValue(nameAttribute, TestProjectName);
     services.Save(newAsset);
     _testProjectId = newAsset.Oid.Momentless;
 }
Exemplo n.º 11
0
        public EmailerService(Logging.ILogger logger
			, Services.IConnectorService connectorService
			, Services.IAccountService accountService
			, Services.CryptoService cryptoService
			, Services.IScheduledTaskService taskService
			)
        {
            this.Logger = logger;
            this.ConnectorService = connectorService;
            this.CryptoService = cryptoService;
            this.AccountService = accountService;
            this.TaskService = taskService;

            var smtpSection = System.Configuration.ConfigurationManager.GetSection("system.net/mailSettings/smtp") as System.Net.Configuration.SmtpSection;
            if (!smtpSection.From.IsNullOrTrimmedEmpty())
            {
                m_MailFrom = new MailAddress(smtpSection.From);
            }
            else
            {
                m_MailFrom = new MailAddress(ERPStoreApplication.WebSiteSettings.Contact.EmailSender,
                               ERPStoreApplication.WebSiteSettings.Contact.EmailSenderName);
            }

            var bccEmail = ERPStoreApplication.WebSiteSettings.Contact.BCCEmail ?? ERPStoreApplication.WebSiteSettings.Contact.ContactEmail;
            m_Bcc = new MailAddressCollection();
            if (bccEmail != null)
            {
                var emailList = bccEmail.Split(';');
                foreach (var email in emailList)
                {
                    m_Bcc.Add(email.Trim());
                }
            }
        }
Exemplo n.º 12
0
        public BackgroundViewModel(Services.IBackgroundServiceFactory backgroundServiceFactory)
        {
            _backgroundService = backgroundServiceFactory.MakeBackgroundServiceFromRunner<BackgroundRunners.CounterRunner>();

            _backgroundService.StartService();
            CounterState = GetRunnerCounterState();
        }
Exemplo n.º 13
0
 /// <summary>
 /// Creates an instance of the USPS API
 /// </summary>
 /// <param name="userID">Username</param>
 /// <param name="password">Password</param>
 public USPSProvider(string userID, string password)
 {
     this._name = "USPS";
     this._userID = userID;
     this._password = password;
     this._services = Services.Express;
 }
Exemplo n.º 14
0
        public EntityOperationResult Delete(Services.tmp.EntityDelete delete)
        {
            using (var dbContext = _dbService.GetDatabaseContext(true))
            {
                if (!RunInspection(delete))
                {
                    return EntityOperationResult.FailResult(new EntityOperationError("Insufficient rights to perform this operation.", EntityOperationError.ACCESS_VIOLATION));
                }

                var ctx = new EntityOperationContext();
                this.AppyLogicBefore(delete, ctx);

                EntityOperationResult result = null;
                try
                {
                    _repository.Delete(new Entity(delete.Entity, delete.Id.Value), delete.Recursive);
                    result = EntityOperationResult.SuccessResult();
                }
                catch (RelationExistsException ree)
                {
                    result = EntityOperationResult.FailResult(new EntityOperationError(ree.Message, EntityOperationError.RELATION_EXISTS));
                }
                catch (Exception ex)
                {
                    result = EntityOperationResult.FailResult(new EntityOperationError(ex.Message));
                }

                this.AppyLogicAfter(delete, ctx, result);

                if (result.Success)
                    dbContext.Complete();

                return result;
            }
        }
Exemplo n.º 15
0
 public EmailService(Services.ServerService ServerService)
 {
     EmailAddress = ServerService.GetEmailAddress();
     EmailPassword = ServerService.GetEmailPassword();
     SMTPAddress = ServerService.GetSMTPSettings();
     SMTPPort = ServerService.GetSMTPPort();
 }
Exemplo n.º 16
0
 public ShellViewModel(Services.Settings settings, IDialogManager dialogManager)
 {
     _settings = settings;
     _projectRepository = new ProjectRepositoryViewModel(settings);
     _dialogManager = dialogManager;
     DisplayName = "Solutionizer";
 }
		protected override void OnExecute(Services.CommandContext context)
		{
			if(context.Arguments.Length < 1)
				throw new Zongsoft.Services.CommandException("Missing arguments.");

			var dictionary = this.Redis.GetDictionary(context.Arguments[0]);

			switch(context.Arguments.Length)
			{
				case 1:
					if(context.Options.Contains("all"))
					{
						context.Result = (IEnumerable<KeyValuePair<string, string>>)dictionary;
						return;
					}

					throw new Zongsoft.Services.CommandException("Missing arguments.");
				case 2:
					context.Result = dictionary[context.Arguments[1]];
					return;
			}

			var keys = new string[context.Arguments.Length - 1];
			Array.Copy(context.Arguments, 1, keys, 0, keys.Length);

			context.Result = dictionary.GetValues(keys);
		}
Exemplo n.º 18
0
        public StorageViewModel(Services.IStorageServiceFactory storageServiceFactory)
        {
            _sampleStorage = storageServiceFactory.getStorageForEntity<DB.Sample>();

            _sampleStorage.DeleteAll();

            _sampleStorage.Insert(new DB.Sample() { Name = "Granat" } );
            _sampleStorage.Insert(new DB.Sample() { Name = "Jablko" } );
            _sampleStorage.Insert(new DB.Sample() { Name = "Granat" } );
            _sampleStorage.Insert(new DB.Sample() { Name = "Hruska" } );
            _sampleStorage.Insert(new DB.Sample() { Name = "Granat" } );

            // get all items in DB
            string query1 = "SELECT * FROM {0}";

            List<DB.Sample> list1 = _sampleStorage.QueryItems(query1, new object[] { _sampleStorage.getTableName() });

            OriginalItems = new List<string>();
            foreach (DB.Sample sample in list1)
            {
                OriginalItems.Add(sample.Name);
            };

            // get items in DB with name = Granat
            string query2 = "SELECT * FROM {0} WHERE NAME = \"{1}\"";

            List <DB.Sample> list2 = _sampleStorage.QueryItems(query2, new object[] { _sampleStorage.getTableName() , "Granat" });

            FilteredItems = new List<string>();
            foreach (DB.Sample sample in list2) {
                FilteredItems.Add(sample.Name);
            };
        }
Exemplo n.º 19
0
        public ServicesManager(
            INutConfiguration configurationManager,
            Infrastructure.ConfigurationManagement.DbConfigurationSettings.Factory dbConfigurationSettingsFactory,
            IEventBus eventBus,
            IEnumerable<IReportPeriodically> pushServices,
            IEnumerable<IRemoteInvocationService> remoteInvokedServices,
            Services.IGlobalSettingsService globalSettings,
            Func<RegisteredPackagesPollingClient> packagesPollerFactory,
            Func<PollingClientCollection> pollingCollectionFactory,
            Repositories.IPackageRepository packageRepository,
            IHoardeManager hoardeManager)
        {
            _log = LogProvider.For<ServicesManager>();

            _configurationManager = configurationManager;
            _dbConfigurationSettingsFactory = dbConfigurationSettingsFactory;
            _eventBus = eventBus;
            _pushServices = pushServices;
            _remoteInvokedServices = remoteInvokedServices;
            _globalSettings = globalSettings;

            _packagesPollerFactory = packagesPollerFactory;
            _pollingCollectionFactory = pollingCollectionFactory;

            _packageRepository = packageRepository;

            _hoardeManager = hoardeManager;
        }
Exemplo n.º 20
0
 internal Passive(Services.Dto.StaticData.PassiveDto passiveDto)
 {
     this.Description = passiveDto.description;
     this.Image = new Image(passiveDto.image);
     this.Name = passiveDto.name;
     this.SanitizedDescription = passiveDto.sanitizedDescription;
 }
		protected override void OnExecute(Services.CommandContext context)
		{
			if(context.Arguments.Length < 1)
				throw new Services.CommandException("Missing arguments.");

			var length = (int)context.Options["length"];

			if(context.Arguments.Length == 1)
			{
				context.Result = this.Redis.GetQueue(context.Arguments[0]).Dequeue(length);
				return;
			}

			var result = new string[context.Arguments.Length * length];

			for(int i = 0; i < context.Arguments.Length; i++)
			{
				var queue = this.Redis.GetQueue(context.Arguments[i]);
				var items = queue.Dequeue(length);

				int j = 0;

				foreach(var item in items)
				{
					result[i * context.Arguments.Length + j++] = (string)item;
				}
			}

			context.Result = result;
		}
 public TransporterPaymentRequestController(IBusinessProcessService _paramBusinessProcessService
                                            , IBusinessProcessStateService _paramBusinessProcessStateService
                                            , IApplicationSettingService _paramApplicationSettingService
                                            , ITransporterPaymentRequestService transporterPaymentRequestService
                                            , ITransportOrderService _paramTransportOrderService
                                            , IBidWinnerService bidWinnerService
                                            , IDispatchService dispatchService
                                            , IWorkflowStatusService workflowStatusService
                                            , IUserAccountService userAccountService
                                            , Services.Procurement.ITransporterService transporterService,
                                            ITransportOrderService transportOrderService,
                                            ITransportOrderDetailService transportOrderDetailService, ICommonService commodityService
                                            , IFlowTemplateService flowTemplateService)
 {
     _BusinessProcessService = _paramBusinessProcessService;
     _BusinessProcessStateService = _paramBusinessProcessStateService;
     _ApplicationSettingService = _paramApplicationSettingService;
     _transporterPaymentRequestService = transporterPaymentRequestService;
     _TransportOrderService = _paramTransportOrderService;
     _bidWinnerService = bidWinnerService;
     _dispatchService = dispatchService;
     _workflowStatusService = workflowStatusService;
     _userAccountService = userAccountService;
     _transporterService = transporterService;
     _transportOrderService = transportOrderService;
     _transportOrderDetailService = transportOrderDetailService;
     _commodityService = commodityService;
     _flowTemplateService = flowTemplateService;
 }
Exemplo n.º 23
0
        public BaseModule(IEventBus eventBus, Services.IGlobalSettingsService globalSettingsService, string modulePath, bool verifyConfigured) : base(modulePath)
        {
            EventBus = eventBus;
            GlobalSettingsService = globalSettingsService;

            WireSetupPipeline(verifyConfigured);
        }
Exemplo n.º 24
0
        public Object Any(Services.Create request)
        {
            var command = request.ConvertTo<Create>();
            command.Operation = OPERATION.FromValue(request.Operation);

            return _bus.Send(command).IsCommand<Command>();
        }
		public void MultiValueAttribute() {
			Services subject = new Services(Meta, DataConnector);
			Query queryStories = new Query(Oid.FromToken("Story:1063", Meta));
			IAttributeDefinition ownersDef = Meta.GetAttributeDefinition("Story.Owners");
			queryStories.Selection.Add(ownersDef);
			QueryResult resultStories = subject.Retrieve(queryStories);

			Asset story = resultStories.Assets[0];
			Oid oldMember = Oid.FromToken("Member:1001", Meta);
			Oid newMember = Oid.FromToken("Member:20", Meta);
			IEnumerator owners = story.GetAttribute(ownersDef).Values.GetEnumerator();
			Assert.IsTrue(owners.MoveNext());
			Assert.AreEqual(oldMember, owners.Current);
			Assert.IsFalse(owners.MoveNext());

			story.AddAttributeValue(ownersDef, newMember);
			owners = story.GetAttribute(ownersDef).Values.GetEnumerator();
			Assert.IsTrue(owners.MoveNext());
			Assert.AreEqual(oldMember, owners.Current);
			Assert.IsTrue(owners.MoveNext());
			Assert.AreEqual(newMember, owners.Current);
			Assert.IsFalse(owners.MoveNext());

			story.RemoveAttributeValue(ownersDef, oldMember);
			owners = story.GetAttribute(ownersDef).Values.GetEnumerator();
			Assert.IsTrue(owners.MoveNext());
			Assert.AreEqual(newMember, owners.Current);
			Assert.IsFalse(owners.MoveNext());

			story.RemoveAttributeValue(ownersDef, newMember);
			owners = story.GetAttribute(ownersDef).Values.GetEnumerator();
			Assert.IsFalse(owners.MoveNext());
		}
Exemplo n.º 26
0
		public override string OpenEditorScript(Services.JavaScriptTextEditor editor, Control e) {
			string openScript = "";
			string closeScript = "";
			Services.IJavaScriptTextEditable editable = null;
			if (e is Services.IJavaScriptTextEditable) {
				editable = (Services.IJavaScriptTextEditable)e;
				e = editable.Content;
				openScript = editable.OnClientOpenEditor + ";";
				closeScript = editable.OnClientCloseEditor;
			}
			if (Web.UI.Scripts.jQuery.Register(e.Page) &&
#if DEBUG
				Web.UI.Scripts.Register(e.Page, "~/Silversite/Extensions/Silversite.CKEditor/ckeditor/ckeditor.js") &&
				// Web.Scripts.Register(e.Page, "~/Silversite/Extensions/Silversite.CKEditor/ckeditor/config.js") && 
				// Web.UI.Scripts.Register(e.Page, "~/Silversite/Extensions/Silversite.CKEditor/ckeditor/adapters/jquery.js") &&
				Web.UI.Scripts.Register(e.Page, "~/Silversite/Extensions/Silversite.CKEditor/js/Silversite.CKEditor.js")) {
#else
				Web.Scripts.Register(page, "~/Silversite/Extensions/Silversite.CKEditor/ckeditor/ckeditor.js") &&
				// Web.Scripts.Register(page, "~/Silversite/Extensions/Silversite.CKEditor/ckeditor/config.js") && 
				// Web.Scripts.Register(page, "~/Silversite/Extensions/Silversite.CKEditor/ckeditor/adapters/jquery.js") &&
				Web.Scripts.Register(page, "~/Silversite/Extensions/Silversite.CKEditor/js/Silversite.CKEditor.js")) {
#endif
				if (string.IsNullOrEmpty(e.ClientID)) throw new ArgumentException("Content must have valid ID.");

				return openScript + "Silversite.CKEditor.Open('" + e.ClientID + "', " + CallbackCommandScript(e) + ", '" + editor.ContentType + "', '" + editor.Menu.ToString() + "', " + closeScript + "');";
			}
			return string.Empty;
		}

		Html.Converter converter = null;
Exemplo n.º 27
0
        /// <summary>
        /// Stores the specified model.
        /// </summary>
        /// <param name="model">The model.</param>
        public void Store(Services.ViewModels.ConnectionStringPmo model)
        {
            var parms = new
            {
                id = model.Id,
                packageId = model.PackageId,
                name = model.Name,
                connectionString = model.ConnectionString,
                providerName = model.ProviderName,
                createdOn = DateTime.Now,
                updatedOn = DateTime.Now
            };

            if (model.Id == 0)
            {
                Execute(cn =>
                {
                    if (Get(model.PackageId, model.Name) != null) { throw new UniqueIndexException("Violation of unique index."); }
                    cn.Execute(@"INSERT INTO ConnectionStrings (PackageId, Name, ConnectionString, ProviderName, CreatedOn, UpdatedOn) VALUES (@packageId, @name, @connectionString, @providerName, @createdOn, @updatedOn);", parms);
                });
                return;
            }

            Execute(cn => cn.Execute(@"UPDATE ConnectionStrings SET PackageId = @packageId, Name = @name, ConnectionString = @connectionString, ProviderName = @providerName, UpdatedOn = @updatedOn WHERE Id = @id", parms));
        }
Exemplo n.º 28
0
        public LocationViewModel(Services.ILocationService locationService)
        {
            _locationService = locationService;

            StatusMessage = locationService.StatusMessage;
            Latitude = locationService.Latitude;
            Longitude = locationService.Longitude;
        }
Exemplo n.º 29
0
 public AddConfViewModel(INavigationService navService, Services.ServiceApi api)
 {
     this.navigationService = navService;
     this.apiService = api;
     SearchResults = new ObservableCollection<VKUser>();
     UsersInConf = new ObservableCollection<VKUser>();
     AddConfCommand = DelegateCommand.FromAsyncHandler(createConf, canCreate);
 }
Exemplo n.º 30
0
		public ConfigService(Section config, Services.ISettingsService settings)
		{
			_config = config;
			_settings = settings;

			Continents = new string[] { "africa", "asia", "central_america", "europe", "north_america", "oceania", "south_america" };
			DataTypeGroups = new string[] { "human_data", "geo", "credit_card_data", "text", "numeric", "math", "other" };
		}
 protected override void beforeEach()
 {
     theActivators = Services.CreateMockArrayFor <IFubuTransportActivator>(5);
     ClassUnderTest.ExecuteActivators();
 }
        public void SetUp()
        {
            var complexEditorConfig = new NestedContentConfiguration
            {
                ContentTypes = new[]
                {
                    new NestedContentConfiguration.ContentType {
                        Alias = "feature"
                    }
                }
            };

            ComplexTestEditor complexTestEditor           = Services.GetRequiredService <ComplexTestEditor>();
            TestEditor        testEditor                  = Services.GetRequiredService <TestEditor>();
            IDataTypeService  dataTypeService             = Services.GetRequiredService <IDataTypeService>();
            IConfigurationEditorJsonSerializer serializer = Services.GetRequiredService <IConfigurationEditorJsonSerializer>();

            var complexDataType = new DataType(complexTestEditor, serializer)
            {
                Name          = "ComplexTest",
                Configuration = complexEditorConfig
            };

            var testDataType = new DataType(testEditor, serializer)
            {
                Name = "Test",
            };

            dataTypeService.Save(complexDataType);
            dataTypeService.Save(testDataType);

            IFileService fileService = Services.GetRequiredService <IFileService>();
            Template     template    = TemplateBuilder.CreateTextPageTemplate();

            fileService.SaveTemplate(template);

            _contentType = ContentTypeBuilder.CreateTextPageContentType(ContentTypeAlias, defaultTemplateId: template.Id);

            // add complex editor
            foreach (IPropertyType pt in _contentType.PropertyTypes)
            {
                pt.DataTypeId = testDataType.Id;
            }

            _contentType.AddPropertyType(
                new PropertyType(_shortStringHelper, "complexTest", ValueStorageType.Ntext)
            {
                Alias = "complex", Name = "Complex", Description = string.Empty, Mandatory = false, SortOrder = 1, DataTypeId = complexDataType.Id
            },
                "content", "Content");

            // make them all validate with a regex rule that will not pass
            foreach (IPropertyType prop in _contentType.PropertyTypes)
            {
                prop.ValidationRegExp        = "^donotmatch$";
                prop.ValidationRegExpMessage = "Does not match!";
            }

            IContentTypeService contentTypeService = Services.GetRequiredService <IContentTypeService>();

            contentTypeService.Save(_contentType);
        }
Exemplo n.º 33
0
        public System.Xml.Linq.XElement GetReestrElement(int zapNumber, string lpuCode = null)
        {
            // проверяем поля услуги
            if (IsValidForReestr() == false)
            {
                return(null);
            }

            const string dateTimeFormat = "{0:yyyy-MM-dd}";
            //var ksg = Session.FindObject<ClinicStatGroups>(CriteriaOperator.Parse("MainDiagnose.MKB=?", this.MainDiagnose.Diagnose.MKB));
            Decimal tarif = Settings.TarifSettings.GetDnevnoyStacionarTarif(Session);

            XElement element = new XElement("SLUCH");

            // Номер записи в реестре случаев
            element.Add(new XElement("IDCASE", zapNumber));

            // Условия оказания мед. помощи
            element.Add(new XElement("USL_OK", this.UsloviyaPomoshi.Code));

            // Вид мед. помощи
            element.Add(new XElement("VIDPOM", this.VidPom.Code));

            // Форма мед. помощи
            element.Add(new XElement("FOR_POM", this.FormaPomoshi.Code));

            if (this.FromLPU != null)
            {
                // Направившее МО
                element.Add(new XElement("NPR_MO", this.FromLPU.Code));
            }

            // Направление (госпитализация)
            element.Add(new XElement("EXTR", (int)this.Hospitalizacia));

            // Код МО
            element.Add(new XElement("LPU", this.LPU.Code));

            if (!string.IsNullOrEmpty(this.LPU_1))
            {
                // код подразделения МО
                element.Add(new XElement("LPU_1", this.LPU_1));
            }

            string podr = lpuCode + (Profil != null ? (int?)Profil.Code : null) +
                          (Otdelenie != null ? Otdelenie.Code : null);

            // Код отделения
            element.Add(new XElement("PODR", podr));

            // Профиль
            element.Add(new XElement("PROFIL", this.Profil.Code));

            // Детский профиль
            element.Add(new XElement("DET", (int)this.DetProfil));

            // Номер истории болезни/талона амбулаторного пациента
            element.Add(new XElement("NHISTORY", this.Oid));

            // Даты лечения
            element.Add(new XElement("DATE_1", string.Format(dateTimeFormat, this.DateIn)));
            element.Add(new XElement("DATE_2", string.Format(dateTimeFormat, this.DateOut)));

            if (this.PreDiagnose != null)
            {
                // Первичный диагноз
                element.Add(new XElement("DS0", this.PreDiagnose.Diagnose.CODE));
            }

            // todo: Добавить основной диагноз (MainDiagnose) в HospitalCase !!!!
            //  element.Add(new XElement("DS1", this.MainDiagnose.Diagnose.CODE));

            // Сопутствующие диагнозы
            foreach (var ds2 in this.SoputsDiagnoses)
            {
                element.Add(new XElement("DS2", ds2.CODE));
            }

            // Диагнозы осложнений
            foreach (var ds3 in this.OslozhDiagnoses)
            {
                element.Add(new XElement("DS3", ds3.CODE));
            }

            // проверить карту пациента
            if (this.VesPriRozhdenii != 0)
            {
                // Вес при рождении
                element.Add(new XElement("VNOV_M", this.VesPriRozhdenii));
            }

            // Коды МЭС !!!
            //element.Add( new XElement("CODE_MES1", ksg.Number));

            // Коды МЭС сопутствующих заболеваний
            //element.Add(new XElement("CODE_MES2", ));

            // Результат обращения
            element.Add(new XElement("RSLT", this.Resultat.Code));

            // Исход заболевания
            element.Add(new XElement("ISHOD", this.Ishod.Code));

            // Специальность леч. врача
            element.Add(new XElement("PRVS", this.DoctorSpec.Code));

            // Код классификатора мед. спец-й
            element.Add(new XElement("VERS_SPEC", this.VersionSpecClassifier));

            // Код врача, закрывшего случай
            element.Add(new XElement("IDDOKT", this.Doctor.SNILS));

            /*// Особые случаи
             * element.Add(new XElement("OS_SLUCH", (int)this.OsobiySluchay));*/

            // Способ оплаты мед. помощи
            element.Add(new XElement("IDSP", this.SposobOplMedPom));

            // Кол-во единиц оплаты мед. помощи
            element.Add(new XElement("ED_COL", this.MedPomCount));

            //!!!!
            //this.Tarif = tarif * Convert.ToDecimal(ksg.KoeffZatrat);
            // Тариф
            element.Add(new XElement("TARIF", this.Tarif));

            // Сумма
            element.Add(new XElement("SUMV", this.TotalSum));

            // Тип оплаты
            element.Add(new XElement("OPLATA", (int)this.StatusOplati));

            // Данные по услугам
            int serviceCounter = 1;

            foreach (var usl in Services.OfType <MedService>())
            {
                element.Add(new XElement("USL", usl.GetReestrElement(serviceCounter++, lpuCode)));
            }

            if (!string.IsNullOrEmpty(this.Comment))
            {
                // Служебное поле
                element.Add(new XElement("COMMENTSL", this.Comment));
            }

            return(element);
        }
 public ImportRegressionTests(SqlConnection sqlConn, MetaModel MetaAPI, Services DataAPI, MigrationConfiguration Configurations)
     : base(sqlConn, MetaAPI, DataAPI, Configurations)
 {
 }
Exemplo n.º 35
0
 public AppBootstrapper(IConfiguration configuration, IServiceCollection services)
 {
     Configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
     Services      = services ?? throw new ArgumentNullException(nameof(services));
     Environment   = Services.BuildServiceProvider().GetService <IWebHostEnvironment>();
 }
Exemplo n.º 36
0
 public SuccessiveJumpSystem(Contexts contexts, Services services) : base(contexts.input)
 {
     _contexts    = contexts;
     _jumpService = services.JumpService;
 }
Exemplo n.º 37
0
        public void AddMembersIdentity_ExpectMembersUserManagerResolvable()
        {
            IMemberManager userManager = Services.GetService <IMemberManager>();

            Assert.NotNull(userManager);
        }
Exemplo n.º 38
0
 private static void LoadRepositories()
 {
     Services.AddScoped <ICupomRepository, CupomRepository>();
     Services.AddScoped <IEmpresaRepository, EmpresaRepository>();
 }
Exemplo n.º 39
0
        /// <summary>
        /// Enables the visualization of type <see cref="VisType.Heatmap2D"/>.
        /// </summary>
        public void OnHeatmapVisEnabled()
        {
            if (GetVisualizationsOfType(VisType.Heatmap2D).Count == 0)
            {
                // no visualization of this type exists in this ViewContainer
                List <int> dataSets = new List <int>();
                foreach (var kvp in Services.DataManager().DataSets)
                {
                    if (kvp.Value.IsStatic == false)
                    {
                        dataSets.Add(kvp.Key);
                    }
                }

                var properties = new VisProperties(Guid.Empty, VisType.Heatmap2D, Id, dataSets, new List <int>(Services.StudyManager().CurrentStudyConditions), new List <int>(Services.StudyManager().CurrentStudySessions));
                RequestVisWhenReady(properties);
            }
        }
Exemplo n.º 40
0
 public void releaseServices(Services services)
 {
     baseFramework.releaseServices(services);
 }
Exemplo n.º 41
0
 private static void LoadServices()
 {
     Services.AddScoped <ICupomService, CupomService>();
     Services.AddScoped <IEmpresaService, EmpresaService>();
 }
Exemplo n.º 42
0
        public static void InitMod()
        {
            Debug.Log("Begin mod init: Archaeologists");

            ModSettings settings = mod.GetSettings();

            RestrictGuildRankMagesGuild = settings.GetBool("General", "RestrictGuildRankMagesGuild");
            bool overridePacification = settings.GetBool("General", "OverridePacification");

            // Register the new faction id's
            if (RegisterFactionIds())
            {
                // Register the Guild class
                if (!GuildManager.RegisterCustomGuild(FactionFile.GuildGroups.GGroup0, typeof(ArchaeologistsGuild)))
                {
                    throw new Exception("GuildGroup GGroup0 is already in use, unable to register Archaeologists Guild.");
                }

                // Register the quest list
                if (!QuestListsManager.RegisterQuestList("Archaeologists"))
                {
                    throw new Exception("Quest list name is already in use, unable to register Archaeologists quest list.");
                }

                // Register the quest service id
                Services.RegisterGuildService(1000, GuildServices.Quests);
                // Register the custom locator service
                Services.RegisterGuildService(1001, ArchaeologistsGuild.LocatorService, "Locator Devices");
                // Register the custom locator item
                DaggerfallUnity.Instance.ItemHelper.RegisterCustomItem(LocatorItem.templateIndex, ItemGroups.MiscItems, typeof(LocatorItem));
                // Register the daedra summoning service
                Services.RegisterGuildService(1002, GuildServices.DaedraSummoning);
                // Register the custom repair service for teleport mark
                Services.RegisterGuildService(1003, ArchaeologistsGuild.RepairMarkService, "Repair Recall Mark");
                // Register the training service id
                Services.RegisterGuildService(1004, GuildServices.Training);
                // Register the indentification service id
                Services.RegisterGuildService(1005, GuildServices.Identify);
                // Register the buy potions service id
                Services.RegisterGuildService(1006, GuildServices.BuyPotions);
                // Register the make potions service id
                Services.RegisterGuildService(1007, GuildServices.MakePotions);
                // Register the make potions service id
                Services.RegisterGuildService(1008, GuildServices.MakeMagicItems);

                // Register the Teleport potion
                GameManager.Instance.EntityEffectBroker.RegisterEffectTemplate(new TeleportPotion(), true);
            }
            else
            {
                throw new Exception("Faction id's are already in use, unable to register factions for Archaeologists Guild.");
            }

            // Override default formula if enabled in settings
            if (overridePacification)
            {
                FormulaHelper.RegisterOverride(mod, "CalculateEnemyPacification", (Func <PlayerEntity, DFCareer.Skills, bool>)CalculateEnemyPacification);
            }

            // Add locator device object to scene and attach script
            GameObject go = new GameObject("LocatorDevice");

            go.AddComponent <LocatorDevice>();

            Debug.Log("Finished mod init: Archaeologists");
        }
Exemplo n.º 43
0
 /// <summary>
 /// LoadContent will be called once per game and is the place to load
 /// all of your content.
 /// </summary>
 protected override void LoadContent()
 {
     // Create a new SpriteBatch, which can be used to draw textures.
     spriteBatch = new SpriteBatch(GraphicsDevice);
     Services.AddService <SpriteBatch>(spriteBatch);
 }
Exemplo n.º 44
0
        public void RegisterComponents(Services components)
        {
            var service = new MathInputService();

            components.Register <IMathInputService>(service);
        }
Exemplo n.º 45
0
 public ContactTests(ITestOutputHelper output, DynamicsWebAppFixture fixture) : base(output, fixture)
 {
     contactRepository = Services.GetRequiredService <IContactRepository>();
 }
Exemplo n.º 46
0
        /// <summary>
        /// Enables the visualization of type <see cref="VisType.Media2D"/>.
        /// </summary>
        public void OnMediaVisEnabled()
        {
            if (GetVisualizationsOfType(VisType.Media2D).Count == 0)
            {
                // no visualization of this type exists in this ViewContainer
                List <int> dataSets = new List <int>();
                for (int i = 0; i < Services.DataManager().DataSets.Count; i++)
                {
                    if (Services.DataManager().DataSets[i].ObjectType == ObjectType.TOUCH)
                    {
                        dataSets.Add(i);
                    }
                }

                var properties = new VisProperties(Guid.Empty, VisType.Media2D, Id, dataSets, new List <int>(Services.StudyManager().CurrentStudyConditions), new List <int>(Services.StudyManager().CurrentStudySessions));
                RequestVisWhenReady(properties);
            }
        }
Exemplo n.º 47
0
        public BarLinkComponentTest()
        {
            var testServices = new TestServiceProvider(Services.AddSingleton <NavigationManager, TestNavigationManager>());

            BlazoriseConfig.AddBootstrapProviders(testServices);
        }
Exemplo n.º 48
0
        /// <summary>
        /// Enables the visualization of type <see cref="VisType.Scatterplot2D"/>.
        /// </summary>
        public void OnScatterplotVisEnabled()
        {
            if (GetVisualizationsOfType(VisType.Scatterplot2D).Count == 0)
            {
                // no visualization of this type exists in this ViewContainer
                List <int> dataSets = new List <int>();
                for (int i = 0; i < Services.DataManager().DataSets.Count; i++)
                {
                    if (Services.DataManager().DataSets[i].ObjectType == ObjectType.TOUCH)
                    {
                        dataSets.Add(i);
                    }
                }

                if (dataSets.Count == 0)
                {
                    foreach (var kvp in Services.DataManager().DataSets)
                    {
                        if (kvp.Value.IsStatic == false)
                        {
                            dataSets.Add(kvp.Key);
                        }
                    }
                }

                var properties = new VisProperties(Guid.Empty, VisType.Scatterplot2D, Id, dataSets, new List <int>(Services.StudyManager().CurrentStudyConditions), new List <int>(Services.StudyManager().CurrentStudySessions));
                RequestVisWhenReady(properties);
            }
        }
Exemplo n.º 49
0
 public ExecuteTest(ITestOutputHelper output, TestStartupFixture fixture)
 {
     Output   = output;
     Services = fixture.Services;
     Dapper   = Services.GetService <IDapper>();
 }
        public void LoadConfig_Resuses_Existing_Service_Uris()
        {
            var services = new Services {
                N1QL = 8093, Fts = 8094, Analytics = 8095
            };
            var nodes = new List <Node> {
                new Node {
                    Hostname = "127.0.0.1"
                }
            };
            var nodeExts = new List <NodeExt> {
                new NodeExt {
                    Hostname = "127.0.0.1", Services = services
                }
            };

            var mockBucketConfig = new Mock <IBucketConfig>();

            mockBucketConfig.Setup(x => x.Name).Returns("default");
            mockBucketConfig.Setup(x => x.Nodes).Returns(nodes.ToArray);
            mockBucketConfig.Setup(x => x.NodesExt).Returns(nodeExts.ToArray);
            mockBucketConfig.Setup(x => x.VBucketServerMap).Returns(new VBucketServerMap());

            var mockConnectionPool = new Mock <IConnectionPool>();
            var mockIoService      = new Mock <IIOService>();

            mockIoService.Setup(x => x.ConnectionPool).Returns(mockConnectionPool.Object);
            mockIoService.Setup(x => x.SupportsEnhancedDurability).Returns(true);
            var mockSasl = new Mock <ISaslMechanism>();

            var clientConfig = new ClientConfiguration();
            var context      = new CouchbaseConfigContext(
                mockBucketConfig.Object,
                clientConfig,
                p => mockIoService.Object,
                (a, b) => mockConnectionPool.Object,
                (a, b, c, d) => mockSasl.Object,
                new DefaultTranscoder(),
                null, null);

            // load first config with single node
            context.LoadConfig(mockBucketConfig.Object);

            Assert.AreEqual(1, context.QueryUris.Count);
            Assert.IsTrue(context.QueryUris.Contains(new Uri("http://127.0.0.1:8093/query")));

            Assert.AreEqual(1, context.SearchUris.Count);
            Assert.IsTrue(context.SearchUris.Contains(new Uri("http://127.0.0.1:8094/pools")));

            Assert.AreEqual(1, context.AnalyticsUris.Count);
            Assert.IsTrue(context.AnalyticsUris.Contains(new Uri("http://127.0.0.1:8095/analytics/service")));

            // add extra node to config, keeping existing
            nodes.Add(new Node {
                Hostname = "127.0.0.2"
            });
            nodeExts.Add(new NodeExt {
                Hostname = "127.0.0.2", Services = services
            });

            // create new bucket config, with extra node
            mockBucketConfig.Setup(x => x.Nodes).Returns(nodes.ToArray);

            // need to force because internal bucketconfig ref will be pointing to mock
            context.LoadConfig(mockBucketConfig.Object, true);

            Assert.AreEqual(2, context.QueryUris.Count);
            Assert.IsTrue(context.QueryUris.Contains(new Uri("http://127.0.0.1:8093/query")));
            Assert.IsTrue(context.QueryUris.Contains(new Uri("http://127.0.0.2:8093/query")));

            Assert.AreEqual(2, context.SearchUris.Count);
            Assert.IsTrue(context.SearchUris.Contains(new Uri("http://127.0.0.1:8094/pools")));
            Assert.IsTrue(context.SearchUris.Contains(new Uri("http://127.0.0.2:8094/pools")));

            Assert.AreEqual(2, context.AnalyticsUris.Count);
            Assert.IsTrue(context.AnalyticsUris.Contains(new Uri("http://127.0.0.1:8095/analytics/service")));
            Assert.IsTrue(context.AnalyticsUris.Contains(new Uri("http://127.0.0.2:8095/analytics/service")));
        }
Exemplo n.º 51
0
        protected override void beforeEach()
        {
            var definition = PollingJobDefinition.For <APollingJob, PollingJobSettings>(x => x.Polling);

            Services.Inject(definition);
        }
Exemplo n.º 52
0
        private void AttachToDocument(uint docCookie, string moniker)
        {
            _foregroundThreadAffinitization.AssertIsForeground();

            var vsTextBuffer = (IVsTextBuffer)_runningDocumentTable.GetDocumentData(docCookie);
            var textBuffer   = _editorAdaptersFactoryService.GetDocumentBuffer(vsTextBuffer);

            if (_fileTrackingMetadataAsSourceService.TryAddDocumentToWorkspace(moniker, textBuffer))
            {
                // We already added it, so we will keep it excluded from the misc files workspace
                return;
            }

            // This should always succeed since we only got here if we already confirmed the moniker is acceptable
            var languageInformation = TryGetLanguageInformation(moniker);

            Contract.ThrowIfNull(languageInformation);

            var languageServices      = Services.GetLanguageServices(languageInformation.LanguageName);
            var compilationOptionsOpt = languageServices.GetService <ICompilationFactoryService>()?.GetDefaultCompilationOptions();
            var parseOptionsOpt       = languageServices.GetService <ISyntaxTreeFactoryService>()?.GetDefaultParseOptions();

            if (parseOptionsOpt != null &&
                compilationOptionsOpt != null &&
                PathUtilities.GetExtension(moniker) == languageInformation.ScriptExtension)
            {
                parseOptionsOpt = parseOptionsOpt.WithKind(SourceCodeKind.Script);

                var metadataService          = Services.GetService <IMetadataService>();
                var scriptEnvironmentService = Services.GetService <IScriptEnvironmentService>();

                // Misc files workspace always provides the service:
                Contract.ThrowIfNull(scriptEnvironmentService);

                var baseDirectory = PathUtilities.GetDirectoryName(moniker);

                // TODO (https://github.com/dotnet/roslyn/issues/5325, https://github.com/dotnet/roslyn/issues/13886):
                // - Need to have a way to specify these somewhere in VS options.
                // - Use RuntimeMetadataReferenceResolver like in InteractiveEvaluator.CreateMetadataReferenceResolver
                // - Add default namespace imports, default metadata references to match csi.rsp
                // - Add default script globals available in 'csi goo.csx' environment: CommandLineScriptGlobals

                var referenceResolver = new WorkspaceMetadataFileReferenceResolver(
                    metadataService,
                    new RelativePathResolver(scriptEnvironmentService.MetadataReferenceSearchPaths, baseDirectory));

                compilationOptionsOpt = compilationOptionsOpt.
                                        WithMetadataReferenceResolver(referenceResolver).
                                        WithSourceReferenceResolver(new SourceFileResolver(scriptEnvironmentService.SourceReferenceSearchPaths, baseDirectory));
            }

            // First, create the project
            var hostProject = new HostProject(this, CurrentSolution.Id, languageInformation.LanguageName, parseOptionsOpt, compilationOptionsOpt, _metadataReferences);

            // Now try to find the document. We accept any text buffer, since we've already verified it's an appropriate file in ShouldIncludeFile.
            var document = _documentProvider.TryGetDocumentForFile(
                hostProject,
                moniker,
                parseOptionsOpt?.Kind ?? SourceCodeKind.Regular,
                getFolderNames: _ => SpecializedCollections.EmptyReadOnlyList <string>(),
                canUseTextBuffer: _ => true);

            // If the buffer has not yet been initialized, we won't get a document.
            if (document == null)
            {
                return;
            }

            // Since we have a document, we can do the rest of the project setup.
            _hostProjects.Add(hostProject.Id, hostProject);
            OnProjectAdded(hostProject.CreateProjectInfoForCurrentState());

            OnDocumentAdded(document.GetInitialState());
            hostProject.Document = document;

            // Notify the document provider, so it knows the document is now open and a part of
            // the project
            _documentProvider.NotifyDocumentRegisteredToProjectAndStartToRaiseEvents(document);

            Contract.ThrowIfFalse(document.IsOpen);

            var buffer = document.GetOpenTextBuffer();

            OnDocumentOpened(document.Id, document.GetOpenTextContainer());

            _docCookiesToHostProject.Add(docCookie, hostProject);
        }
Exemplo n.º 53
0
 public void should_log_the_combined_result()
 {
     Services.RecordedLog().DebugMessages.OfType <AuthorizationResult>().Single().Rights.ShouldEqual(_answer);
 }
Exemplo n.º 54
0
 public void ShowContextMenu(Point point)
 => Services.ShowContextMenu(ConnectionManagerCommandIds.ContextMenu, (int)point.X, (int)point.Y);
Exemplo n.º 55
0
 public EnsureServerSystem(Contexts contexts, Services services)
 {
     _context = contexts.game;
     _server  = services.ServerSystem;
 }
Exemplo n.º 56
0
        public void should_log_the_result_of_each_policy()
        {
            var results = Services.RecordedLog().DebugMessages.OfType <AuthorizationPolicyResult>();

            results.Select(x => x.Rights.Name).ShouldHaveTheSameElementsAs("Allow", "None", "None");
        }
Exemplo n.º 57
0
        protected override void InitializeCore()
        {
            base.InitializeCore();

            shadowMapRenderer = Context.RenderSystem.RenderFeatures.OfType <MeshRenderFeature>().FirstOrDefault()?.RenderFeatures.OfType <ForwardLightingRenderFeature>().FirstOrDefault()?.ShadowMapRenderer;

            if (MSAALevel != MultisampleCount.None)
            {
                actualMultisampleCount = (MultisampleCount)Math.Min((int)MSAALevel, (int)GraphicsDevice.Features[PixelFormat.R16G16B16A16_Float].MultisampleCountMax);
                actualMultisampleCount = (MultisampleCount)Math.Min((int)actualMultisampleCount, (int)GraphicsDevice.Features[DepthBufferFormat].MultisampleCountMax);

                // Note: we cannot support MSAA on DX10 now
                if (GraphicsDevice.Features.HasMultisampleDepthAsSRV == false && // TODO: Try enabling MSAA on DX9!
                    GraphicsDevice.Platform != GraphicsPlatform.OpenGL &&
                    GraphicsDevice.Platform != GraphicsPlatform.OpenGLES)
                {
                    // OpenGL has MSAA support on every version.
                    // OpenGL ES has MSAA support starting from version 3.0.
                    // Direct3D has MSAA support starting from version 11 because it requires multisample depth buffers as shader resource views.
                    // Therefore we force-disable MSAA on any platform that doesn't support MSAA.

                    actualMultisampleCount = MultisampleCount.None;
                }

                if (actualMultisampleCount != MSAALevel)
                {
                    logger.Warning("Multisample count of " + (int)MSAALevel + " samples not supported. Falling back to highest supported sample count of " + (int)actualMultisampleCount + " samples.");
                }

                if (Platform.Type == PlatformType.iOS)
                {
                    // MSAA is not supported on iOS currently because OpenTK doesn't expose "GL.BlitFramebuffer()" on iOS for some reason.
                    actualMultisampleCount = MultisampleCount.None;
                }
            }

            var camera = Context.GetCurrentCamera();

            vrSystem = Services.GetService <VRDeviceSystem>();
            if (vrSystem != null)
            {
                if (VRSettings.Enabled)
                {
                    var requiredDescs = VRSettings.RequiredApis.ToArray();
                    vrSystem.PreferredApis = requiredDescs.Select(x => x.Api).Distinct().ToArray();

                    // remove VR API duplicates and keep first desired config only
                    var preferredScalings = new Dictionary <VRApi, float>();
                    foreach (var desc in requiredDescs)
                    {
                        if (!preferredScalings.ContainsKey(desc.Api))
                        {
                            preferredScalings[desc.Api] = desc.ResolutionScale;
                        }
                    }
                    vrSystem.PreferredScalings = preferredScalings;

                    vrSystem.RequireMirror = VRSettings.CopyMirror;
                    vrSystem.MirrorWidth   = GraphicsDevice.Presenter.BackBuffer.Width;
                    vrSystem.MirrorHeight  = GraphicsDevice.Presenter.BackBuffer.Height;

                    vrSystem.Enabled = true; //careful this will trigger the whole chain of initialization!
                    vrSystem.Visible = true;

                    VRSettings.VRDevice = vrSystem.Device;

                    vrSystem.PreviousUseCustomProjectionMatrix = camera.UseCustomProjectionMatrix;
                    vrSystem.PreviousUseCustomViewMatrix       = camera.UseCustomViewMatrix;
                    vrSystem.PreviousCameraProjection          = camera.ProjectionMatrix;

                    if (VRSettings.VRDevice.SupportsOverlays)
                    {
                        foreach (var overlay in VRSettings.Overlays)
                        {
                            if (overlay != null && overlay.Texture != null)
                            {
                                overlay.Overlay = VRSettings.VRDevice.CreateOverlay(overlay.Texture.Width, overlay.Texture.Height, overlay.Texture.MipLevels, (int)overlay.Texture.MultisampleCount);
                            }
                        }
                    }
                }
                else
                {
                    vrSystem.Enabled = false;
                    vrSystem.Visible = false;

                    VRSettings.VRDevice = null;

                    if (vrSystem.Device != null) //we had a device before so we know we need to restore the camera
                    {
                        camera.UseCustomViewMatrix       = vrSystem.PreviousUseCustomViewMatrix;
                        camera.UseCustomProjectionMatrix = vrSystem.PreviousUseCustomProjectionMatrix;
                        camera.ProjectionMatrix          = vrSystem.PreviousCameraProjection;
                    }
                }
            }
        }
Exemplo n.º 58
0
        protected override async Task LoadContent()
        {
            await base.LoadContent();

            SceneSystem.GraphicsCompositor = Content.Load <GraphicsCompositor>("GraphicsCompositor");

            StopOnFrameCount = -1;

            Scene = new Scene();

            UIRoot = new Entity("Root entity of camera UI")
            {
                new UIComponent()
            };
            UIComponent.IsFullScreen      = true;
            UIComponent.Resolution        = new Vector3(1000, 500, 500);
            UIComponent.ResolutionStretch = ResolutionStretch.FixedWidthFixedHeight;
            Scene.Entities.Add(UIRoot);

            UI = Services.GetService <UISystem>();
            if (UI == null)
            {
                UI = new UISystem(Services);
                Services.AddService(UI);
                GameSystems.Add(UI);
            }

            Camera = new Entity("Scene camera")
            {
                new CameraComponent {
                    Slot = SceneSystem.GraphicsCompositor.Cameras[0].ToSlotId()
                }
            };
            Camera.Transform.Position = new Vector3(0, 0, 1000);
            Scene.Entities.Add(Camera);

            // Default styles
            // Note: this is temporary and should be replaced with default template of UI elements
            textBlockTextColor = Color.LightGray;

            scrollingTextTextColor = Color.LightGray;

            var buttonPressedTexture    = TextureExtensions.FromFileData(GraphicsDevice, ElementTestDesigns.ButtonPressed);
            var buttonNotPressedTexture = TextureExtensions.FromFileData(GraphicsDevice, ElementTestDesigns.ButtonNotPressed);
            var buttonOverredTexture    = TextureExtensions.FromFileData(GraphicsDevice, ElementTestDesigns.ButtonOverred);

            buttonPressedImage = (SpriteFromTexture) new Sprite("Test button pressed design", buttonPressedTexture)
            {
                Borders = 8 * Vector4.One
            };
            buttonNotPressedImage = (SpriteFromTexture) new Sprite("Test button not pressed design", buttonNotPressedTexture)
            {
                Borders = 8 * Vector4.One
            };
            buttonMouseOverImage = (SpriteFromTexture) new Sprite("Test button overred design", buttonOverredTexture)
            {
                Borders = 8 * Vector4.One
            };

            var editActiveTexture   = TextureExtensions.FromFileData(GraphicsDevice, ElementTestDesigns.EditTextActive);
            var editInactiveTexture = TextureExtensions.FromFileData(GraphicsDevice, ElementTestDesigns.EditTextInactive);
            var editOverredTexture  = TextureExtensions.FromFileData(GraphicsDevice, ElementTestDesigns.EditTextOverred);

            editTextTextColor      = Color.LightGray;
            editTextSelectionColor = Color.FromAbgr(0x623574FF);
            editTextCaretColor     = Color.FromAbgr(0xF0F0F0FF);
            editTextActiveImage    = (SpriteFromTexture) new Sprite("Test edit active design", editActiveTexture)
            {
                Borders = 12 * Vector4.One
            };
            editTextInactiveImage = (SpriteFromTexture) new Sprite("Test edit inactive design", editInactiveTexture)
            {
                Borders = 12 * Vector4.One
            };
            editTextMouseOverImage = (SpriteFromTexture) new Sprite("Test edit overred design", editOverredTexture)
            {
                Borders = 12 * Vector4.One
            };

            var toggleButtonChecked       = TextureExtensions.FromFileData(GraphicsDevice, ElementTestDesigns.ToggleButtonChecked);
            var toggleButtonUnchecked     = TextureExtensions.FromFileData(GraphicsDevice, ElementTestDesigns.ToggleButtonUnchecked);
            var toggleButtonIndeterminate = TextureExtensions.FromFileData(GraphicsDevice, ElementTestDesigns.ToggleButtonIndeterminate);

            toggleButtonCheckedImage = (SpriteFromTexture) new Sprite("Test toggle button checked design", toggleButtonChecked)
            {
                Borders = 8 * Vector4.One
            };
            toggleButtonUncheckedImage = (SpriteFromTexture) new Sprite("Test toggle button unchecked design", toggleButtonUnchecked)
            {
                Borders = 8 * Vector4.One
            };
            toggleButtonIndeterminateImage = (SpriteFromTexture) new Sprite("Test toggle button indeterminate design", toggleButtonIndeterminate)
            {
                Borders = 8 * Vector4.One
            };

            var designsTexture = TextureExtensions.FromFileData(GraphicsDevice, DefaultDesigns.Designs);

            sliderTrackBackgroundImage = (SpriteFromTexture) new Sprite("Default slider track background design", designsTexture)
            {
                Borders = 14 * Vector4.One, Region = new RectangleF(207, 3, 32, 32)
            };
            sliderTrackForegroundImage = (SpriteFromTexture) new Sprite("Default slider track foreground design", designsTexture)
            {
                Borders = 0 * Vector4.One, Region = new RectangleF(3, 37, 32, 32)
            };
            sliderThumbImage = (SpriteFromTexture) new Sprite("Default slider thumb design", designsTexture)
            {
                Borders = 4 * Vector4.One, Region = new RectangleF(37, 37, 16, 32)
            };
            sliderMouseOverThumbImage = (SpriteFromTexture) new Sprite("Default slider thumb overred design", designsTexture)
            {
                Borders = 4 * Vector4.One, Region = new RectangleF(71, 37, 16, 32)
            };
            sliderTickImage = (SpriteFromTexture) new Sprite("Default slider track foreground design", designsTexture)
            {
                Region = new RectangleF(245, 3, 3, 6)
            };
            sliderTickOffset           = 13f;
            sliderTrackStartingOffsets = new Vector2(3);

            Window.IsMouseVisible = true;

            SceneSystem.SceneInstance = new SceneInstance(Services, Scene);
        }
Exemplo n.º 59
0
        private void SetDefaultValues()
        {
            // определяем текущего пользователя
            var createdBy = SecuritySystem.CurrentUser as Doctor;

            if (createdBy != null)
            {
                // находим доктора с таким же Логином
                Doctor = Session.FindObject <Doctor>(CriteriaOperator.Parse("UserName=?", createdBy.UserName));
            }

            string MOCode = Settings.MOSettings.GetCurrentMOCode(Session);

            this.LPU   = Session.FindObject <MedOrg>(CriteriaOperator.Parse("Code=?", MOCode));
            this.LPU_1 = MOCode;

            // пока используем ГУИД идентификатор объекта
            this.NHistory = this.Oid.ToString();

            /*
             * Code = 29 - "За посещение в поликлинике"
             * Code = 30 - "За обращение (законченный случай) в поликлинике"
             */
            /*var sposobCode = (this.cel == CelPosescheniya.ProfOsmotr) ? 29 : 30;
             * this.SposobOplMedPom = Session.FindObject<Dictionaries.SposobOplatiMedPom>(CriteriaOperator.Parse("Code=?", sposobCode));*/

            /*
             * Code = 1 - "Стационаро"
             * Code = 2 - "В дневном стационаре"
             * Code = 3 - "Амбулаторно"
             * Code = 4 - "Вне медицинской организации"
             */
            this.UsloviyaPomoshi = Session.FindObject <Dictionaries.VidUsloviyOkazMedPomoshi>(CriteriaOperator.Parse("Code=?", 1));

            /*
             * Code = "1" - "Экстренная"
             * Code = "2" - "Неотложная"
             * Code = "3" - "Плановая"
             */
            this.FormaPomoshi = Session.FindObject <Dictionaries.FormaMedPomoshi>(CriteriaOperator.Parse("Code=?", 3));

            if (Pacient != null)
            {
                this.DetProfil = Pacient.GetAge() >= 18 ? PriznakDetProfila.No : PriznakDetProfila.Yes;

                // если в качестве пациента указан мать, то указывается вес. в посещении не используется (уточнить)
                //if (false)
                //    VesPriRozhdenii = 0;
            }

            if (this.Doctor != null)
            {
                this.DoctorSpec = Doctor.SpecialityTree;

                this.Otdelenie = this.Doctor.Otdelenie;

                if (DoctorSpec != null)
                {
                    this.Profil = DoctorSpec.MedProfil;

                    /*
                     * Первичная мед.-санитарная помощь (код 1) проставляется для терапевтов (код 27), педиаторов (код 22), врачей сем. практики (код 16)
                     */
                    var vidPomoshiCode = 1;
                    if (DoctorSpec.Code == "16" || DoctorSpec.Code == "22" || DoctorSpec.Code == "27")
                    {
                        vidPomoshiCode = 1;
                    }
                    else
                    {
                        // другие значения
                    }
                    this.VidPom = Session.FindObject <Dictionaries.VidMedPomoshi>(CriteriaOperator.Parse("Code=?", vidPomoshiCode));
                }
            }

            // текущая версия классификатора специальностей.
            this.VersionSpecClassifier = "V015";

            this.StatusOplati = Oplata.NetResheniya;

            this.Hospitalizacia = Napravlenie.Planovaya;

            // Проверяем, что услуга по умолчанию создана, если нет - создаем
            if (Services.Count == 0)
            {
                Services.Add(new MedService(Session)
                {
                    IsMainService = true, AutoOpen = false
                });
            }

            // связываем данные с аггрегированным свойством, чтобы иметь возможность добавлять поля услуги во View случая
            Service = Services[0];
        }
Exemplo n.º 60
0
        protected void Page_Load(object sender, EventArgs e)
        {
            RequestItems    oRequestItem    = new RequestItems(intProfile, dsn);
            RequestFields   oRequestField   = new RequestFields(intProfile, dsn);
            ServiceRequests oServiceRequest = new ServiceRequests(intProfile, dsn);
            Services        oService        = new Services(intProfile, dsn);
            ServiceDetails  oServiceDetail  = new ServiceDetails(intProfile, dsn);
            int             intRequest      = Int32.Parse(Request.QueryString["rid"]);
            string          strStatus       = oServiceRequest.Get(intRequest, "checkout");
            DataSet         dsItems         = oRequestItem.GetForms(intRequest);
            int             intItem         = 0;
            int             intService      = 0;
            int             intNumber       = 0;

            if (dsItems.Tables[0].Rows.Count > 0)
            {
                bool boolBreak = false;
                foreach (DataRow drItem in dsItems.Tables[0].Rows)
                {
                    if (boolBreak == true)
                    {
                        break;
                    }
                    if (drItem["done"].ToString() == "0")
                    {
                        intItem    = Int32.Parse(drItem["itemid"].ToString());
                        intService = Int32.Parse(drItem["serviceid"].ToString());
                        intNumber  = Int32.Parse(drItem["number"].ToString());
                        boolBreak  = true;
                    }
                    if (intItem > 0 && (strStatus == "1" || strStatus == "2"))
                    {
                        bool   boolSuccess = true;
                        string strResult   = oService.GetName(intService) + " Completed";
                        string strError    = oService.GetName(intService) + " Error";
                        // ********* BEGIN PROCESSING **************
                        Requests  oRequest  = new Requests(intProfile, dsn);
                        Functions oFunction = new Functions(intProfile, dsn, intEnvironment);
                        Variables oVariable = new Variables(intEnvironment);
                        Users     oUser     = new Users(intProfile, dsn);
                        Pages     oPage     = new Pages(intProfile, dsn);
                        if (oRequest.Get(intRequest, "description") == "")
                        {
                            Customized oCustomized = new Customized(intProfile, dsn);
                            DataSet    dsStatement = oCustomized.GetIIS(intRequest, intItem, intNumber);
                            if (dsStatement.Tables[0].Rows.Count > 0)
                            {
                                oRequest.UpdateDescription(intRequest, dsStatement.Tables[0].Rows[0]["statement"].ToString());
                            }
                        }
                        int     intDevices  = 0;
                        double  dblQuantity = 0.00;
                        DataSet ds          = oService.GetSelected(intRequest, intService);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            dblQuantity = double.Parse(ds.Tables[0].Rows[0]["quantity"].ToString());
                            intDevices  = Int32.Parse(ds.Tables[0].Rows[0]["quantity"].ToString());
                        }
                        double dblHours    = oServiceDetail.GetHours(intService, dblQuantity);
                        int    intResource = oServiceRequest.AddRequest(intRequest, intItem, intService, intDevices, dblHours, 2, intNumber, dsnServiceEditor);
                        if (oService.Get(intService, "typeid") == "3")
                        {
                        }
                        else if (oService.Get(intService, "typeid") == "2")
                        {
                        }
                        else
                        {
                            if (oServiceRequest.NotifyApproval(intResource, intResourceRequestApprove, intEnvironment, "", dsnServiceEditor) == false)
                            {
                                oServiceRequest.NotifyTeamLead(intItem, intResource, intAssignPage, intViewPage, intEnvironment, "", dsnServiceEditor, dsnAsset, dsnIP, 0);
                            }
                        }
                        // ******** END PROCESSING **************
                        if (oService.Get(intService, "automate") == "1" && boolSuccess == true)
                        {
                            strDone += "<p><span class=\"biggerbold\"><img src=\"/images/bigCheck.gif\" border=\"0\" align=\"absmiddle\"/> " + strResult + "</span></p>";
                        }
                        else
                        {
                            if (boolSuccess == false)
                            {
                                strDone += "<p><span class=\"biggerbold\"><img src=\"/images/bigError.gif\" border=\"0\" align=\"absmiddle\"/> " + strError + "</span></p>";
                            }
                            else
                            {
                                strDone += "<p><span class=\"biggerbold\"><img src=\"/images/bigCheck.gif\" border=\"0\" align=\"absmiddle\"/> " + oService.GetName(intService) + " Submitted</span></p>";
                            }
                        }
                        oRequestItem.UpdateFormDone(intRequest, intItem, intNumber, 1);
                    }
                }
            }
        }