Exemplo n.º 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));
    }
Exemplo n.º 2
0
    private void FillRQMTHistory()
    {
        DataTable dthst = Auditing.AuditHistory_Get((int)AuditLogTypeEnum.RQMT, ItemID, 0, asOfDateExclusive);

        DataSet dsRQMT = RQMT.RQMTEditData_Get(ItemID);

        DataTable dtRQMT                     = dsRQMT.Tables["RQMT"];
        DataTable dtAllSets                  = dsRQMT.Tables["ALLSETS"];
        DataTable dtAssociations             = dsRQMT.Tables["ASSOCIATIONS"];
        DataTable dtAttributes               = dsRQMT.Tables["ATTRIBUTES"];
        DataTable dtUsage                    = dsRQMT.Tables["USAGE"];
        DataTable dtAvailableFunctionalities = dsRQMT.Tables["AVAILABLEFUNCTIONALITIES"];
        DataTable dtFunctionality            = dsRQMT.Tables["FUNCTIONALITY"];
        DataTable dtDescriptions             = dsRQMT.Tables["DESCRIPTIONS"];
        DataTable dtDescriptionTypes         = dsRQMT.Tables["DESCTYPES"];
        DataTable dtDefects                  = dsRQMT.Tables["DEFECTS"];

        string detailsSection = CreatePropertySections("details",
                                                       new string[] { "RQMT Name" },
                                                       new string[] { dtRQMT.Rows[0]["RQMT"].ToString() },
                                                       new string[] { GetPreviousValues(dthst, "RQMT", asOfDateExclusive) });

        phAuditHistory.Controls.Add(CreateSection("Details", detailsSection));

        string associationsHistory = CreateTableSection("associations", "RQMTID", "SET", dthst,
                                                        new string[] { "ACTION", "UPDATED", "UPDATED BY" },
                                                        new string[] { "NewValue", "UpdatedDate", "UpdatedBy" },
                                                        30, 250);

        string currentAssocations = "<div style=\"padding-bottom:10px;padding-left:15px;position:relative;\">";

        if (string.IsNullOrWhiteSpace(associationsHistory))
        {
            currentAssocations += "<img src=\"images/icons/expand.gif\" width=\"9\" height=\"9\" style=\"position:absolute;left:2px;top:2px;opacity:.3\" alt=\"No history found\" title=\"No history found\">";
        }
        else
        {
            currentAssocations += "<img src=\"images/icons/expand.gif\" width=\"9\" height=\"9\" style=\"position:absolute;left:2px;top:2px;cursor:pointer;\" onclick=\"$('#div_associations_history').toggle(); $(this).attr('src', $('#div_associations_history').is(':visible') ? 'images/icons/collapse.gif' : 'images/icons/expand.gif')\">";

            associationsHistory = associationsHistory.Replace("RQMT ADDED TO SET", "<img src=\"images/icons/check.png\" width=\"12\" height=\"12\" alt=\"Added to set\" title=\"Added to set\">&nbsp;");
            associationsHistory = associationsHistory.Replace("RQMT DELETED FROM SET", "<img src=\"images/icons/cross.png\" width=\"12\" height=\"12\" alt=\"Deleted from set\" title=\"Deleted from set\">&nbsp;");
        }

        bool rowAdded = false;

        foreach (DataRow row in dtAssociations.Rows)
        {
            if (rowAdded)
            {
                currentAssocations += "<br />";
            }

            string rsid = row["RQMTSet_ID"].ToString();
            string sys  = row["WTS_SYSTEM"].ToString();
            string wa   = row["WorkArea"].ToString();
            string rt   = row["RQMTType"].ToString();

            currentAssocations += "<b>" + sys + "/" + wa + "/" + rt + " (" + rsid + ")</b>";

            rowAdded = true;
        }
        currentAssocations += "</div>";
        currentAssocations += "<div id=\"div_associations_history\" style=\"display:none;\">";
        currentAssocations += associationsHistory;
        currentAssocations += "</div>";

        phAuditHistory.Controls.Add(CreateSection("Associations", currentAssocations));
    }