public static TimeEntry GetTimeEntryById(int timeEntryId) { if (timeEntryId <= DefaultValues.GetTimeEntryIdMinValue()) { return(null); } DataAccess DALLayer = DataAccessHelper.GetDataAccess(); return(DALLayer.GetTimeEntryById(timeEntryId)); }
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)); } }
/*** 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) { }