예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="IncidentBoxRule"/> class.
 /// </summary>
 /// <param name="row">The row.</param>
 private IncidentBoxRule(IncidentBoxRuleRow row)
 {
     _srcRow = row;
 }
예제 #2
0
        /// <summary>
        /// Creates the specified incident box id.
        /// </summary>
        /// <param name="IncidentBoxId">The incident box id.</param>
        /// <param name="OutlineIndex">Index of the outline.</param>
        /// <param name="RuleType">Type of the Rule.</param>
        /// <param name="Key">The key.</param>
        /// <param name="Value">The value.</param>
        /// <returns></returns>
        public static int Create(int IncidentBoxId, int OutlineIndex, IncidentBoxRuleType RuleType, string Key, string Value)
        {
            IncidentBoxRuleRow newRow = new IncidentBoxRuleRow();

            newRow.IncidentBoxId = IncidentBoxId;

            newRow.OutlineIndex = OutlineIndex;
            newRow.OutlineLevel = ".";

            newRow.RuleType = (int)RuleType;
            newRow.Key = Key;
            newRow.Value = Value;

            newRow.Update();

            return newRow.PrimaryKeyId;
        }
예제 #3
0
        /// <summary>
        /// Creates the child.
        /// </summary>
        /// <param name="IncidentBoxId">The incident box id.</param>
        /// <param name="ParentIncidentBoxRuleId">The parent incident box rule id.</param>
        /// <param name="OutlineIndex">Index of the outline.</param>
        /// <param name="RuleType">Type of the rule.</param>
        /// <param name="Key">The key.</param>
        /// <param name="Value">The value.</param>
        /// <returns></returns>
        public static int CreateChild(int IncidentBoxId, int ParentIncidentBoxRuleId, int OutlineIndex, IncidentBoxRuleType RuleType, string Key, string Value)
        {
            IncidentBoxRuleRow parentRule = new IncidentBoxRuleRow(ParentIncidentBoxRuleId);
            if ((parentRule.RuleType & (int)(IncidentBoxRuleType.AndBlock | IncidentBoxRuleType.OrBlock)) == 0)
                throw new ArgumentException("ParentIncidentBoxRule RuleType Should be either AndBlock or OrBlock.", "ParentIncidentBoxRuleId");

            IncidentBoxRuleRow newRow = new IncidentBoxRuleRow();

            newRow.IncidentBoxId = IncidentBoxId;

            newRow.OutlineIndex = OutlineIndex;
            newRow.OutlineLevel = string.Format("{0}{1}.", parentRule.OutlineLevel, parentRule.IncidentBoxRuleId);

            newRow.RuleType = (int)RuleType;
            newRow.Key = Key;
            newRow.Value = Value;

            newRow.Update();

            return newRow.PrimaryKeyId;
        }
예제 #4
0
        /// <summary>
        /// Changes the index of the outline.
        /// </summary>
        /// <param name="IncidentBoxRuleId">The incident box Rule id.</param>
        /// <param name="NewOutlineIndex">New index of the outline.</param>
        public static void ChangeOutlineIndex(int IncidentBoxRuleId, int NewOutlineIndex)
        {
            IncidentBoxRuleRow newRow = new IncidentBoxRuleRow(IncidentBoxRuleId);

            newRow.OutlineIndex = NewOutlineIndex;

            newRow.Update();
        }