1

Resolved

DisplayName bug in Admin > Page_Load

description

In the Admin page, Page_Load method you have the following code:
However, the usp_RS_AwaitingApproval stored procedure does not return the field "DisplayName". My work around was to modify the stored procedure to return a blank for DisplayName. This enabled the admin page to work.
 
SqlDataReader reader = command.ExecuteReader();
    string currentSid = "";
    while (reader.Read())
    {
        sid = (string) reader["sid"];
        displayName = (string) reader["displayName"];
        DateTime weekStarting = (DateTime) reader["weekStarting"];
        if (sid != currentSid)
        {
            if (currentSid != "")
            {
                this.lit1.Text = this.lit1.Text + "</ul></li>";
            }
            CS$0$0001 = this.lit1.Text;
            this.lit1.Text = CS$0$0001 + "<li><a href=\"Explorer.aspx?u=" + sid + "\">" + displayName + "</a><ul>";
            currentSid = sid;
        }
        CS$0$0001 = this.lit1.Text;
        this.lit1.Text = CS$0$0001 + "<li><a href=\"Explorer.aspx?u=" + sid + "&ws=" + weekStarting.ToString("yyyy-MM-dd") + "\">" + weekStarting.ToString("MM/dd/yyyy") + "</a></li>";
    }

comments

lstratman wrote Mar 8, 2009 at 2:20 PM

Thanks for the code. It has been merged into the project and is in the 4.01 release.

wrote Mar 8, 2009 at 2:20 PM

jeffgrundy wrote May 5, 2009 at 9:21 PM

It seems to me that the fix should be to get the DisplayName from the tfsWorkItem tracking database. I updated usp_RS_AwaitingApproval to use the following select:

USE [TfsTimesheet]
GO
/ Object: StoredProcedure [dbo].[usp_RS_AwaitingApproval] Script Date: 05/05/2009 17:20:14 /
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[usp_RS_AwaitingApproval]
AS
BEGIN
SET NOCOUNT ON
SELECT
dbo.TimesheetCompletions.sid, 
dbo.TimesheetCompletions.weekStarting, 
TfsWorkItemTracking.dbo.Constants.DisplayPart AS DisplayName
FROM
dbo.TimesheetCompletions WITH (NOLOCK) 
INNER JOIN TfsWorkItemTracking.dbo.Constants 
ON dbo.TimesheetCompletions.sid = TfsWorkItemTracking.dbo.Constants.SID
WHERE
(dbo.TimesheetCompletions.completed = 1)
AND 
approved IS NULL
END

yayoo wrote Jun 5, 2009 at 6:43 AM

Thanx man. Works like a charm.

wrote Feb 14, 2013 at 7:28 PM

wrote May 16, 2013 at 8:44 AM

wrote May 16, 2013 at 8:44 AM

wrote Jun 14, 2013 at 7:04 AM