/** 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)); } }
/*** 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)); }
/** 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() ) { }
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)); }
public static Issue GetIssueById(int issueId) { if (issueId <= DefaultValues.GetIssueIdMinValue()) { throw (new ArgumentOutOfRangeException("issueId")); } DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer(); return(DBLayer.GetIssueById(issueId)); }
public static CustomFieldCollection GetCustomFieldsByIssueId(int issueId) { if (issueId <= DefaultValues.GetProjectIdMinValue()) { throw (new ArgumentOutOfRangeException("issueId")); } DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer(); return(DBLayer.GetCustomFieldsByIssueId(issueId)); }
public static bool DeletePriority(int priorityId) { if (priorityId <= DefaultValues.GetPriorityIdMinValue()) { throw (new ArgumentOutOfRangeException("priorityId")); } DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer(); return(DBLayer.DeletePriority(priorityId)); }
public static bool DeleteStatus(int statusId) { if (statusId <= DefaultValues.GetStatusIdMinValue()) { throw (new ArgumentOutOfRangeException("statusId")); } DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer(); return(DBLayer.DeleteStatus(statusId)); }
/*** STATIC METHODS ***/ public static bool DeleteMilestone(int milestoneId) { if (milestoneId <= DefaultValues.GetMilestoneIdMinValue()) { throw (new ArgumentOutOfRangeException("milestoneId")); } DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer(); return(DBLayer.DeleteMilestone(milestoneId)); }
public static MilestoneCollection GetMilestoneByProjectId(int milestoneId) { if (milestoneId <= DefaultValues.GetMilestoneIdMinValue()) { throw (new ArgumentOutOfRangeException("milestoneId")); } DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer(); return(DBLayer.GetMilestoneByProjectId(milestoneId)); }
/*** STATIC METHODS ***/ public static bool DeleteCategory(int categoryId) { if (categoryId <= DefaultValues.GetCategoryIdMinValue()) { throw (new ArgumentOutOfRangeException("categoryId")); } DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer(); return(DBLayer.DeleteCategory(categoryId)); }
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)); }
public static bool DeleteQuery(int queryId) { if (queryId <= DefaultValues.GetQueryIdMinValue()) { throw new ArgumentOutOfRangeException("queryId"); } DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer(); return(DBLayer.DeleteQuery(queryId)); }
/*** 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)); }
/*** 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; }
public static void DeleteIssueAttachment(int attachmentId) { // validate input if (attachmentId <= DefaultValues.GetIssueAttachmentIdMinValue()) { throw (new ArgumentOutOfRangeException("attachmentId")); } DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer(); DBLayer.DeleteIssueAttachment(attachmentId); }
/*** 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; }
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)); }
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)); }
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)); }
/*** 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); }
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; }
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; }
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)); }
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 {} } }
/*** 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); } }
public Category(int projectId, int parentCategoryId, string name) : this(DefaultValues.GetCategoryIdMinValue(), projectId, parentCategoryId, name) { }