示例#1
0
    private void FillRQMTSetHistory()
    {
        DataTable dthst = Auditing.AuditHistory_Get((int)AuditLogTypeEnum.RQMTSet, ItemID, 0, asOfDateExclusive);
        DataRow   drrs  = RQMT.RQMTSet_Get(ItemID, true);

        phAuditHistory.Controls.Add(CreateSection("Associations", CreatePropertySections("associations",
                                                                                         new string[] { "RQMT Set Name", "System", "Work Area", "Purpose" },
                                                                                         new string[] { (string)drrs["RQMTSetName"], (string)drrs["WTS_SYSTEM"], (string)drrs["WorkArea"], (string)drrs["RQMTType"] },
                                                                                         new string[] { GetPreviousValues(dthst, "RQMTSetName", asOfDateExclusive), GetPreviousValues(dthst, "WTS_SYSTEM", asOfDateExclusive), GetPreviousValues(dthst, "WorkArea", asOfDateExclusive), GetPreviousValues(dthst, "RQMTType", asOfDateExclusive) }
                                                                                         )));

        phAuditHistory.Controls.Add(CreateSection("Properties", CreatePropertySections("properties",
                                                                                       new string[] { "Complexity", "Justification" },
                                                                                       new string[] { (drrs["Complexity"] != DBNull.Value ? (string)drrs["Complexity"] : ""), (drrs["Justification"] != DBNull.Value ? (string)drrs["Justification"] : "") },
                                                                                       new string[] { GetPreviousValues(dthst, "RQMTComplexity", asOfDateExclusive), GetPreviousValues(dthst, "Justification", asOfDateExclusive) }
                                                                                       )));

        if (dthst.AsEnumerable().Count(dr => dr["FieldChanged"].ToString() == "RQMT") > 0)
        {
            string rqmtstr = CreateTableSection("rqmts", "RQMT", null, dthst,
                                                new string[] { "RQMT #", "RQMT", "ACTION", "UPDATED", "UPDATED BY" },
                                                new string[] { "ParentItemID", "OldValue|NewValue", "ITEM_UPDATETYPEID", "UpdatedDate", "UpdatedBy" });

            int ht = 15 + (12 * dthst.Rows.Count);
            if (ht > 100)
            {
                ht = 100;
            }
            phAuditHistory.Controls.Add(CreateSection("RQMTS", rqmtstr, ht));
        }

        string countStr = CreatePropertySections("rqmtcount",
                                                 new string[] { "RQMT Count" },
                                                 new string[] { drrs["RQMTCount"].ToString() },
                                                 new string[] { GetPreviousValues(dthst, "RQMTCount", asOfDate) });

        countStr += AddRQMTSetCountChart(dthst, drrs["RQMTCount"].ToString());

        phAuditHistory.Controls.Add(CreateSection("RQMT Count", countStr));
    }