コード例 #1
0
        public TimeEntry(string creatorUserName, int categoryId, DateTime dateCreated, string description, decimal duration, int id, DateTime reportedDate, string userName)
        {
            if (String.IsNullOrEmpty(creatorUserName))
            {
                throw (new NullReferenceException("creatorUserName"));
            }

            if (categoryId <= DefaultValues.GetCategoryIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("categoryId"));
            }

            if (duration <= DefaultValues.GetDurationMinValue())
            {
                throw (new ArgumentOutOfRangeException("duration"));
            }

            if (reportedDate <= DefaultValues.GetDateTimeMinValue())
            {
                throw (new ArgumentOutOfRangeException("reportedDate"));
            }

            if (String.IsNullOrEmpty(userName))
            {
                throw (new NullReferenceException("userName"));
            }


            _CreatorUserName = creatorUserName;
            _CategoryId      = categoryId;
            _DateCreated     = dateCreated;
            _Description     = description;
            _Duration        = duration;
            _Id           = id;
            _ReportedDate = reportedDate;
            _UserName     = userName;
        }
コード例 #2
0
 /*** CONSTRUCTOR ***/
 public TimeEntry(string creatorUserName, int categoryId, decimal duration, DateTime reportedDate, string userName)
     : this(creatorUserName, categoryId, DefaultValues.GetDateTimeMinValue(), string.Empty, duration, DefaultValues.GetTimeEntryIdMinValue(), reportedDate, userName)
 {
 }
コード例 #3
0
 public Project(string creatorUsername, string description, int id, string managerUserName, string name)
     : this(DefaultValues.GetDurationMinValue(), creatorUsername, DefaultValues.GetDateTimeMinValue(), DefaultValues.GetDateTimeMinValue(), string.Empty, DefaultValues.GetProjectDurationMinValue(), DefaultValues.GetProjectIdMinValue(), managerUserName, name)
 {
 }