Пример #1
0
        private void SaveMilestone()
        {
            var m = new GoalMilestone();

            if (Milestone != null)
            {
                m = Milestone;
            }
            else
            {
                m.DateCreated = DateTime.Now;
                m.EnteredBy   = SecurityContextManager.Current.CurrentUser.ID;
            }
            m.ChangedBy          = SecurityContextManager.Current.CurrentUser.ID;
            m.LastUpdated        = DateTime.Now;
            m.AccountID          = SecurityContextManager.Current.CurrentAccount.ID;
            m.Description        = tbDescription.Text;
            m.DueDate            = (DateTime)tbMilestoneDueDate.SelectedDate;
            m.EmployeeEvaluation = tbSelfEvaluation.Text;
            m.EnteredFor         = ((HRR.Website.Goal) this.Parent.Page).CurrentProfile.ID;
            m.GoalID             = ((HRR.Website.Goal) this.Parent.Page).CurrentGoal.ID;
            m.IsAccepted         = true;
            m.ManagerEvaluation  = tbManagerEvaluation.Text;
            m.IsComplete         = cbMileStoneCompleted.Checked;
            m.Status             = (int)GoalStatus.ACCEPTED;
            m.Title = tbTitle.Text;
            new GoalMilestoneServices().Save(m);
            Milestone                 = m;
            lblTitle.Text             = m.Title;
            this.CurrentGoal.StatusID = ((HRR.Website.Goal) this.Parent.Page).CalculateProgress();
            new GoalServices().Save(this.CurrentGoal);
            IdeaSeed.Core.Data.NHibernate.NHibernateSessionManager.Instance.CloseSession();
        }
Пример #2
0
        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);
        }
Пример #3
0
 public GoalMilestone Save(GoalMilestone item)
 {
     return(new GoalMilestoneRepository().SaveOrUpdate(item));
 }
Пример #4
0
 public void Delete(GoalMilestone item)
 {
     new GoalMilestoneRepository().Delete(item);
 }
Пример #5
0
        protected void SaveCloneGoalClicked(object o, EventArgs e)
        {
            for (int i = 0; i < note_name.Entries.Count; i++)
            {
                if (note_name.Entries[i].Value.StartsWith("team:"))
                {
                    var t = new TeamServices().GetByID(Convert.ToInt32(note_name.Entries[i].Value.Replace("team:", "")));
                    foreach (var m in t.Members)
                    {
                        var goal = new Goal();
                        goal.AccountID          = CurrentGoal.AccountID;
                        goal.Description        = CurrentGoal.Description;
                        goal.IsAccepted         = true;
                        goal.Name               = CurrentGoal.Name;
                        goal.ReviewID           = CurrentGoal.ReviewID;
                        goal.StatusID           = CurrentGoal.StatusID;
                        goal.Title              = CurrentGoal.Title;
                        goal.TypeOfItem         = CurrentGoal.TypeOfItem;
                        goal.Weight             = CurrentGoal.Weight;
                        goal.DueDate            = (DateTime)tbCloneGoalDueDate.DateInput.SelectedDate;
                        goal.EnteredBy          = SecurityContextManager.Current.CurrentUser.ID;
                        goal.ChangedBy          = SecurityContextManager.Current.CurrentUser.ID;
                        goal.DateCreated        = DateTime.Now;
                        goal.LastUpdated        = DateTime.Now;
                        goal.EnteredFor         = m.PersonID;
                        goal.IsTemplate         = false;
                        goal.Progress           = 0;
                        goal.Score              = 0;
                        goal.EmployeeEvaluation = "";
                        goal.ManagerEvaluation  = "";
                        new GoalServices().Save(goal);

                        foreach (DataListItem row in dlMilestoneDueDates.Items)
                        {
                            var date  = row.FindControl("tbDueDate") as Telerik.Web.UI.RadDatePicker;
                            var oldms = new GoalMilestoneServices().GetByID(Convert.ToInt32(date.Attributes["milestoneid"]));
                            var ms    = new GoalMilestone();
                            ms.AccountID          = oldms.AccountID;
                            ms.ChangedBy          = SecurityContextManager.Current.CurrentUser.ID;
                            ms.Description        = oldms.Description;
                            ms.EmployeeEvaluation = "";
                            ms.ManagerEvaluation  = "";
                            ms.Name        = oldms.Name;
                            ms.Status      = (int)GoalStatus.ACCEPTED;
                            ms.Title       = oldms.Title;
                            ms.DateCreated = DateTime.Now;
                            ms.DueDate     = (DateTime)date.SelectedDate;
                            ms.EnteredBy   = SecurityContextManager.Current.CurrentUser.ID;
                            ms.EnteredFor  = m.PersonID;
                            ms.GoalID      = goal.ID;
                            ms.IsAccepted  = true;
                            ms.IsComplete  = false;
                            ms.LastUpdated = DateTime.Now;
                            new GoalMilestoneServices().Save(ms);
                        }

                        foreach (var s in CurrentGoal.Managers)
                        {
                            var subscriber = new GoalManager();
                            subscriber.GoalID   = goal.ID;
                            subscriber.PersonID = s.PersonID;
                            subscriber.RecievesNotifications = s.RecievesNotifications;
                            new GoalManagerServices().Save(subscriber);
                        }
                    }
                }
                else
                {
                    var p = new PersonServices().GetByEmail(note_name.Entries[i].Value);

                    var goal = new Goal();
                    goal.AccountID          = CurrentGoal.AccountID;
                    goal.Description        = CurrentGoal.Description;
                    goal.IsAccepted         = true;
                    goal.Name               = CurrentGoal.Name;
                    goal.ReviewID           = CurrentGoal.ReviewID;
                    goal.StatusID           = CurrentGoal.StatusID;
                    goal.Title              = CurrentGoal.Title;
                    goal.TypeOfItem         = CurrentGoal.TypeOfItem;
                    goal.Weight             = CurrentGoal.Weight;
                    goal.DueDate            = (DateTime)tbCloneGoalDueDate.DateInput.SelectedDate;
                    goal.EnteredBy          = SecurityContextManager.Current.CurrentUser.ID;
                    goal.ChangedBy          = SecurityContextManager.Current.CurrentUser.ID;
                    goal.DateCreated        = DateTime.Now;
                    goal.LastUpdated        = DateTime.Now;
                    goal.EnteredFor         = p.ID;
                    goal.IsTemplate         = false;
                    goal.Progress           = 0;
                    goal.Score              = 0;
                    goal.EmployeeEvaluation = "";
                    goal.ManagerEvaluation  = "";
                    new GoalServices().Save(goal);

                    foreach (DataListItem row in dlMilestoneDueDates.Items)
                    {
                        var date  = row.FindControl("tbDueDate") as Telerik.Web.UI.RadDatePicker;
                        var oldms = new GoalMilestoneServices().GetByID(Convert.ToInt32(date.Attributes["milestoneid"]));
                        var ms    = new GoalMilestone();
                        ms             = oldms;
                        ms.DateCreated = DateTime.Now;
                        ms.DueDate     = (DateTime)date.SelectedDate;
                        ms.EnteredBy   = SecurityContextManager.Current.CurrentUser.ID;
                        ms.EnteredFor  = p.ID;
                        ms.GoalID      = goal.ID;
                        ms.IsAccepted  = true;
                        ms.IsComplete  = false;
                        ms.LastUpdated = DateTime.Now;
                        new GoalMilestoneServices().Save(ms);
                    }

                    foreach (var s in CurrentGoal.Managers)
                    {
                        var subscriber = new GoalManager();
                        subscriber.GoalID   = goal.ID;
                        subscriber.PersonID = s.PersonID;
                        subscriber.RecievesNotifications = s.RecievesNotifications;
                        new GoalManagerServices().Save(subscriber);
                    }
                }
            }
            Response.Redirect(SecurityContextManager.Current.CurrentURL);
        }