public static void Update(int ProjectGroupId, string Title, string Description) { if (!CanUpdate()) { throw new AccessDeniedException(); } DBProjectGroup.Update(ProjectGroupId, Title, Description); }
public static string GetProjectGroupTitle(int ProjectGroupId) { string ProjectGroupTitle = ""; using (IDataReader reader = DBProjectGroup.GetProjectGroup(ProjectGroupId, Security.CurrentUser.TimeZoneId)) { if (reader.Read()) { ProjectGroupTitle = reader["Title"].ToString(); } } return(ProjectGroupTitle); }
public static void Delete(int ProjectGroupId) { if (!CanDelete()) { throw new AccessDeniedException(); } using (DbTransaction tran = DbTransaction.Begin()) { //SendAlert(AlertEventType.Portfolio_Deleted, ProjectGroupId); DBProjectGroup.Delete(ProjectGroupId); tran.Commit(); } }
public static void RemoveProjectFromProjectGroup(int ProjectId, int ProjectGroupId) { if (!CanUpdate()) { throw new AccessDeniedException(); } using (DbTransaction tran = DbTransaction.Begin()) { //SendAlert(AlertEventType.Portfolio_ProjectDeleted, ProjectGroupId, ProjectId); DBProjectGroup.RemoveProjectFromProjectGroup(ProjectId, ProjectGroupId); tran.Commit(); } }
public static void AssignProjectGroup(int ProjectId, int ProjectGroupId) { if (!CanUpdate()) { throw new AccessDeniedException(); } using (DbTransaction tran = DbTransaction.Begin()) { DBProjectGroup.AssignProjectGroup(ProjectId, ProjectGroupId); //SendAlert(AlertEventType.Portfolio_ProjectNew, ProjectGroupId, ProjectId); tran.Commit(); } }
public static bool CanAdd() { bool IsEnabled = false; if (License.PortfolioCount >= 0) { DataTable dt = DBProjectGroup.GetProjectGroupsDT(Security.CurrentUser.TimeZoneId); IsEnabled = (dt.Rows.Count < License.PortfolioCount); } else { IsEnabled = true; } return(CanUpdate() && IsEnabled); }
public static int Create(string Title, string Description) { if (!CanAdd()) { throw new AccessDeniedException(); } int id; using (DbTransaction tran = DbTransaction.Begin()) { id = DBProjectGroup.Create(Title, Description, Security.CurrentUser.UserID, DateTime.UtcNow); //SendAlert(AlertEventType.Portfolio_New, id); tran.Commit(); } return(id); }
//A.[ProjectGroupId], B.[Title] public static IDataReader ProjectGroupsGetByProject(int ProjectId) { return(DBProjectGroup.ProjectGroupsGetByProject(ProjectId)); }
/* * [ProjectGroupId], [Title], [Description], [CreationDate], [CreatorId] */ public static IDataReader GetProjectGroups(int ProjectGroupId) { return(DBProjectGroup.GetProjectGroup(ProjectGroupId, User.DefaultTimeZoneId)); }
public static DataTable GetProjectGroupsDT() { return(DBProjectGroup.GetProjectGroupsDT(User.DefaultTimeZoneId)); }