Example #1
0
 /// <summary>
 /// Creates an instance of the rule.
 /// </summary>
 /// <param name="primaryProperty">Property to which the rule applies.</param>
 /// <param name="max">Max length value.</param>
 public MaxValue(Csla.Core.IPropertyInfo primaryProperty, T max)
     : base(primaryProperty)
 {
     Max = max;
     this.RuleUri.AddQueryParameter("max", max.ToString());
     InputProperties.Add(primaryProperty);
 }
Example #2
0
 /// <summary>
 /// Creates an instance of the rule.
 /// </summary>
 /// <param name="primaryProperty">Property to which the rule applies.</param>
 /// <param name="min">Min value.</param>
 public MinValue(Csla.Core.IPropertyInfo primaryProperty, T min)
     : base(primaryProperty)
 {
     Min = min;
     this.RuleUri.AddQueryParameter("min", min.ToString());
     InputProperties.Add(primaryProperty);
 }
        internal virtual InputProperties GetInputProperties(string method)
        {
            InputProperties props = new InputProperties();

            switch (method)
            {
            case "GetWorklistItems":
            {
                #region properties
                props.Add(this._svcObject.Properties["Status"]);
                props.Add(this._svcObject.Properties["ActivityName"]);
                props.Add(this._svcObject.Properties["ProcessName"]);
                props.Add(this._svcObject.Properties["ProcessFullName"]);
                props.Add(this._svcObject.Properties["Folio"]);
                props.Add(this._svcObject.Properties["EventInstanceName"]);
                props.Add(this._svcObject.Properties["Priority"]);
                props.Add(this._svcObject.Properties["UserName"]);
                break;
                #endregion
            }

            case "LoadWorklistItem":
            {
                props.Add(this._svcObject.Properties["SerialNumber"]);
                props.Add(this._svcObject.Properties["UserName"]);
                break;
            }
            }
            return(props);
        }
        private InputProperties GetInputProperties(string Method)
        {
            InputProperties properties = new InputProperties();

            switch (Method)
            {
            case "IsInRole":
                #region properties
                properties.Add(new Property("Role_Name", "System.String", SoType.Text, new MetaData("Role_Name", "Role_Name")));
                properties.Add(new Property("IsinRole", "System.Boolean", SoType.YesNo, new MetaData("IsinRole", "IsinRole")));
                properties.Add(new Property("Name", "System.String", SoType.Text, new MetaData("Username", "Username")));

                break;

            case "GetRoleUsersEmailAddress":

                properties.Add(new Property("Role_Name", "System.String", SoType.Text, new MetaData("Role_Name", "Role_Name")));

                break;

            case "GetRoleUsersEmailsonIndex":
                properties.Add(new Property("Role_Name", "System.String", SoType.Text, new MetaData("Role_Name", "Role_Name")));
                properties.Add(new Property("UserIndex", "System.Int32", SoType.Number, new MetaData("UserIndex", "UserIndex")));
                break;

            case "GetRoleUsersEmails":
                properties.Add(new Property("Role_Name", "System.String", SoType.Text, new MetaData("Role_Name", "Role_Name")));
                //properties.Add(new Property("UserIndex", "System.Int32", SoType.Number, new MetaData("UserIndex", "UserIndex")));
                break;

                #endregion
            }
            return(properties);
        }
Example #5
0
 /// <summary>
 /// Creates an instance of the rule.
 /// </summary>
 /// <param name="primaryProperty">Primary property.</param>
 /// <param name="expression">Regular expression.</param>
 public RegExMatch(Csla.Core.IPropertyInfo primaryProperty, string expression)
     : base(primaryProperty)
 {
     Expression = expression;
     RuleUri.AddQueryParameter("e", expression);
     InputProperties.Add(primaryProperty);
 }
        private InputProperties GetInputProperties(string Method)
        {
            InputProperties properties = new InputProperties();

            switch (Method)
            {
            case "ExcelList":
                #region properties
                properties.Add(new Property("ExcelDocumentPath", "System.String", SoType.File, new MetaData("ExcelDocumentPath", "Excel Document Path Value")));
                properties.Add(new Property("RowNumber", "System.Int32", SoType.Number, new MetaData("RowNumber", "RowNumber")));
                properties.Add(new Property("ExcelSheetName", "System.String", SoType.Text, new MetaData("ExcelSheetName", "Excel Sheet Name")));

                for (int i = 1; i <= _NoOfColumns; i++)
                {
                    properties.Add(new Property("Column" + i, "System.String", SoType.Text, new MetaData("Column" + i, "Column" + i)));
                }
                break;

            case "SaveData":
                properties.Add(new Property("ExcelDocumentPath", "System.String", SoType.File, new MetaData("ExcelDocumentPath", "Excel Document Path Value")));
                properties.Add(new Property("RowNumber", "System.Int32", SoType.Number, new MetaData("RowNumber", "RowNumber")));
                properties.Add(new Property("ExcelSheetName", "System.String", SoType.Text, new MetaData("ExcelSheetName", "Excel Sheet Name")));
                properties.Add(new Property("TableName", "System.String", SoType.Text, new MetaData("TableName", "SmartObjectName")));
                //properties.Add(new Property("FilterData", "System.Guid", SoType.Guid, new MetaData("FilterData", "FilterData")));
                break;

                #endregion
            }
            return(properties);
        }
Example #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StopIfNotFieldExists"/> class.
 /// </summary>
 /// <param name="primaryProperty">Primary property for this rule.</param>
 public StopIfNotFieldExists(IPropertyInfo primaryProperty)
     : base(primaryProperty)
 {
     if (InputProperties == null)
         InputProperties = new List<IPropertyInfo>();
     InputProperties.Add(primaryProperty);
 }
Example #8
0
 public CalculateAge(IPropertyInfo birthdateProperty, IPropertyInfo ageProperty)
     : base(birthdateProperty)
 {
     AgeProperty = ageProperty;
     InputProperties.Add(birthdateProperty);
     AffectedProperties.Add(ageProperty);
 }
Example #9
0
        public CommonModuleEntry()
        {
            Key         = Common.KeyConst;
            Name        = Common.Name;
            Description = Common.Description;

            InputProperties.Add(new ElementPropertyEntry("WorkspacePath", "Workspace folder root path", DataType.VirtualPath, true));
        }
Example #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CollectionPopulated"/> class.
 /// </summary>
 /// <param name="chilCollectionProperties">The child collections properties to check.</param>
 public CollectionPopulated(params IPropertyInfo[] chilCollectionProperties)
 {
     if (InputProperties == null)
     {
         InputProperties = new List <IPropertyInfo>();
     }
     InputProperties.AddRange(chilCollectionProperties);
 }
Example #11
0
 /// <summary>
 /// Creates an instance of the rule.
 /// </summary>
 /// <param name="affectedProperties">Array of properties to which the rule applies.</param>
 public OneOfSeveralStringsRequiredRule(params IPropertyInfo[] affectedProperties)
     : base(affectedProperties[0])
 {
     foreach (IPropertyInfo affectedProperty in affectedProperties)
     {
         InputProperties.Add(affectedProperty);
     }
 }
Example #12
0
 public RequiredWhenAnyHasValue(IPropertyInfo primaryProperty, params IPropertyInfo[] additionalRequired) : base(primaryProperty)
 {
     if (InputProperties == null)
     {
         InputProperties = new List <IPropertyInfo>();
     }
     InputProperties.AddRange(additionalRequired);
 }
Example #13
0
 /// <summary>
 /// Creates an instance of the rule.
 /// </summary>
 /// <param name="primaryProperty">Primary property for the rule.</param>
 /// <param name="dependencyProperties">Dependent property.</param>
 /// <remarks>
 /// When rules are run for one of the dependency properties the rules for primary property i rerun.
 /// </remarks>
 public DependencyFrom(Csla.Core.IPropertyInfo primaryProperty, params Csla.Core.IPropertyInfo[] dependencyProperties)
     : base(primaryProperty)
 {
     if (InputProperties == null)
     {
         InputProperties = new List <IPropertyInfo>();
     }
     InputProperties.AddRange(dependencyProperties);
 }
Example #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AnyRequired"/> class.
 /// </summary>
 /// <param name="primaryProperty">The primary property.</param>
 /// <param name="additionalProperties">The additional properties.</param>
 public AnyRequired(IPropertyInfo primaryProperty, params IPropertyInfo[] additionalProperties)
     : base(primaryProperty)
 {
     if (InputProperties == null)
     {
         InputProperties = new List <IPropertyInfo>();
     }
     InputProperties.AddRange(additionalProperties);
 }
Example #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CalcSum"/> class.
 /// </summary>
 /// <param name="primaryProperty">The primary property.</param>
 /// <param name="inputProperties">The input properties.</param>
 public CalcSum(IPropertyInfo primaryProperty, params IPropertyInfo[] inputProperties)
     : base(primaryProperty)
 {
     if (InputProperties == null)
     {
         InputProperties = new List <IPropertyInfo>();
     }
     InputProperties.AddRange(inputProperties);
 }
Example #16
0
 /// <summary>
 /// Valida una regla
 /// </summary>
 /// <param name="delegateRule"></param>
 /// <param name="primaryProperty"></param>
 /// <param name="secundaryProperty"></param>
 public ValidateRule(DelegateRule delegateRule, IPropertyInfo primaryProperty, IPropertyInfo secundaryProperty = null)
     : base(primaryProperty)
 {
     _delegateRule = delegateRule;
     if (secundaryProperty != null)
     {
         InputProperties.Add(primaryProperty);
         InputProperties.Add(secundaryProperty);
     }
 }
Example #17
0
        public CalculateFractionRule(PropertyInfo <decimal> targetProperty, PropertyInfo <decimal> sourceProperty, decimal fraction)
            : base(targetProperty)
        {
            InputProperties.Add(sourceProperty);

            _sourceProperty = sourceProperty;
            _fraction       = fraction;

            RuleUri.AddQueryParameter("fraction", fraction.ToString());
        }
Example #18
0
 /// <summary>
 /// Creates an instance of the rule.
 /// </summary>
 /// <param name="primaryProperty">Primary property for the rule.</param>
 /// <param name="dependencyProperties">Dependent property.</param>
 /// <remarks>
 /// When rules are run for one of the dependency properties the rules for primary property i rerun.
 /// </remarks>
 public DependencyFrom(Csla.Core.IPropertyInfo primaryProperty, params Csla.Core.IPropertyInfo[] dependencyProperties)
     : base(primaryProperty)
 {
     if (InputProperties == null)
     {
         InputProperties = new List <IPropertyInfo>();
     }
     InputProperties.AddRange(dependencyProperties);
     RuleUri.AddQueryParameter("dependencyfrom", string.Join(",", dependencyProperties.Select(p => p.Name)));
 }
Example #19
0
 /// <summary>
 /// Creates an instance of the rule.
 /// </summary>
 /// <param name="primaryProperty">Property to which the rule applies.</param>
 /// <param name="attribute">ValidationAttribute instance.</param>
 public DataAnnotation(Csla.Core.IPropertyInfo primaryProperty, System.ComponentModel.DataAnnotations.ValidationAttribute attribute)
     : base(primaryProperty)
 {
     this.Attribute = attribute;
     RuleUri.AddQueryParameter("a", attribute.GetType().FullName);
     if (primaryProperty != null)
     {
         InputProperties.Add(primaryProperty);
     }
 }
Example #20
0
        internal virtual InputProperties GetInputProperties(Method method)
        {
            var props = new InputProperties();

            switch (method)
            {
            case Method.ExcelBulkImport:
            case Method.ExcelImport:
                props.Add(_serviceObject.Properties[PropertyConstants.File]);
                props.Add(_serviceObject.Properties[PropertyConstants.SheetName]);
                props.Add(_serviceObject.Properties[PropertyConstants.HeaderRowIndex]);
                props.Add(_serviceObject.Properties[PropertyConstants.HeaderRowSpaces]);
                props.Add(_serviceObject.Properties[PropertyConstants.DuplicateColumnDelimiter]);
                props.Add(_serviceObject.Properties[PropertyConstants.SmartObjectName]);
                props.Add(_serviceObject.Properties[PropertyConstants.SmartObjectMethodName]);
                break;

            case Method.ExcelBulkImportWithTransaction:
            case Method.ExcelImportWithTransaction:
                props.Add(_serviceObject.Properties[PropertyConstants.File]);
                props.Add(_serviceObject.Properties[PropertyConstants.SheetName]);
                props.Add(_serviceObject.Properties[PropertyConstants.HeaderRowIndex]);
                props.Add(_serviceObject.Properties[PropertyConstants.HeaderRowSpaces]);
                props.Add(_serviceObject.Properties[PropertyConstants.DuplicateColumnDelimiter]);
                props.Add(_serviceObject.Properties[PropertyConstants.SmartObjectName]);
                props.Add(_serviceObject.Properties[PropertyConstants.SmartObjectMethodName]);
                props.Add(_serviceObject.Properties[PropertyConstants.TransactionIdProperty]);
                props.Add(_serviceObject.Properties[PropertyConstants.TransactionIdValue]);
                break;

            case Method.CsvBulkImport:
            case Method.CsvImport:
                props.Add(_serviceObject.Properties[PropertyConstants.File]);
                props.Add(_serviceObject.Properties[PropertyConstants.HeaderRowSpaces]);
                props.Add(_serviceObject.Properties[PropertyConstants.ColumnDelimiter]);
                props.Add(_serviceObject.Properties[PropertyConstants.TextQualifier]);
                props.Add(_serviceObject.Properties[PropertyConstants.SmartObjectName]);
                props.Add(_serviceObject.Properties[PropertyConstants.SmartObjectMethodName]);
                break;

            case Method.CsvBulkImportWithTransaction:
            case Method.CsvImportWithTransaction:
                props.Add(_serviceObject.Properties[PropertyConstants.File]);
                props.Add(_serviceObject.Properties[PropertyConstants.HeaderRowSpaces]);
                props.Add(_serviceObject.Properties[PropertyConstants.ColumnDelimiter]);
                props.Add(_serviceObject.Properties[PropertyConstants.TextQualifier]);
                props.Add(_serviceObject.Properties[PropertyConstants.SmartObjectName]);
                props.Add(_serviceObject.Properties[PropertyConstants.SmartObjectMethodName]);
                props.Add(_serviceObject.Properties[PropertyConstants.TransactionIdProperty]);
                props.Add(_serviceObject.Properties[PropertyConstants.TransactionIdValue]);
                break;
            }

            return(props);
        }
Example #21
0
 public Increment(PropertyInfo <int> primaryProperty, PropertyInfo <int> affectedProperty) : base(primaryProperty)
 {
     _primaryProperty  = primaryProperty;
     _affectedProperty = affectedProperty;
     if (InputProperties == null)
     {
         InputProperties = new List <IPropertyInfo>();
     }
     InputProperties.Add(primaryProperty);
     AffectedProperties.Add(affectedProperty);
 }
Example #22
0
        public CheckSumRule(PropertyInfo <int> value1Property, PropertyInfo <int> value2Property, int sumValue)
            : base(value1Property)
        {
            _sumValue = sumValue;
            InputProperties.Add(value1Property);
            InputProperties.Add(value2Property);

            _value1Property = value1Property;
            _value2Property = value2Property;

            RuleUri.AddQueryParameter("sumvalue", sumValue.ToString());
        }
Example #23
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LessThanProperty"/> class.
        /// </summary>
        /// <param name="primaryProperty">The primary property.</param>
        /// <param name="compareToProperty">The compare to property.</param>
        public LessThanProperty(IPropertyInfo primaryProperty, IPropertyInfo compareToProperty)
            : base(primaryProperty)
        {
            CompareTo = compareToProperty;

            if (InputProperties == null)
            {
                InputProperties = new List <IPropertyInfo>();
            }
            InputProperties.Add(primaryProperty);
            InputProperties.Add(compareToProperty);
        }
Example #24
0
 /// <summary>
 /// Creates an instance of the rule.
 /// </summary>
 /// <param name="primaryProperty">Primary property for the rule.</param>
 /// <param name="dependencyProperty">The dependency property.</param>
 /// <param name="isBiDirectional">if set to <c>true</c> [is bi directional].</param>
 /// <remarks>
 /// When rules are run for one of the dependency properties the rules for primary property i rerun.
 /// </remarks>
 public DependencyFrom(Csla.Core.IPropertyInfo primaryProperty, Csla.Core.IPropertyInfo dependencyProperty, bool isBiDirectional)
     : base(primaryProperty)
 {
     if (InputProperties == null)
     {
         InputProperties = new List <IPropertyInfo>();
     }
     InputProperties.Add(dependencyProperty);
     if (isBiDirectional)
     {
         AffectedProperties.Add(dependencyProperty);
     }
 }
Example #25
0
        public IsDuplicateNameAsync(IPropertyInfo primaryProperty, IPropertyInfo secondaryProperty)
            : base(primaryProperty)
        {
            SecondaryProperty = secondaryProperty;

            InputProperties.Add(primaryProperty);
            InputProperties.Add(secondaryProperty);
            IsAsync = false;

            // setting all to false will only allow the rule to run when the property is set - typically by the user from the UI.
            CanRunAsAffectedProperty = false;
            CanRunInCheckRules       = false;
            CanRunOnServer           = false;
        }
Example #26
0
        public FlatFileReaderEntry()
        {
            Key         = FlatFileReader.KeyConst;
            Name        = FlatFileReader.Name;
            Description = FlatFileReader.Description;

            InputProperties.Add(new ElementPropertyEntry("SourceFilePath", "Source file path", DataType.VirtualPath, true));
            InputProperties.Add(new ElementPropertyEntry("SkipStartingDataRows", "Starting row to skip", DataType.Int));
            InputProperties.Add(new ElementPropertyEntry("FirstRowHasHeader", "Use first row as header", DataType.Bool, true));
            InputProperties.Add(new ElementPropertyEntry("ColumnDelimiter", "Column char delimiter", DataType.Char, true));
            InputProperties.Add(new ElementPropertyEntry("LimitToRows", "Limit result to rows number", DataType.Int));

            OutputProperties.Add(new ElementPropertyEntry("Table", "Rows imported from flat file", DataType.Table, true));
        }
Example #27
0
        public FlatFileWriterEntry()
        {
            //Key = "FlatFileWriter";
            //Name = "Flat File Writer";
            //Description = "This elements write a flat file (like CSV) from a Table value.";

            Key         = FlatFileWriter.KeyConst;
            Name        = FlatFileWriter.Name;
            Description = FlatFileWriter.Description;

            InputProperties.Add(new ElementPropertyEntry("TargetFilePath", "Target file path", DataType.VirtualPath, true));
            InputProperties.Add(new ElementPropertyEntry("ColumnDelimiter", "Column char delimite", DataType.Char, true));
            InputProperties.Add(new ElementPropertyEntry("Table", "Table Value to write in flat file", DataType.Table, true));
        }
Example #28
0
        public SqlQueryReaderEntry()
        {
            //Key = "SqlQueryReader";
            //Name = "SQL Query Reader";
            //Description = "This elements read data form a SQL Server query and returns a Table value.";

            Key         = SqlQueryReader.KeyConst;
            Name        = SqlQueryReader.Name;
            Description = SqlQueryReader.Description;

            InputProperties.Add(new ElementPropertyEntry("ConnectionString", "Sql Server Connection String", DataType.String, true));
            InputProperties.Add(new ElementPropertyEntry("SqlQuery", "SqL Query", DataType.String, true));

            OutputProperties.Add(new ElementPropertyEntry("Table", "Rows imported from Sql Query", DataType.Table, true));
        }
Example #29
0
        public SqlTableWriterEntry()
        {
            //Key = "SqlTableWriter";
            //Name = "SQL Table Writer";
            //Description = "This elements insert TableValue to a SQL Server table.";

            Key         = SqlTableWriter.KeyConst;
            Name        = SqlTableWriter.Name;
            Description = SqlTableWriter.Description;

            InputProperties.Add(new ElementPropertyEntry("ConnectionString", "Sql Server Connection String", DataType.String, true));
            InputProperties.Add(new ElementPropertyEntry("SqlTable", "Sql destination table", DataType.String, true));
            InputProperties.Add(new ElementPropertyEntry("ColumnsMapping", "Columns Mapping", DataType.Collection));
            InputProperties.Add(new ElementPropertyEntry("SourceTable", "Source Table Value", DataType.Table, true));
        }
Example #30
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LookupCustomer"/> class.
        /// </summary>
        /// <param name="primaryProperty">
        /// The primary property.
        /// </param>
        /// <param name="nameProperty">
        /// The name property.
        /// </param>
        public LookupCustomer(IPropertyInfo primaryProperty, IPropertyInfo nameProperty)
            : base(primaryProperty)
        {
            NameProperty = nameProperty;

            if (InputProperties == null)
            {
                InputProperties = new List <IPropertyInfo>();
            }
            InputProperties.Add(primaryProperty);
            AffectedProperties.Add(nameProperty);

            IsAsync = false;
            CanRunAsAffectedProperty = false; // only run when this property is changed
            CanRunInCheckRules       = true;  // when true will also run in CheckRules
            CanRunOnServer           = false; // when true will also run on logical serverside (Data Access)
        }
        internal virtual InputProperties GetInputProperties(string method)
        {
            InputProperties props = new InputProperties();

            switch (method)
            {
                case "GetWorklistItems":
                    {
                        #region properties
                        props.Add(this._svcObject.Properties["Status"]);
                        props.Add(this._svcObject.Properties["ActivityName"]);
                        props.Add(this._svcObject.Properties["ProcessName"]);
                        props.Add(this._svcObject.Properties["ProcessFullName"]);
                        props.Add(this._svcObject.Properties["Folio"]);
                        props.Add(this._svcObject.Properties["EventInstanceName"]);
                        props.Add(this._svcObject.Properties["Priority"]);
                        props.Add(this._svcObject.Properties["UserName"]);
                        break;
                        #endregion
                    }
                case "LoadWorklistItem":
                    {
                        props.Add(this._svcObject.Properties["SerialNumber"]);
                        props.Add(this._svcObject.Properties["UserName"]);
                        break;
                    }
            }
            return props;
        }
        private InputProperties GetInputProperties(string method)
        {
            InputProperties properties = new InputProperties();

            switch (method)
            {
                case"ActionWorklistItem":
                    {
                        properties.Add(_so.Properties["SerialNumber"]);
                        properties.Add(_so.Properties["ActionName"]);
                        break;
                    }
                case "OpenWorklistItem":
                    {
                        properties.Add(_so.Properties["SerialNumber"]);
                        break;
                    }

                case "ReleaseWorklistItem":
                    {
                        properties.Add(_so.Properties["SerialNumber"]);
                        break;
                    }
                case "GetWorklistItemActions":
                    {
                        properties.Add(_so.Properties["SerialNumber"]);
                        break;
                    }
                case "RedirectWorklistItem":
                    {
                        properties.Add(_so.Properties["SerialNumber"]);
                        break;
                    }
                case "RedirectManagedUserWorklistItem":
                    {
                        properties.Add(_so.Properties["SerialNumber"]);
                        break;
                    }

            }
            return properties;
        }
        private InputProperties GetInputProperties(string method)
        {
            InputProperties properties = new InputProperties();

            switch (method)
            {
                case "GetWorklistItems":
                    {
                        #region properties
                        properties.Add(new Property("Status", "System.String", SoType.Text, new MetaData("Status", "Status")));
                        properties.Add(new Property("ActivityName", "System.String", SoType.Text, new MetaData("Activity Name", "Activity Name")));
                        properties.Add(new Property("ProcessName", "System.String", SoType.Text, new MetaData("Process Name", "Process Name")));
                        properties.Add(new Property("ProcessFullName", "System.String", SoType.Text, new MetaData("Process Full Name", "Process Full Name")));
                        properties.Add(new Property("Folio", "System.String", SoType.Text, new MetaData("Folio", "Folio")));
                        properties.Add(new Property("EventInstanceName", "System.String", SoType.Text, new MetaData("Event Instance Name", "Event Instance Name")));
                        properties.Add(new Property("Priority", "System.String", SoType.Text, new MetaData("Priority", "Priority")));
                        properties.Add(new Property("UserName", "System.String", SoType.Text, new MetaData("User Name", "User Name")));
                        break;
                        #endregion
                    }
                case "LoadWorklistItem":
                    {
                        properties.Add(new Property("SerialNumber", "System.String", SoType.Text, new MetaData("SerialNumber", "SerialNumber")));
                        break;
                    }
            }
            return properties;
        }