Example #1
0
        public FormatTextTableHandler AddLineIfNotEqual(string fieldName, AttributeRequiredLevelManagedProperty value1, AttributeRequiredLevelManagedProperty value2)
        {
            var valueString1 = value1 != null?value1.Value.ToString() : "null";

            var valueString2 = value2 != null?value2.Value.ToString() : "null";

            if (valueString1 != valueString2)
            {
                this.AddLine(fieldName, valueString1, valueString2);
            }

            return(this);
        }
Example #2
0
        private void CreatePickLIst(string pEntity)
        {
            foreach (var _rows in _dataset.Tables[0].Rows)
            {
                this._row     = ((DataRow)_rows);
                this._options = this._row[7].ToString().Replace("\n", "|");

                GetOptions();

                switch (this._row[5])
                {
                case "None":
                    _requiredLevel = new AttributeRequiredLevelManagedProperty(AttributeRequiredLevel.None);
                    break;

                case "ApplicationRequired":
                    _requiredLevel = new AttributeRequiredLevelManagedProperty(AttributeRequiredLevel.ApplicationRequired);
                    break;
                }

                try
                {
                    PicklistAttributeMetadata dxPicklistAttributeMetadata = new PicklistAttributeMetadata
                    {
                        SchemaName  = this._row[1].ToString(),
                        DisplayName = new Microsoft.Xrm.Sdk.Label(this._row[2].ToString(), 1033),
                        Description = new Microsoft.Xrm.Sdk.Label(this._row[4].ToString(), 1033),

                        RequiredLevel = this._requiredLevel,
                        OptionSet     = this._optionMetadata
                    };
                    AttributeMetadata attributeMetadata = dxPicklistAttributeMetadata;

                    CreateAttributeRequest createBankNameAttributeRequest = new CreateAttributeRequest
                    {
                        EntityName = pEntity,
                        Attribute  = attributeMetadata,
                    };

                    _crmsvc.OrganizationServiceProxy.Execute(createBankNameAttributeRequest);
                    ColorConsole.WriteLine($"Create done { this._row[1].ToString() }".Red().OnGreen());
                }
                catch (Exception ex)
                {
                    ColorConsole.WriteLine($"Create has an error {ex.Message}".Yellow().OnDarkRed());
                    logger.Error(ex.Message);
                }
            }
        }
Example #3
0
 public AttributeRequiredLevelManagedPropertyInfo(AttributeRequiredLevelManagedProperty property)
 {
     this.property = property;
 }
 public AttributeRequiredLevelManagedPropertyInfo(AttributeRequiredLevelManagedProperty property)
 {
     this.property = property;
 }