Beispiel #1
0
        public static void Update(int ProjectGroupId, string Title, string Description)
        {
            if (!CanUpdate())
            {
                throw new AccessDeniedException();
            }

            DBProjectGroup.Update(ProjectGroupId, Title, Description);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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();
            }
        }
Beispiel #4
0
        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();
            }
        }
Beispiel #5
0
        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();
            }
        }
Beispiel #6
0
        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);
        }
Beispiel #7
0
        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);
        }
Beispiel #8
0
 //A.[ProjectGroupId], B.[Title]
 public static IDataReader ProjectGroupsGetByProject(int ProjectId)
 {
     return(DBProjectGroup.ProjectGroupsGetByProject(ProjectId));
 }
Beispiel #9
0
        /*
         *      [ProjectGroupId], [Title], [Description], [CreationDate], [CreatorId]
         */

        public static IDataReader GetProjectGroups(int ProjectGroupId)
        {
            return(DBProjectGroup.GetProjectGroup(ProjectGroupId, User.DefaultTimeZoneId));
        }
Beispiel #10
0
 public static DataTable GetProjectGroupsDT()
 {
     return(DBProjectGroup.GetProjectGroupsDT(User.DefaultTimeZoneId));
 }