public ActionResult EnableArchive(string applicationId, int keepLatestVersions) { var versions = _applicationVersionBusiness.GetApplicationVersions(Guid.Parse(applicationId)).ToArray(); var versionsToArchive = versions.OrderBy(x => x.Version).Take(versions.Count() - keepLatestVersions).ToArray(); var model = new EnableArchiveModel() { VersionsToArchive = versionsToArchive, Application = applicationId, InitiativeId = _initiativeBusiness.GetInitiativeByApplication(Guid.Parse(applicationId)).Id.ToString() }; return(View(model)); }
public JsonResult Issues() { var userEmail = _accountRepository.FindById(User.Identity.GetUserId()).Email; var issueTypes = _issueBusiness.GetIssueTypesForDeveloper(userEmail).ToArray(); var fiveIssues = _issueBusiness.GetFiveLatestErrorIssusByIssueTypes(issueTypes).ToArray(); var selectedIssueTypes = fiveIssues.SelectMany(x => issueTypes.Where(y => y.Issues.Contains(x))).Distinct().ToArray(); var list = new List <object>(); foreach (var issueType in selectedIssueTypes) { foreach (var issue in fiveIssues) { if (issueType.Issues.Any(x => x.Id == issue.Id)) { var version = _applicationVersionBusiness.GetApplicationVersionByIssue(issue.Id); var application = _initiativeBusiness.GetApplicationByVersion(version.Id); list.Add(new { IssueTypeName = issueType.ExceptionTypeName, IssueTypeLevel = issueType.IssueLevel.ToString(), IssueTimeAgo = issue.ServerTime.ToLocalTime().ToTimeAgo(), IssueTime = issue.ServerTime.ToLocalTime().ToDateTimeString(), IssueVisible = issue.VisibleToUser.ToString(), IssueTypeTicket = issueType.Ticket, IssueTicket = issue.Ticket, ApplicationVersion = version.Id, ApplicationName = application.Name, InitativeId = _initiativeBusiness.GetInitiativeByApplication(application.Id).Id.ToString(), }); } } } var response = Json(list, JsonRequestBehavior.AllowGet); return(response); }