public static List <UserReport> GetUserReportsByProjectId(int projectId) { if (projectId <= DefaultValues.GetProjectIdMinValue()) { return(new List <UserReport>()); } DataAccess DALLayer = DataAccessHelper.GetDataAccess(); return(DALLayer.GetUserReportsByProjectId(projectId)); }
public static Category GetCategoryByCategoryNameandProjectId(string categoryName, int projectId) { if (projectId <= DefaultValues.GetProjectIdMinValue() || String.IsNullOrEmpty(categoryName)) { return(null); } DataAccess DALLayer = DataAccessHelper.GetDataAccess(); return(DALLayer.GetCategoryByCategoryNameandProjectId(categoryName, projectId)); }
public static List <string> GetProjectMembers(int Id) { if (Id <= DefaultValues.GetProjectIdMinValue()) { return(new List <string>()); } DataAccess DALLayer = DataAccessHelper.GetDataAccess(); return(DALLayer.GetProjectMembers(Id)); }
public static List <Category> GetCategoriesByProjectId(int projectId) { if (projectId <= DefaultValues.GetProjectIdMinValue()) { return(new List <Category>()); } DataAccess DALLayer = DataAccessHelper.GetDataAccess(); return(DALLayer.GetCategoriesByProjectId(projectId)); }
public static Project GetProjectById(int Id) { if (Id <= DefaultValues.GetProjectIdMinValue()) { return(null); } DataAccess DALLayer = DataAccessHelper.GetDataAccess(); return(DALLayer.GetProjectById(Id)); }
public static bool DeleteProject(int Id) { if (Id <= DefaultValues.GetProjectIdMinValue()) { throw (new ArgumentOutOfRangeException("Id")); } DataAccess DALLayer = DataAccessHelper.GetDataAccess(); return(DALLayer.DeleteProject(Id)); }
/*** METHODS ***/ public bool Delete() { if (this.Id > DefaultValues.GetProjectIdMinValue()) { DataAccess DALLayer = DataAccessHelper.GetDataAccess(); return(DALLayer.DeleteTimeEntry(this.Id)); } else { return(false); } }
public static List <TimeEntry> GetTimeEntries(int projectId, string userName) { if (projectId <= DefaultValues.GetProjectIdMinValue()) { return(new List <TimeEntry>()); } if (String.IsNullOrEmpty(userName)) { return(new List <TimeEntry>()); } DataAccess DALLayer = DataAccessHelper.GetDataAccess(); return(DALLayer.GetTimeEntries(projectId, userName)); }
public static bool RemoveUserFromProject(int projectId, string userName) { if (projectId <= DefaultValues.GetProjectIdMinValue()) { throw (new ArgumentOutOfRangeException("projectId")); } if (String.IsNullOrEmpty(userName)) { throw (new NullReferenceException("userName")); } DataAccess DALLayer = DataAccessHelper.GetDataAccess(); return(DALLayer.RemoveUserFromProject(projectId, userName)); }
public Category(string abbreviation, decimal actualDuration, int id, decimal estimateDuration, string name, int projectId) { if (String.IsNullOrEmpty(name)) { throw (new NullReferenceException("name")); } if (projectId <= DefaultValues.GetProjectIdMinValue()) { throw (new ArgumentOutOfRangeException("projectId")); } _Abbreviation = abbreviation; _ActualDuration = actualDuration; _Id = id; _EstimateDuration = estimateDuration; _Name = name; _ProjectId = projectId; }
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)); } }
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) { }