Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CreatePropertyDefinitionRequest" /> class.
        /// </summary>
        /// <param name="domain">The domain that the property exists in. The available values are: NotDefined, Transaction, Portfolio, Holding, ReferenceHolding, TransactionConfiguration, Instrument, CutLabelDefinition, Analytic, PortfolioGroup, Person, AccessMetadata, Order, UnitResult, MarketData, ConfigurationRecipe, Allocation, Calendar, LegalEntity (required).</param>
        /// <param name="scope">The scope that the property exists in. (required).</param>
        /// <param name="code">The code of the property. Together with the domain and scope this uniquely identifies the property. (required).</param>
        /// <param name="valueRequired">Whether or not a value is always required for this property..</param>
        /// <param name="displayName">The display name of the property. (required).</param>
        /// <param name="dataTypeId">dataTypeId (required).</param>
        /// <param name="lifeTime">Describes how the property&#39;s values can change over time. The available values are: Perpetual, TimeVariant.</param>
        /// <param name="constraintStyle">Describes the uniqueness and cardinality of the property for entity objects under the property domain specified in Key. Defaults to \&quot;Property\&quot; if not specified. Valid values for this field are: Property, Collection or Identifier..</param>
        /// <param name="propertyDescription">Describes the property.</param>
        public CreatePropertyDefinitionRequest(DomainEnum domain = default(DomainEnum), string scope = default(string), string code = default(string), bool?valueRequired = default(bool?), string displayName = default(string), ResourceId dataTypeId = default(ResourceId), LifeTimeEnum?lifeTime = default(LifeTimeEnum?), string constraintStyle = default(string), string propertyDescription = default(string))
        {
            // to ensure "domain" is required (not null)
            if (domain == null)
            {
                throw new InvalidDataException("domain is a required property for CreatePropertyDefinitionRequest and cannot be null");
            }
            else
            {
                this.Domain = domain;
            }

            // to ensure "scope" is required (not null)
            if (scope == null)
            {
                throw new InvalidDataException("scope is a required property for CreatePropertyDefinitionRequest and cannot be null");
            }
            else
            {
                this.Scope = scope;
            }

            // to ensure "code" is required (not null)
            if (code == null)
            {
                throw new InvalidDataException("code is a required property for CreatePropertyDefinitionRequest and cannot be null");
            }
            else
            {
                this.Code = code;
            }

            // to ensure "displayName" is required (not null)
            if (displayName == null)
            {
                throw new InvalidDataException("displayName is a required property for CreatePropertyDefinitionRequest and cannot be null");
            }
            else
            {
                this.DisplayName = displayName;
            }

            // to ensure "dataTypeId" is required (not null)
            if (dataTypeId == null)
            {
                throw new InvalidDataException("dataTypeId is a required property for CreatePropertyDefinitionRequest and cannot be null");
            }
            else
            {
                this.DataTypeId = dataTypeId;
            }

            this.ConstraintStyle     = constraintStyle;
            this.PropertyDescription = propertyDescription;
            this.ValueRequired       = valueRequired;
            this.LifeTime            = lifeTime;
            this.ConstraintStyle     = constraintStyle;
            this.PropertyDescription = propertyDescription;
        }
Пример #2
0
        protected void RaiseMrnStatusEvent(DateTime timestamp, DomainEnum domain, StatusMessage status)
        {
            var statusCallback = new MrnStatusMsgEventArgs()
            {
                Domain = domain, Status = status, TimeStamp = timestamp
            };

            OnStatus(statusCallback);
        }
        public async Task SendCloseMessage(int streamId, DomainEnum domain = DomainEnum.MarketPrice)
        {
            var closeMsg = new CloseMessage {
                ID = streamId, Domain = domain, MsgType = MessageTypeEnum.Close
            };

            Console.WriteLine(closeMsg.ToJson());
            await ClientWebSocketUtils.SendTextMessage(_websocket.WebSocket, closeMsg.ToJson());
        }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CreateDerivedPropertyDefinitionRequest" /> class.
        /// </summary>
        /// <param name="domain">The domain that the property exists in. The available values are: NotDefined, Transaction, Portfolio, Holding, ReferenceHolding, TransactionConfiguration, Instrument, CutLabelDefinition, Analytic, PortfolioGroup, Person, AccessMetadata, Order, UnitResult, MarketData, ConfigurationRecipe, Allocation, Calendar, LegalEntity (required).</param>
        /// <param name="scope">The scope that the property exists in. (required).</param>
        /// <param name="code">The code of the property. Together with the domain and scope this uniquely identifies the property. (required).</param>
        /// <param name="displayName">The display name of the property. (required).</param>
        /// <param name="dataTypeId">dataTypeId (required).</param>
        /// <param name="propertyDescription">Describes the property.</param>
        /// <param name="derivationFormula">The rule that defines how data is composed for a derived property..</param>
        public CreateDerivedPropertyDefinitionRequest(DomainEnum domain = default(DomainEnum), string scope = default(string), string code = default(string), string displayName = default(string), ResourceId dataTypeId = default(ResourceId), string propertyDescription = default(string), string derivationFormula = default(string))
        {
            // to ensure "domain" is required (not null)
            if (domain == null)
            {
                throw new InvalidDataException("domain is a required property for CreateDerivedPropertyDefinitionRequest and cannot be null");
            }
            else
            {
                this.Domain = domain;
            }

            // to ensure "scope" is required (not null)
            if (scope == null)
            {
                throw new InvalidDataException("scope is a required property for CreateDerivedPropertyDefinitionRequest and cannot be null");
            }
            else
            {
                this.Scope = scope;
            }

            // to ensure "code" is required (not null)
            if (code == null)
            {
                throw new InvalidDataException("code is a required property for CreateDerivedPropertyDefinitionRequest and cannot be null");
            }
            else
            {
                this.Code = code;
            }

            // to ensure "displayName" is required (not null)
            if (displayName == null)
            {
                throw new InvalidDataException("displayName is a required property for CreateDerivedPropertyDefinitionRequest and cannot be null");
            }
            else
            {
                this.DisplayName = displayName;
            }

            // to ensure "dataTypeId" is required (not null)
            if (dataTypeId == null)
            {
                throw new InvalidDataException("dataTypeId is a required property for CreateDerivedPropertyDefinitionRequest and cannot be null");
            }
            else
            {
                this.DataTypeId = dataTypeId;
            }

            this.PropertyDescription = propertyDescription;
            this.DerivationFormula   = derivationFormula;
            this.PropertyDescription = propertyDescription;
            this.DerivationFormula   = derivationFormula;
        }
        public static string GenerateConnectionString(DomainEnum domain)
        {
            string sDomain = domain.ToString().ToLower();

            string connection = null;

            connection = ConfigurationManager.ConnectionStrings[sDomain].ConnectionString;

            if (connection == null)
            {
                throw new ConfigurationErrorsException(string.Format(DPO.Resources.SystemMessages.SM001, sDomain));
            }

            var efProvider = new EntityConnectionStringBuilder(connection);

            var sqlProvider = new SqlConnectionStringBuilder(efProvider.ProviderConnectionString);

            if (String.IsNullOrEmpty(sqlProvider.UserID) || sqlProvider.UserID == ".")
            {
                sqlProvider.IntegratedSecurity = true;
            }

            sqlProvider.PersistSecurityInfo      = false;
            sqlProvider.MultipleActiveResultSets = true;
            //sqlProvider.ConnectTimeout = 5;
            //sqlProvider.ConnectTimeout = 200;

            if (domain != DomainEnum.Local)
            {
                sqlProvider.IntegratedSecurity = false;
                sqlProvider.UserID             = "DaikinAdmin";
                sqlProvider.Password           = "******";
            }

            efProvider.ProviderConnectionString = sqlProvider.ToString();

            var efConnection = efProvider.ToString();


            if (domain == DomainEnum.Local)
            {
                using (var db = new DPOContext(efConnection))
                {
                    // Recreate schema if no test db or test db is older than schema
                    db.Database.Initialize(true);
                }
            }

            return(efConnection);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="CreateDerivedPropertyDefinitionRequest" /> class.
 /// </summary>
 /// <param name="domain">The domain that the property exists in. Not all available values are currently supported, please check the documentation: https://support.lusid.com/knowledgebase/article/KA-01719/. The available values are: NotDefined, Transaction, Portfolio, Holding, ReferenceHolding, TransactionConfiguration, Instrument, CutLabelDefinition, Analytic, PortfolioGroup, Person, AccessMetadata, Order, UnitResult, MarketData, ConfigurationRecipe, Allocation, Calendar, LegalEntity, Placement, Execution, Block, Participation, Package, OrderInstruction, NextBestAction, CustomEntity (required).</param>
 /// <param name="scope">The scope that the property exists in. (required).</param>
 /// <param name="code">The code of the property. Together with the domain and scope this uniquely identifies the property. (required).</param>
 /// <param name="displayName">The display name of the property. (required).</param>
 /// <param name="dataTypeId">dataTypeId (required).</param>
 /// <param name="propertyDescription">Describes the property.</param>
 /// <param name="derivationFormula">The rule that defines how data is composed for a derived property. (required).</param>
 public CreateDerivedPropertyDefinitionRequest(DomainEnum domain = default(DomainEnum), string scope = default(string), string code = default(string), string displayName = default(string), ResourceId dataTypeId = default(ResourceId), string propertyDescription = default(string), string derivationFormula = default(string))
 {
     this.Domain = domain;
     // to ensure "scope" is required (not null)
     this.Scope = scope ?? throw new ArgumentNullException("scope is a required property for CreateDerivedPropertyDefinitionRequest and cannot be null");
     // to ensure "code" is required (not null)
     this.Code = code ?? throw new ArgumentNullException("code is a required property for CreateDerivedPropertyDefinitionRequest and cannot be null");
     // to ensure "displayName" is required (not null)
     this.DisplayName = displayName ?? throw new ArgumentNullException("displayName is a required property for CreateDerivedPropertyDefinitionRequest and cannot be null");
     // to ensure "dataTypeId" is required (not null)
     this.DataTypeId = dataTypeId ?? throw new ArgumentNullException("dataTypeId is a required property for CreateDerivedPropertyDefinitionRequest and cannot be null");
     // to ensure "derivationFormula" is required (not null)
     this.DerivationFormula   = derivationFormula ?? throw new ArgumentNullException("derivationFormula is a required property for CreateDerivedPropertyDefinitionRequest and cannot be null");
     this.PropertyDescription = propertyDescription;
 }
Пример #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CreatePropertyDefinitionRequest" /> class.
 /// </summary>
 /// <param name="domain">The domain that the property exists in. The available values are: NotDefined, Transaction, Portfolio, Holding, ReferenceHolding, TransactionConfiguration, Instrument, CutLabelDefinition, Analytic, PortfolioGroup, Person, AccessMetadata, Order, UnitResult, MarketData, ConfigurationRecipe, Allocation, Calendar, LegalEntity, Placement, Execution, Block, Participation, Package, OrderInstruction, NextBestAction, CustomEntity (required).</param>
 /// <param name="scope">The scope that the property exists in. (required).</param>
 /// <param name="code">The code of the property. Together with the domain and scope this uniquely identifies the property. (required).</param>
 /// <param name="valueRequired">This field is not implemented and should be disregarded..</param>
 /// <param name="displayName">The display name of the property. (required).</param>
 /// <param name="dataTypeId">dataTypeId (required).</param>
 /// <param name="lifeTime">Describes how the property&#39;s values can change over time. The available values are: Perpetual, TimeVariant.</param>
 /// <param name="constraintStyle">Describes the uniqueness and cardinality of the property for entity objects under the property domain specified in Key. Defaults to \&quot;Property\&quot; if not specified. Valid values for this field are: Property, Collection or Identifier..</param>
 /// <param name="propertyDescription">Describes the property.</param>
 public CreatePropertyDefinitionRequest(DomainEnum domain = default(DomainEnum), string scope = default(string), string code = default(string), bool valueRequired = default(bool), string displayName = default(string), ResourceId dataTypeId = default(ResourceId), LifeTimeEnum?lifeTime = default(LifeTimeEnum?), string constraintStyle = default(string), string propertyDescription = default(string))
 {
     this.Domain = domain;
     // to ensure "scope" is required (not null)
     this.Scope = scope ?? throw new ArgumentNullException("scope is a required property for CreatePropertyDefinitionRequest and cannot be null");
     // to ensure "code" is required (not null)
     this.Code = code ?? throw new ArgumentNullException("code is a required property for CreatePropertyDefinitionRequest and cannot be null");
     // to ensure "displayName" is required (not null)
     this.DisplayName = displayName ?? throw new ArgumentNullException("displayName is a required property for CreatePropertyDefinitionRequest and cannot be null");
     // to ensure "dataTypeId" is required (not null)
     this.DataTypeId          = dataTypeId ?? throw new ArgumentNullException("dataTypeId is a required property for CreatePropertyDefinitionRequest and cannot be null");
     this.ValueRequired       = valueRequired;
     this.LifeTime            = lifeTime;
     this.ConstraintStyle     = constraintStyle;
     this.PropertyDescription = propertyDescription;
 }
Пример #8
0
        private void ProcessMessage(JToken jsonData, MessageTypeEnum msgType, DomainEnum domain)
        {
            switch (domain)
            {
            case DomainEnum.Login:
                ProcessLogin(jsonData, msgType);
                break;

            case DomainEnum.NewsTextAnalytics:
                ProcessMrnStory(jsonData, msgType);
                break;

            default:
                Console.WriteLine("Unsupported Domain");
                RaiseErrorEvent(DateTime.Now, $"Received response message for unhandled domain model");
                break;
            }
        }
Пример #9
0
        /// <summary>
        /// Преобразует имя пользователя в sAMAccountName
        /// </summary>
        /// <param name="UTNName"></param>
        /// <returns></returns>
        public static string ConvertFromUTNNameTosAMAccountName(string UTNName)
        {
            string     user   = UTNName.Split('@')[0];
            DomainEnum domain = (DomainEnum)Enum.Parse(typeof(DomainEnum), UTNName.Split('@')[1]);

            switch (domain)
            {
            case DomainEnum.kyiv:
                return(String.Format(@"{0}\{1}", DomainNETBIOSEnum.UKRTRANSNAFTA.ToString(), user));

            case DomainEnum.kremen:
                return(String.Format(@"{0}\{1}", DomainNETBIOSEnum.KREMEN.ToString(), user));

            case DomainEnum.odessa:
                return(String.Format(@"{0}\{1}", DomainNETBIOSEnum.ODESSA.ToString(), user));

            case DomainEnum.lviv:
                return(String.Format(@"{0}\{1}", DomainNETBIOSEnum.DRUZHBA.ToString(), user));

            default:
                return(String.Format(@"{0}\{1}", DomainNETBIOSEnum.DRUZHBA_AD.ToString(), user));
            }
        }
Пример #10
0
        /// <summary>
        /// Возвращает список согласователей
        /// </summary>
        /// <param name="secret"></param>
        /// <returns></returns>
        List <Models.AuthUser> GetITResponsers(string secret)
        {
            List <Models.AuthUser> users = new List <Models.AuthUser>();

            using (Models.PhonesDataContext model = new Models.PhonesDataContext())
            {
                ///---Получаю список ИТ ответственных по пользователю, который проинвертился
                string     d      = model.RequestTickets.First(x => x.secret == secret).UTNLogin.Split('@')[1];
                DomainEnum domain = (DomainEnum)Enum.Parse(typeof(DomainEnum), d);
                foreach (string UTNName in
                         model.Acceptors.Where(x => x.serviceDomain == domain.ToString())
                         .Select(x => x.username).ToList())
                {
                    string sn    = ConvertFromUTNNameTosAMAccountName(UTNName);
                    var    login = model.Logins.First(l => l.sAMAccountName == sn);
                    users.Add(new Models.AuthUser()
                    {
                        email = login.Email,
                        FIO   = login.FIO != null ? login.FIO : ""
                    });
                }
            }
            return(users);
        }