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

            DataAccess DALLayer = DataAccessHelper.GetDataAccess();

            return(DALLayer.GetTimeEntryById(timeEntryId));
        }
Exemple #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));
            }
        }
Exemple #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)
 {
 }