private void SaveComment() { var c = new GoalCommunication(); c.DateCreated = DateTime.Now; c.EnteredBy = SecurityContextManager.Current.CurrentUser.ID; c.GoalID = CurrentGoal.ID; c.Message = tbNewComment.Text; new GoalCommunicationServices().Save(c); HttpPageHelper.UpdateTabs(this); var a = new Activity(); a.AccountID = CurrentProfile.AccountID; a.ActivityType = (int)ActivityType.NEW_GOAL_COMMENT; a.DateCreated = DateTime.Now; a.URL = "/Goals/" + CurrentGoal.ID.ToString(); a.PerformedBy = c.EnteredBy; a.PerformedFor = CurrentProfile.ID; new ActivityServices().Save(a); string emails = ""; foreach (var m in CurrentGoal.Managers) { if (m.RecievesNotifications) { emails += m.PersonRef.Email + ","; } } EmailHelper.SendGoalCommentUpdateNotification(CurrentGoal, emails); }
protected void AddMilestoneClicked(object o, EventArgs e) { //divMilestoneContainer.Controls.Clear(); //Control c = LoadControl("/Views/GoalMilestoneView.ascx"); //c.ID = "milestones" + MilestoneControls.Count.ToString(); //MilestoneControls = null; //MilestoneControls.Add((HRR.Website.Views.GoalMilestoneView)c); //divMilestoneContainer.Controls.Add(c); //CreateUserControl("lbAddNewMilestone"); var ms = new GoalMilestone(); ms.AccountID = SecurityContextManager.Current.CurrentUser.AccountID; ms.ChangedBy = SecurityContextManager.Current.CurrentUser.ID; ms.DateCreated = DateTime.Now; ms.Description = tbMilestoneDescription.Text; ms.DueDate = (DateTime)tbMilestoneDueDate.SelectedDate; ms.EnteredBy = SecurityContextManager.Current.CurrentUser.ID; ms.EnteredFor = CurrentProfile.ID; ms.GoalID = CurrentGoal.ID; ms.IsAccepted = true; ms.IsComplete = false; ms.LastUpdated = DateTime.Now; ms.Status = (int)GoalStatus.ACCEPTED; ms.Title = tbMilestoneTitle.Text; new GoalMilestoneServices().Save(ms); HttpPageHelper.UpdateTabs(this); tbMilestoneTitle.Text = ""; tbMilestoneDueDate.SelectedDate = null; tbMilestoneDueDate.DateInput.Text = ""; tbMilestoneDescription.Text = ""; LoadMilestones(true); }
protected void SaveMilestoneClicked(object o, EventArgs e) { SaveMilestone(); HttpPageHelper.UpdateTabs((HRR.Website.Goal) this.Parent.Page); }