|
using System;
using System.Data;
using ASPNET.StarterKit.TimeTracker.DataAccessLayer;
using System.Configuration;
namespace ASPNET.StarterKit.TimeTracker.BusinessLogicLayer
{
//*********************************************************************
//
// ResourceReportUser Class
//
// This class represents User summary in Resource Report page
//
//*********************************************************************
public class ResourceReportUser
{
private string _fullName;
private int _userID;
private string _userName;
private decimal _totalHours;
public ResourceReportUser()
{
_userID = 0;
_userName = string.Empty;
_totalHours = 0M;
_fullName = string.Empty;
}
public string FullName
{
get { return _fullName; }
set { _fullName = value; }
}
public int UserID
{
get {return _userID;}
set { _userID = value; }
}
public string UserName
{
get { return _userName; }
set { _userName = value; }
}
public decimal TotalHours
{
get { return _totalHours; }
set { _totalHours = value; }
}
//*********************************************************************
//
// GetUserSummary retrieves multiple user summaries and returns them in a collection.
// userIdList is a comma delimited UserIDs string (i.e. "1,2,3").
//
//*********************************************************************
public static ResourceReportUserCollection GetUserSummary(int mgrUserID, string userIdList, DateTime startDate, DateTime endDate)
{
DataSet dsUsers = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings[Web.Global.CfgKeyConnString],
"TT_ListUserTimeSummary", mgrUserID, userIdList, startDate, endDate);
ResourceReportUserCollection userList = new ResourceReportUserCollection();
// Create a reference to display full name.
string firstName = string.Empty;
string lastName = string.Empty;
// Separate Data into a collection of ResourceReportUser
foreach(DataRow row in dsUsers.Tables[0].Rows)
{
ResourceReportUser usr = new ResourceReportUser();
usr.UserID = Convert.ToInt32(row["UserID"]);
usr.UserName = row["UserName"].ToString();
usr.TotalHours = Convert.ToDecimal(row["TotalHours"]);
usr.FullName = TTUser.GetDisplayName(usr.UserName, ref firstName, ref lastName);
userList.Add(usr);
}
return userList;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here