Esempio n. 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));
            }
        }
Esempio n. 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));
        }
Esempio n. 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()
            )
        {
        }
Esempio n. 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));
        }
Esempio n. 5
0
        public static Issue GetIssueById(int issueId)
        {
            if (issueId <= DefaultValues.GetIssueIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("issueId"));
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

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

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

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

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

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

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.DeleteStatus(statusId));
        }
Esempio n. 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));
        }
Esempio n. 10
0
        public static MilestoneCollection GetMilestoneByProjectId(int milestoneId)
        {
            if (milestoneId <= DefaultValues.GetMilestoneIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("milestoneId"));
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.GetMilestoneByProjectId(milestoneId));
        }
Esempio n. 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));
        }
Esempio n. 12
0
        public static CategoryCollection GetCategoryByProjectId(int projectId)
        {
            if (projectId <= DefaultValues.GetProjectIdMinValue())
            {
                throw (new ArgumentOutOfRangeException("projectId"));
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.GetCategoriesByProjectId(projectId));
        }
        /*** 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));
        }
Esempio n. 14
0
        public static bool DeleteQuery(int queryId)
        {
            if (queryId <= DefaultValues.GetQueryIdMinValue())
            {
                throw new ArgumentOutOfRangeException("queryId");
            }

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.DeleteQuery(queryId));
        }
Esempio n. 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));
        }
Esempio n. 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;
        }
Esempio n. 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);
        }
Esempio n. 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));
        }
        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;
        }
Esempio n. 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));
        }
Esempio n. 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));
        }
Esempio n. 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));
        }
Esempio n. 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);
        }
Esempio n. 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;
        }
Esempio n. 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;
        }
Esempio n. 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));
        }
Esempio n. 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));
            }
        }
        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 {}
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 30
0
 public Category(int projectId, int parentCategoryId, string name)
     : this(DefaultValues.GetCategoryIdMinValue(), projectId, parentCategoryId, name)
 {
 }