Ejemplo n.º 1
0
        public Structures.ApprovalRulesConsolidatedReport.TableLine CreateTableLine(string reportSessionId,
                                                                                    Sungero.Company.IBusinessUnit businessUnit,
                                                                                    Sungero.Company.IDepartment department,
                                                                                    Sungero.Docflow.IDocumentGroupBase category,
                                                                                    Sungero.Docflow.IApprovalRuleBase rule,
                                                                                    Sungero.Core.Enumeration flow,
                                                                                    string documentKind,
                                                                                    string documentParentType,
                                                                                    Dictionary <Sungero.Core.Enumeration, string> localizedValueCash)
        {
            var line = Structures.ApprovalRulesConsolidatedReport.TableLine.Create();

            line.BusinessUnit    = businessUnit != null ? businessUnit.Name : string.Empty;
            line.Department      = department != null ? department.Name : string.Empty;
            line.ReportSessionId = reportSessionId;
            line.Relation        = department != null && businessUnit != null && Equals(department.BusinessUnit, businessUnit) ? "+" : string.Empty;
            line.Category        = category != null ? category.Name : string.Empty;
            if (rule != null)
            {
                line.ApprovalRule         = rule.Name;
                line.ApprovalRuleId       = rule.Id;
                line.ApprovalRulePriority = rule.Priority;
                line.ApprovalRuleUrl      = Hyperlinks.Get(rule);
                line.Status = localizedValueCash[rule.Status.Value];
            }
            line.DocumentFlow       = localizedValueCash[flow];
            line.DocumentKind       = documentKind;
            line.DocumentParentType = documentParentType;
            return(line);
        }
Ejemplo n.º 2
0
        public List <Structures.ApprovalRulesConsolidatedReport.TableLine> CreateTableDataLines(IEnumerable <IApprovalRuleBase> rules,
                                                                                                string reportSessionId,
                                                                                                Sungero.Company.IBusinessUnit businessUnit,
                                                                                                Sungero.Company.IDepartment department,
                                                                                                Sungero.Docflow.IDocumentGroupBase category,
                                                                                                Sungero.Core.Enumeration flow,
                                                                                                string documentKind,
                                                                                                string documentParentType,
                                                                                                Dictionary <Sungero.Core.Enumeration, string> localizedValueCash)
        {
            var result = new List <Structures.ApprovalRulesConsolidatedReport.TableLine>();

            if (!rules.Any())
            {
                var line = this.CreateTableLine(reportSessionId, businessUnit, department, category, null, flow, documentKind, documentParentType, localizedValueCash);
                result.Add(line);
            }

            foreach (var rule in rules)
            {
                var line = this.CreateTableLine(reportSessionId, businessUnit, department, category, rule, flow, documentKind, documentParentType, localizedValueCash);
                result.Add(line);
            }
            return(result);
        }