public AttributeEntity Clone() { AttributeEntity ret = new AttributeEntity(); ret.SetAttrName(attrName); ret.SetAttrValue(attrValue); return(ret); }
public AttributesView() { InitializeComponent(); var businessRuleSample = new AttributeEntity(); businessRuleSample.Extensions.InitializeRules(); DataContext = businessRuleSample; }
/// <summary>Creates a new, empty AttributeEntity object.</summary> /// <returns>A new, empty AttributeEntity object.</returns> public override IEntity Create() { IEntity toReturn = new AttributeEntity(); // __LLBLGENPRO_USER_CODE_REGION_START CreateNewAttribute // __LLBLGENPRO_USER_CODE_REGION_END return(toReturn); }
private PolicyDocumentEntity importFile(baseData vData, string title, string filepath) { AttributeCollection acoll = new AttributeCollection(); acoll.GetMulti(AttributeFields.Name == "Literal"); if (acoll.Count == 0) { throw new Exception("can't find literal attribute"); } m_literalAttribute = acoll[0]; XmlDocument doc = new XmlDocument(); doc.Load(filepath); PolicyDocumentEntity pde = new PolicyDocumentEntity(); pde.LibraryId = vData.Library.Id; pde.Name = title; PolicyLinkEntity ple = new PolicyLinkEntity(); ple.Policy = new PolicyEntity(); ple.Policy.LibraryId = pde.LibraryId; pde.PolicyLink = ple; XmlNode policySet = doc.SelectSingleNode("policy-set"); if (policySet != null) { loadPolicySet(1, title, ple, policySet); } else { XmlNode policy = doc.SelectSingleNode("policy"); loadPolicy(1, title, ple, policy); } pde.Save(true); return(pde); }
public void AddAttr(AttributeEntity arg) { AttrList.Add(arg); }
private void SaveConfigurationAsSystemSetting(RockConfig rockConfig) { // Login and setup options for REST calls var restClient = new RestClient(rockConfig.RockBaseUrl); restClient.LoginToRock(rockConfig.Username, rockConfig.Password); // Get the previous record and set up the one to be stored var isPost = true; var getStatementGeneratorConfig = new RestRequest($"api/Attributes?$filter=Guid eq guid'{Rock.Client.SystemGuid.Attribute.STATEMENT_GENERATOR_CONFIG}'"); var storedSetting = restClient.Execute <List <Rock.Client.Attribute> >(getStatementGeneratorConfig).Data.FirstOrDefault(); var systemSetting = new AttributeEntity() { IsSystem = false, FieldTypeId = 1, EntityTypeId = null, EntityTypeQualifierColumn = "SystemSetting", EntityTypeQualifierValue = string.Empty, Key = "core_StatementGeneratorConfig", Name = "core _ Statement Generator Config", AbbreviatedName = "core _ Statement Generator Config", Description = "Used to store common configuration settings for the Statement Generator application", Order = 0, IsGridColumn = false, IsMultiValue = false, IsRequired = false, Guid = Rock.Client.SystemGuid.Attribute.STATEMENT_GENERATOR_CONFIG.AsGuid() }; if (null != storedSetting) { isPost = false; systemSetting.CopyPropertiesFrom(storedSetting); } // Write the Config JSON systemSetting.DefaultValue = JsonConvert.SerializeObject(rockConfig, Formatting.None); // Post the data back to Rock var saveAttributeRequest = new RestRequest() .AddHeader("Accept", "application/json"); if (isPost) { saveAttributeRequest.Resource = "api/Attributes"; saveAttributeRequest.Method = Method.POST; } else { // If not nulled, this doesn't update systemSetting.ModifiedByPersonAliasId = null; systemSetting.ModifiedDateTime = null; saveAttributeRequest.Resource = $"api/Attributes/{systemSetting.Id}"; saveAttributeRequest.Method = Method.PUT; } saveAttributeRequest.AddJsonBody(systemSetting); var saveAttributeResponse = restClient.Execute(saveAttributeRequest); if (saveAttributeResponse.ErrorException != null) { throw saveAttributeResponse.ErrorException; } }