Пример #1
0
 public void Add(BugStatus bugStatus)
 {
     _bugStatusRepository.Add(bugStatus);
 }
Пример #2
0
 public ActionResult EditIssue([ModelBinder(typeof(JsonBinder<BugViewModel>))]BugViewModel bugViewModel)
 {
     var json = new JsonResult();
     try
     {
         var bugStatus = _bugStatusLogic.Get(bugViewModel.BugStatusName,bugViewModel.ProjectId);
         if (bugStatus == null)
         {
             bugStatus = new BugStatus
             {
                 BugStatusName = bugViewModel.BugStatusName,
                 ProjectId = bugViewModel.ProjectId,
                 Number = 0
             };
             _bugStatusLogic.Add(bugStatus);
             bugStatus = _bugStatusLogic.Get(bugViewModel.BugStatusName, bugViewModel.ProjectId);
         }
         var bug=new Bug
             {
                 BugId = bugViewModel.BugId,
                 BugName = bugViewModel.BugName,
                 Description = bugViewModel.Description,
                 BugStatusId = bugStatus.BugStatusId,
                 UpdateTime = DateTime.Now,
                 UserId = bugViewModel.AssignerId
             };
         _bugLogic.Update(bug);
         json.Data = new { Status = true };
     }
     catch
     {
         json.Data = new { Status = false };
     }
     return json;
 }
Пример #3
0
 public ActionResult AddIssue([ModelBinder(typeof(JsonBinder<BugViewModel>))]BugViewModel bugViewModel)
 {
     var json = new JsonResult();
     try
     {
         var bugStatus = _bugStatusLogic.Get(bugViewModel.BugStatusName,bugViewModel.ProjectId);
         if (bugStatus == null)
         {
             bugStatus = new BugStatus
             {
                 BugStatusName = bugViewModel.BugStatusName,
                 ProjectId = bugViewModel.ProjectId,
                 Number = 0
             };
             _bugStatusLogic.Add(bugStatus);
             bugStatus = _bugStatusLogic.Get(bugViewModel.BugStatusName, bugViewModel.ProjectId);
         }
         var bug = new Bug
             {
                 BugName = bugViewModel.BugName,
                 Description = bugViewModel.Description,
                 UserId = bugViewModel.AssignerId,
                 BugStatusId = bugStatus.BugStatusId,
                 CreateDate = DateTime.Now,
                 UpdateTime = DateTime.Now,
                 Sole = Guid.NewGuid()
             };
         _bugLogic.Add(bug);
         var bugId = _bugLogic.Get(bug.BugName, bug.Sole).BugId;
         var userId = _cookieHelper.GetUserId(Request);
         var ioPath = Server.MapPath(Url.Content("~/Content/BugAttachments/"));
         var bugAttachmentsPath = ioPath + bugId;
         var tempPath = ioPath + userId + "_temp";
         if (System.IO.Directory.Exists(tempPath))
         {
             System.IO.Directory.Move(tempPath, bugAttachmentsPath);
         }
         json.Data = new { Status = true };
     }
     catch
     {
         json.Data = new { Status = false };
     }
     return json;
 }
Пример #4
0
 public void Add(BugStatus bugStatus)
 {
     _bugTrackDbContext.BugStatuses.Add(bugStatus);
     _bugTrackDbContext.SaveChanges();
 }