示例#1
0
        private void ButtonSubmit_Click(object sender, EventArgs e)
        {
            using (var lDataContext = new IssueTrackerDataContext())
            {
                var lIssue = new Issue();
                lIssue.ProjectId = this.Project.Id;
                lIssue.Title = this.mTextBoxTitle.Text;
                lIssue.Body = this.mTextPreviewViewBody.Text;
                lIssue.CreationDateTime = DateTime.UtcNow;
                lIssue.LastUpdatedDateTime = DateTime.UtcNow;
                lIssue.OpenedByUser = lDataContext.CurrentUser;
                lIssue.IsOpen = true;
                lDataContext.Issues.InsertOnSubmit(lIssue);

                foreach (var lLabel in this.mSelectedLabels)
                {
                    var lIssueLabel = new IssueLabel();
                    lIssueLabel.Issue = lIssue;
                    lIssueLabel.LabelId = lLabel.Id;

                    lDataContext.IssueLabels.InsertOnSubmit(lIssueLabel);
                }

                lDataContext.SubmitChanges();

                this.IssueCreated.Fire(this, ReadOnlyValueEventArgs.Create(lIssue));
            }
        }
        public IssueDetailsControlHost(Issue issue)
        {
            if (issue == null) throw new ArgumentNullException("issue");

            InitializeComponent();

            this.Issue = issue;
        }
示例#3
0
        /// <summary>
        /// Update an existing issue
        /// </summary>
        // [RequiredPermission(Global.Constants.EmployeeRoleName)]
        public object Put(Issue request)
        {
            var issue = IssueRepository.Update(request);

            if (issue == null)
            {
                throw HttpError.Unauthorized("Updating issue {0} failed".Fmt(request.Id));
            }

            return new HttpResult(issue)
            {
                StatusCode = HttpStatusCode.NoContent,
                Headers =
                {
                    { HttpHeaders.Location, Request.AbsoluteUri.CombineWith(issue.Id) }
                }
            };
        }
示例#4
0
        /// <summary>
        /// Create a new issue
        /// </summary>
        public object Post(Issue request)
        {
            var issue = IssueRepository.Add(request);

            if (issue == null)
            {
                throw HttpError.Unauthorized("Creating a new issue failed");
            }

            return new HttpResult(issue)
            {
                StatusCode = HttpStatusCode.Created,
                Headers =
                {
                    { HttpHeaders.Location, Request.AbsoluteUri.CombineWith(issue.Id) }
                }
            };
        }
示例#5
0
        public object Delete(Issue request)
        {
            var result = IssueRepository.Delete(request.Id);

            if (!result)
            {
                throw HttpError.Unauthorized("Deleting issue {0} failed".Fmt(request.Id));
            }

            return new HttpResult
            {
                StatusCode = HttpStatusCode.NoContent,
                Headers =
                {
                    { HttpHeaders.Location, Request.AbsoluteUri }
                }
            };
        }
		private void detach_Issues1(Issue entity)
		{
			this.SendPropertyChanging();
			entity.AssignedUser = null;
		}
		private void detach_Issues(Issue entity)
		{
			this.SendPropertyChanging();
			entity.OpenedByUser = null;
		}
 partial void DeleteIssue(Issue instance);
 partial void UpdateIssue(Issue instance);
 partial void InsertIssue(Issue instance);
		private void detach_Issues(Issue entity)
		{
			this.SendPropertyChanging();
			entity.Project = null;
		}
		private void attach_Issues(Issue entity)
		{
			this.SendPropertyChanging();
			entity.Project = this;
		}
		private void detach_Issues(Issue entity)
		{
			this.SendPropertyChanging();
			entity.Milestone = null;
		}
		private void attach_Issues(Issue entity)
		{
			this.SendPropertyChanging();
			entity.Milestone = this;
		}
示例#15
0
        private void OpenIssue(Issue issue)
        {
            this.NavigationController.PopToControlHost(this);
            this.RefreshIssues();

            var lIssueDetailsControlHost = new IssueDetailsControlHost(issue);
            this.NavigationController.PushControlHost(lIssueDetailsControlHost);
        }