Beispiel #1
0
        public static TimeEntry GetTimeEntryById(int timeEntryId)
        {
            if (timeEntryId <= DefaultValues.GetTimeEntryIdMinValue())
            {
                return(null);
            }

            DataAccess DALLayer = DataAccessHelper.GetDataAccess();

            return(DALLayer.GetTimeEntryById(timeEntryId));
        }
Beispiel #2
0
        public bool Save()
        {
            DataAccess DALLayer = DataAccessHelper.GetDataAccess();

            if (Id <= DefaultValues.GetProjectIdMinValue())
            {
                int TempId = DALLayer.CreateNewTimeEntry(this);
                if (TempId > DefaultValues.GetTimeEntryIdMinValue())
                {
                    _Id = TempId;
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(DALLayer.UpdateTimeEntry(this));
            }
        }
Beispiel #3
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)
 {
 }