private void GetConditionSelected()
        {
            DataGridViewRow row = ConditionsGridView1.Rows[ConditionsGridView1.CurrentCell.RowIndex];
            var             conditionSelected = (AutomedPrelimCondition)row.Tag;

            ConditionSelected = conditionSelected;
        }
        private object[] MapConditionToUiGrid(AutomedPrelimCondition condition)
        {
            object[] arrayToDisplay = new object[ConditionsGridView1.Columns.Count];

            arrayToDisplay[0] = condition.UwConditionName;
            arrayToDisplay[1] = condition.BusinessRuleName;
            arrayToDisplay[2] = condition.BusinesRuleLastModifiedBy;
            arrayToDisplay[3] = condition.UwTemplateId;

            return(arrayToDisplay);
        }
コード例 #3
0
        public static GetAutomatedPrelimConditionsResponse GetAutomedConditionBusinessRuleConditions()
        {
            GetAutomatedPrelimConditionsResponse response = new GetAutomatedPrelimConditionsResponse()
            {
                Conditions = new List <AutomedPrelimCondition>(),
                Errors     = new List <string>()
            };

            SessionObjects sos   = EncompassApplication.Session.GetType().GetProperties(BindingFlags.NonPublic | BindingFlags.Instance).Single(pi => pi.Name == "SessionObjects").GetValue(EncompassApplication.Session) as SessionObjects;
            var            rules = sos.BpmManager.GetRules(BizRuleType.AutomatedConditions, true);

            foreach (var rule in rules)
            {
                try
                {
                    var automedRule = Helpers.ReflectHelper.ConvertToTyped <AutomatedConditionRuleInfo>(rule);

                    foreach (var condition in automedRule.Conditions)
                    {
                        var    template   = EncompassApplication.Session.Loans.Templates.UnderwritingConditions.GetTemplateByTitle(condition.ConditionName);
                        string tmeplateId = "";
                        if (template != null)
                        {
                            tmeplateId = template.ID;
                        }

                        AutomedPrelimCondition newCondition = new AutomedPrelimCondition()
                        {
                            BusinessRuleName          = rule.RuleName,
                            UwConditionName           = condition.ConditionName,
                            UwTemplateId              = tmeplateId,
                            BusinesRuleLastModifiedBy = rule.LastModifiedByUserId
                        };

                        response.Conditions.Add(newCondition);
                    }
                }
                catch (Exception ex)
                {
                    response.Errors.Add($"{rule.RuleName}. ERROR '{ex.ToString()}'");
                }
            }

            return(response);
        }