public async Task HandleAsync(BugAddedToTask @event) { var task = await taskRepository.GetAsync(@event.TaskId); var project = await projectRepository.GetAsync(task.ProjectId); var bug = new Models.Bug(@event.BugId) { ProjectId = @event.ProjectId, Title = @event.Title, Description = @event.Description, CreatedAt = @event.CreatedAt, Status = IssueStatus.Todo, Labels = await labelSearcher.GetLabels(@event.LabelsIds.ToList()), Reporter = await userRepository.GetAsync(@event.ReporterId), Assignee = @event.AssigneeId.HasValue ? await userRepository.GetAsync(@event.AssigneeId.Value) : null }; task.Bugs.Add(bug); project.Bugs.Add(bug); await taskRepository.Update(task); await projectRepository.Update(project); }
public OpenBug(string details) { Id = Guid.NewGuid(); NewBug = new Models.Bug(); NewBug.Description = details; NewBug.Fixed = false; }
public void Update(Models.Bug model) { var appDbEntity = _appRepository.Get(model.Version); var appModel = AppFactory.Create(appDbEntity); model.App = appModel; var entity = BugFactory.Create(model); _bugRepository.Update(entity); }
public ActionResult BugCreateForm(Models.Bug bu) { ViewBag.Summary = Request.Form["Summary"]; ViewBag.Description = Request.Form["Description"]; ViewBag.AssignedID = Request.Form["userAssigned"]; ViewBag.PriorityID = Request.Form["PrioritySelected"]; ViewBag.UserName = User.Identity.Name; Int32.TryParse(ViewBag.PriorityID, out int PriorityID); BugData dataService = new BugData(); dataService.CreateNewBug(ViewBag.AssignedID, ViewBag.Summary, ViewBag.Description, ViewBag.UserName, PriorityID); return(RedirectToAction("CurrentBugs", "Bug")); }
public ActionResult ViewBug(Models.Bug bu) { ViewBag.Description = Request.Form["Description"]; ViewBag.StatusID = Request.Form["Status"]; ViewBag.AssignedID = (Request.Form["Assigned"] == "" ? null : Request.Form["Assigned"]); ViewBag.Summary = Request.Form["Summary"]; ViewBag.PriorityID = Request.Form["Priority"]; ViewBag.UpdateUserName = User.Identity.Name; Int32.TryParse(ViewBag.StatusID, out int StatusID); Int32.TryParse(ViewBag.PriorityID, out int PriorityID); BugData dataService = new BugData(); dataService.SaveSpecificBug(bu.BugID, ViewBag.Summary, ViewBag.Description, StatusID, ViewBag.AssignedID, ViewBag.UpdateUserName, PriorityID); return(ViewBug(bu.BugID)); }
public ActionResult Comment(Models.Bug bu) { ViewBag.Comment = Request.Form["CommentText"]; ViewBag.UserName = User.Identity.Name; BugData dataService = new BugData(); dataService.CreateNewBugComment(ViewBag.UserName, ViewBag.Comment, bu.BugID); string subject = "#INC-" + bu.BugID + " Comment Added"; if (bu.Assigned != "") { string Message = CreateHTMLBody(bu.BugID, ViewBag.UserName + " added a note: " + ViewBag.Comment); SendEmail(bu.Assigned, subject, Message); } return(ViewBug(bu.BugID)); }