예제 #1
0
        /** INSTANCE METHODS **/

        public bool Save()
        {
            // Get the Display Name
            if (DisplayName.Trim() == String.Empty)
            {
                this.DisplayName = GetDisplayName(this.Username);
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            if (Id <= DefaultValues.GetUserIdMinValue())
            {
                int TempId = DBLayer.CreateNewUser(this);
                if (TempId > 0)
                {
                    _Id = TempId;
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(DBLayer.UpdateUser(this));
            }
        }
예제 #2
0
        /*** STATIC METHODS ***/

        public static bool SaveQuery(string username, int projectId, string queryName, QueryClauseCollection queryClauses)
        {
            if (username == null || username.Length == 0)
            {
                throw new ArgumentOutOfRangeException("username");
            }

            if (projectId <= DefaultValues.GetProjectIdMinValue())
            {
                throw new ArgumentOutOfRangeException("projectId");
            }

            if (queryName == null || queryName.Length == 0)
            {
                throw new ArgumentOutOfRangeException("queryName");
            }

            if (queryClauses.Count == 0)
            {
                throw new ArgumentOutOfRangeException("queryClauses");
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.SaveQuery(username, projectId, queryName, queryClauses));
        }
예제 #3
0
        /** CONSTRUCTORS **/

        public Issue(int id, int projectId, string title, int categoryId, int milestoneId, int priorityId, int statusId, int assignedId, int ownerId, string creatorUsername)
            : this
            (
                id,
                projectId,
                title,
                categoryId,
                String.Empty,
                milestoneId,
                String.Empty,
                String.Empty,
                priorityId,
                String.Empty,
                String.Empty,
                statusId,
                String.Empty,
                String.Empty,
                String.Empty,
                assignedId,
                String.Empty,
                ownerId,
                creatorUsername,
                DefaultValues.GetUserIdMinValue(),
                creatorUsername,
                DefaultValues.GetDateTimeMinValue()
            )
        {
        }
예제 #4
0
        public static IssueCollection PerformSavedQuery(int projectId, int queryId)
        {
            if (queryId <= DefaultValues.GetQueryIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("queryId"));
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.PerformSavedQuery(projectId, queryId));
        }
예제 #5
0
        public static Issue GetIssueById(int issueId)
        {
            if (issueId <= DefaultValues.GetIssueIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("issueId"));
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.GetIssueById(issueId));
        }
예제 #6
0
        public static CustomFieldCollection GetCustomFieldsByIssueId(int issueId)
        {
            if (issueId <= DefaultValues.GetProjectIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("issueId"));
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.GetCustomFieldsByIssueId(issueId));
        }
예제 #7
0
        public static bool DeletePriority(int priorityId)
        {
            if (priorityId <= DefaultValues.GetPriorityIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("priorityId"));
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.DeletePriority(priorityId));
        }
예제 #8
0
        public static bool DeleteStatus(int statusId)
        {
            if (statusId <= DefaultValues.GetStatusIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("statusId"));
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.DeleteStatus(statusId));
        }
예제 #9
0
        /*** STATIC METHODS ***/

        public static bool DeleteMilestone(int milestoneId)
        {
            if (milestoneId <= DefaultValues.GetMilestoneIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("milestoneId"));
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.DeleteMilestone(milestoneId));
        }
예제 #10
0
        public static MilestoneCollection GetMilestoneByProjectId(int milestoneId)
        {
            if (milestoneId <= DefaultValues.GetMilestoneIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("milestoneId"));
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.GetMilestoneByProjectId(milestoneId));
        }
예제 #11
0
        /*** STATIC METHODS ***/

        public static bool DeleteCategory(int categoryId)
        {
            if (categoryId <= DefaultValues.GetCategoryIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("categoryId"));
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.DeleteCategory(categoryId));
        }
예제 #12
0
        public static CategoryCollection GetCategoryByProjectId(int projectId)
        {
            if (projectId <= DefaultValues.GetProjectIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("projectId"));
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.GetCategoriesByProjectId(projectId));
        }
예제 #13
0
        /*** STATIC METHODS  ***/

        public static bool DeleteIssueNotification(int issueId, string username)
        {
            if (issueId <= DefaultValues.GetIssueIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("issueId"));
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.DeleteIssueNotification(issueId, username));
        }
예제 #14
0
        public static bool DeleteQuery(int queryId)
        {
            if (queryId <= DefaultValues.GetQueryIdMinValue())
            {
                throw new ArgumentOutOfRangeException("queryId");
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.DeleteQuery(queryId));
        }
예제 #15
0
        /*** STATIC METHODS  ***/

        public static IssueHistoryCollection GetIssueHistoryByIssueId(int issueId)
        {
            // validate input
            if (issueId <= DefaultValues.GetIssueIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("issueId"));
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.GetIssueHistoryByIssueId(issueId));
        }
예제 #16
0
        /*** CONSTRUCTOR ***/

        public IssueHistory(int historyId, int issueId, string creatorDisplayName, DateTime dateCreated)
        {
            if (issueId <= DefaultValues.GetIssueIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("IssueId"));
            }

            _Id                 = historyId;
            _IssueId            = issueId;
            _CreatorDisplayName = creatorDisplayName;
            _DateCreated        = dateCreated;
        }
예제 #17
0
        public static void DeleteIssueAttachment(int attachmentId)
        {
            // validate input
            if (attachmentId <= DefaultValues.GetIssueAttachmentIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("attachmentId"));
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            DBLayer.DeleteIssueAttachment(attachmentId);
        }
예제 #18
0
        /*** STATIC METHODS ***/

        public static bool DeleteProject(int projectId)
        {
            // validate input
            if (projectId <= DefaultValues.GetProjectIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("projectId"));
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.DeleteProject(projectId));
        }
예제 #19
0
        public IssueNotification(int notificationId, int issueId, string notificationUsername, string notificationDisplayName, string notificationEmail)
        {
            if (issueId <= DefaultValues.GetIssueIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("IssueId"));
            }

            _Id      = notificationId;
            _IssueId = issueId;
            _NotificationUsername    = notificationUsername;
            _NotificationDisplayName = notificationDisplayName;
            _NotificationEmail       = notificationEmail;
        }
예제 #20
0
        public static bool DeleteParentIssue(int primaryIssueId, int secondaryIssueId)
        {
            if (primaryIssueId <= DefaultValues.GetIssueIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("primaryIssueId"));
            }

            if (secondaryIssueId <= DefaultValues.GetIssueIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("secondaryIssueId"));
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.DeleteParentIssue(primaryIssueId, secondaryIssueId));
        }
예제 #21
0
        public static QueryCollection GetQueriesByUsername(string username, int projectId)
        {
            if (username == null || username.Length == 0)
            {
                throw new ArgumentOutOfRangeException("username");
            }

            if (projectId <= DefaultValues.GetProjectIdMinValue())
            {
                throw new ArgumentOutOfRangeException("projectId");
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.GetQueriesByUsername(username, projectId));
        }
예제 #22
0
        public static IssueCollection GetIssuesByOwnerUsername(int projectId, string username)
        {
            if (projectId <= DefaultValues.GetProjectIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("projectId"));
            }

            if (username == null || username.Length == 0)
            {
                throw (new ArgumentOutOfRangeException("username"));
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.GetIssuesByOwnerUsername(projectId, username));
        }
예제 #23
0
        /*** INSTANCE METHODS  ***/

        public bool Save()
        {
            if (Id > DefaultValues.GetProjectIdMinValue())
            {
                throw new ArgumentOutOfRangeException("categoryId");
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();
            int TempId = DBLayer.CreateNewCategory(this);

            if (TempId > 0)
            {
                _Id = TempId;
                return(true);
            }
            return(false);
        }
예제 #24
0
        public Milestone(int id, int projectId, string name, string imageUrl)
        {
            if (projectId <= DefaultValues.GetProjectIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("projectId"));
            }

            if (name == null || name.Length == 0)
            {
                throw (new ArgumentOutOfRangeException("name"));
            }

            _Id        = id;
            _ProjectId = projectId;
            _Name      = name;
            _ImageUrl  = imageUrl;
        }
예제 #25
0
        public IssueComment(int commentId, int issueId, string comment, string creatorUsername, string creatorDisplayName, DateTime created)
        {
            if (comment == null || comment.Length == 0)
            {
                throw (new ArgumentOutOfRangeException("comment"));
            }

            if (issueId <= DefaultValues.GetIssueIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("IssueId"));
            }

            _Id                 = commentId;
            _IssueId            = issueId;
            _CreatorUsername    = creatorUsername;
            _CreatorDisplayName = creatorDisplayName;
            _Comment            = comment;
            _DateCreated        = created;
        }
예제 #26
0
        public static int CreateNewChildIssue(int primaryIssueId, int secondaryIssueId)
        {
            if (primaryIssueId == secondaryIssueId)
            {
                return(0);
            }

            if (primaryIssueId <= DefaultValues.GetIssueIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("primaryIssueId"));
            }

            if (secondaryIssueId <= DefaultValues.GetIssueIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("secondaryIssueId"));
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.CreateNewChildIssue(primaryIssueId, secondaryIssueId));
        }
예제 #27
0
        public bool Save()
        {
            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            if (Id <= DefaultValues.GetProjectIdMinValue())
            {
                int TempId = DBLayer.CreateNewProject(this);
                if (TempId > 0)
                {
                    _Id = TempId;
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(DBLayer.UpdateProject(this));
            }
        }
예제 #28
0
        public static void SendIssueNotifications(int issueId)
        {
            // validate input
            if (issueId <= DefaultValues.GetIssueIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("issueId"));
            }

            DataAccessLayerBaseClass    DBLayer          = DataAccessLayerBaseClassHelper.GetDataAccessLayer();
            IssueNotificationCollection issNotifications = DBLayer.GetIssueNotificationsByIssueId(issueId);

            System.Web.Mail.SmtpMail.SmtpServer = Globals.SmtpServer;

            string notifyEmail       = Globals.NotifyEmail;
            string desktopDefaultUrl = Globals.DesktopDefaultUrl;

            foreach (IssueNotification notify in issNotifications)
            {
                try {
                    System.Web.Mail.SmtpMail.Send(notifyEmail, notify.NotificationEmail, String.Format("Issue {0} has been updated", issueId), String.Format("The following issue has been updated: \n\n {0}Issues/IssueDetail.aspx?id={1}", desktopDefaultUrl, issueId));
                } catch {}
            }
        }
예제 #29
0
        /*** INSTANCE METHODS ***/



        public bool Save()
        {
            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            if (Id <= DefaultValues.GetIssueIdMinValue())
            {
                int TempId = DBLayer.CreateNewIssue(this);
                if (TempId > 0)
                {
                    _Id = TempId;
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                bool result = DBLayer.UpdateIssue(this);
                IssueNotification.SendIssueNotifications(Id);
                return(result);
            }
        }
예제 #30
0
 public Category(int projectId, int parentCategoryId, string name)
     : this(DefaultValues.GetCategoryIdMinValue(), projectId, parentCategoryId, name)
 {
 }