コード例 #1
0
        /*[PrincipalPermission(SecurityAction.Demand, Role = "ADMIN")]*/
        public void DeleteBug(Bug bug)
        {
            BugRepository repo = new BugRepository();
            repo.Delete(bug);

            BugActionLogger.LogEvent(bug.Project, GetMyUser(), BugActionLogger.Delete_Action, bug);
        }
コード例 #2
0
        public Bug AddBug(Bug bug)
        {
            bug.DateFound = DateTime.Now;
            bug.LastModified = DateTime.Now;

            var savedbug = new BugRepository().Create(bug);

            BugActionLogger.LogEvent(bug.Project, GetMyUser(), BugActionLogger.Create_Action, savedbug);

            return savedbug;
        }
コード例 #3
0
        public IList<Bug> SearchAllProjectBugsAttributes(Project project, string searchText)
        {
            searchText = searchText.Trim();

               // if (searchText == null || searchText == "")
             //   return GetBugsByProject(project);

            IList<int> associatedUserIds = new UserRepository().GetAll().FullTextSearch(searchText, true).Select(p => p.Id).ToList();
            IList<int> fullTextSearch    = new BugRepository() .GetAll().FullTextSearch(searchText, true).Select(p => p.Id).ToList();

            if (associatedUserIds.Count == 0 && fullTextSearch.Count == 0)
                return new List<Bug>();

            int id = 0;
            DateTime date = DateTime.MinValue;

            try { id = Int32.Parse(searchText); }
            catch (Exception e) { Console.WriteLine(e.Message); }

            try { date = DateTime.Parse(searchText); }
            catch (Exception e) { Console.WriteLine(e.Message); }

            return new BugRepository().GetAll()
                    .Where(p => associatedUserIds.Contains(p.AssignedUser.Id) ||
                                associatedUserIds.Contains(p.CreatedBy.Id) ||
                                p.Id == id ||
                                (p.DateFound.Year == date.Year && p.DateFound.Month == date.Month && p.DateFound.Day == date.Day) ||
                                (p.LastModified.Year == date.Year && p.LastModified.Month == date.Month && p.LastModified.Day == date.Day) ||
                                fullTextSearch.Contains(p.Id)).Where(p => p.Project.Id == project.Id).ToList();
        }
コード例 #4
0
        public Bug SaveBug(Bug bug)
        {
            bug.LastModified = DateTime.Now;

            BugRepository bugRepo = new BugRepository();

            var savedbug = bugRepo.Update(bug);

            BugActionLogger.LogEvent(bug.Project, GetMyUser(), BugActionLogger.Update_Action, savedbug);

            return bug;
        }
コード例 #5
0
        public List<Bug> GetBugsByProject(Project project)
        {
            BugRepository bugRepo = new BugRepository();

            List<Bug> bugList = bugRepo.GetAll().Where(x => x.Project.Id == project.Id).ToList();

            return bugList;
        }
コード例 #6
0
        public List<Bug> GetAllBugs()
        {
            BugRepository repo = new BugRepository();
            List<Bug> bugList = repo.GetAll().ToList();

            return bugList;
        }