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

            DataAccessLayerBaseClass DBLayer = DataAccessLayerBaseClassHelper.GetDataAccessLayer();

            return(DBLayer.GetCategoriesByProjectId(projectId));
        }
Esempio n. 3
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. 4
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));
        }
Esempio n. 5
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. 6
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. 7
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. 8
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. 9
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));
            }
        }
Esempio n. 10
0
 public Category(string name, int categoryId)
     : this(categoryId, DefaultValues.GetProjectIdMinValue(), DefaultValues.GetCategoryIdMinValue(), name)
 {
 }
Esempio n. 11
0
 public CustomField(int id, string value)
     : this(id, DefaultValues.GetProjectIdMinValue(), String.Empty, ValidationDataType.String, false, value)
 {
 }