ProjectReportEntryLog.cs
上传用户:autodoor
上传日期:2022-08-04
资源大小:9973k
文件大小:2k
- using System;
- using System.Configuration;
- using System.Data;
- using qminoa.DA;
- namespace qminoa.BLL.PM
- {
- 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; }
- }
- public static ProjectReportEntryLogCollection GetEntrySummary(int categoryID)
- {
- DataSet dsData = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings["ConnectionString"],
- "PM_ListTimeEntriesByCategory", categoryID);
- ProjectReportEntryLogCollection entryList = new ProjectReportEntryLogCollection();
- 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 = entry.UserName;
- entryList.Add(entry);
- }
- return entryList;
- }
- }
- }