/// <summary>
 /// Create a new Issue object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="projectId">Initial value of the ProjectId property.</param>
 /// <param name="subject">Initial value of the Subject property.</param>
 /// <param name="statusId">Initial value of the StatusId property.</param>
 /// <param name="priorityId">Initial value of the PriorityId property.</param>
 /// <param name="authorId">Initial value of the AuthorId property.</param>
 /// <param name="createdOn">Initial value of the CreatedOn property.</param>
 /// <param name="doneRatio">Initial value of the DoneRatio property.</param>
 /// <param name="trackerId">Initial value of the TrackerId property.</param>
 public static Issue CreateIssue(global::System.Int32 id, global::System.Int32 projectId, global::System.String subject, global::System.Int32 statusId, global::System.Int32 priorityId, global::System.Guid authorId, global::System.DateTime createdOn, global::System.Int32 doneRatio, global::System.Int32 trackerId)
 {
     Issue issue = new Issue();
     issue.Id = id;
     issue.ProjectId = projectId;
     issue.Subject = subject;
     issue.StatusId = statusId;
     issue.PriorityId = priorityId;
     issue.AuthorId = authorId;
     issue.CreatedOn = createdOn;
     issue.DoneRatio = doneRatio;
     issue.TrackerId = trackerId;
     return issue;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Issues EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToIssues(Issue issue)
 {
     base.AddObject("Issues", issue);
 }
        public void ExecuteEditIssue(Issue issue)
        {
            /* var viewModel = _container.Resolve<EditIssueFormViewModel>();
            viewModel.CurrentIssue = issue;
            viewModel.IsNew = false;
            var window = _container.Resolve<IModalWindow>("editissueform");
            _modalDialogService.ShowDialog(window, viewModel,
                                           formViewModel =>
                                               {
                                                   if (!window.DialogResult.HasValue ||
                                                       !window.DialogResult.Value) return;

                                                   var index = Issues.IndexOf(issue);
                                                   Issues[index] = formViewModel.CurrentIssue;
                                                   _context.SubmitChanges();
                                                   RaisePropertyChanged("Issues");
                                               }
                );*/
        }
 public void ExecuteIssueNavigate(Issue issue)
 {
     if (issue.Id == 0) return;
     var regionManager = _container.Resolve<RegionManager>();
     var query = new UriQuery {{"issue", issue.Id.ToString()}};
     regionManager.RequestNavigate("MainRegion", new Uri("IssueView" + query, UriKind.Relative));
 }
 public void ExecuteDeleteIssue(Issue issue)
 {
     var message = string.Format("Are you sure you want delete issue '{0}'", issue.Subject);
     var result = _messageBoxService.Show(message, "Confirm deleting", GenericMessageBoxButton.OkCancel);
     if (result == GenericMessageBoxResult.Cancel) return;
     _context.Issues.Remove(issue);
     _context.SubmitChanges();
     LoadData();
 }