⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 projectreportentrylog.cs

📁 Time Tracker Starter Kit 使您能轻松创建这样一个应用程序
💻 CS
字号:
using System;
using System.Configuration;
using System.Data;
using ASPNET.StarterKit.TimeTracker.DataAccessLayer;

namespace ASPNET.StarterKit.TimeTracker.BusinessLogicLayer
{
	//*********************************************************************
	//
	//	ProjectReportEntryLog Class
	//
	//	This class represents entry log item in Project Report page
	//
	//*********************************************************************

	public class ProjectReportEntryLog
	{
		private decimal		_duration;
		private string		_fullName;
		private DateTime	_maxEntryDate, _minEntryDate;	
		private int			_userID;
		private string		_userName;

		public ProjectReportEntryLog()
		{
			_userName = string.Empty;
			_duration = 0M;
			_userID = 0;
			_minEntryDate = DateTime.MinValue;
			_maxEntryDate = DateTime.MinValue;
			_fullName = string.Empty;
		}

		public decimal Duration 
		{
			get { return _duration; }
			set { _duration = value; }
		}

		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 DateTime MaxEntryDate 
		{
			get { return _maxEntryDate; }
			set { _maxEntryDate = value; }
		}

		public DateTime MinEntryDate 
		{
			get { return _minEntryDate; }
			set { _minEntryDate = value; }
		}

		//*********************************************************************
		//
		//	GetEntrySummary returns summary of each user's time entries based on category
		//
		//*********************************************************************

		public static ProjectReportEntryLogCollection GetEntrySummary(int categoryID)
		{
			DataSet dsData = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings[Web.Global.CfgKeyConnString], 
				"TT_ListTimeEntriesByCategory", categoryID);
			ProjectReportEntryLogCollection entryList = new ProjectReportEntryLogCollection();

			// Separate Data into a collection of ProjectReportEntryLog.
			foreach(DataRow row in dsData.Tables[0].Rows)
			{
				ProjectReportEntryLog entry = new ProjectReportEntryLog();
				string firstName = string.Empty;
				string lastName = string.Empty;

				entry.UserName = row["UserName"].ToString();
				entry.Duration = Convert.ToDecimal(row["Duration"]);
				entry.UserID = Convert.ToInt32(row["UserID"]);
				entry.MinEntryDate = Convert.ToDateTime(row["MinEntryDate"]);	
				entry.MaxEntryDate = Convert.ToDateTime(row["MaxEntryDate"]);
				entry.FullName = TTUser.GetDisplayName(entry.UserName, ref firstName, ref lastName);

				entryList.Add(entry);
			}

			return entryList;
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -