Esempio n. 1
0
 protected void MilestonesItemCommand(object o, DataListCommandEventArgs e)
 {
     if (e.CommandName == "updatems")
     {
         var lb = e.Item.FindControl("lbUpdate") as LinkButton;
         var ms = new GoalMilestoneServices().GetByID(Convert.ToInt32(lb.Attributes["itemid"]));
         ms.DueDate            = (DateTime)((RadDatePicker)e.Item.FindControl("tbMilestoneDueDate")).SelectedDate;
         ms.Description        = ((IdeaSeed.Web.UI.TextBox)e.Item.FindControl("tbMilestoneDescription")).Text;
         ms.Title              = ((IdeaSeed.Web.UI.TextBox)e.Item.FindControl("tbMilestoneTitle")).Text;
         ms.ManagerEvaluation  = ((IdeaSeed.Web.UI.TextBox)e.Item.FindControl("tbManagerEvaluation")).Text;
         ms.EmployeeEvaluation = ((IdeaSeed.Web.UI.TextBox)e.Item.FindControl("tbSelfEvaluation")).Text;
         ms.IsComplete         = ((IdeaSeed.Web.UI.CheckBox)e.Item.FindControl("cbMilestoneCompleted")).Checked;
         ms.ChangedBy          = SecurityContextManager.Current.CurrentUser.ID;
         ms.LastUpdated        = DateTime.Now;
         new GoalMilestoneServices().Save(ms);
         CurrentGoal.Progress = CalculateProgress();
         new GoalServices().Save(CurrentGoal);
         LoadData();
     }
     if (e.CommandName == "delete")
     {
         var lb = e.Item.FindControl("lbDeleteMilestone") as LinkButton;
         var ms = new GoalMilestoneServices().GetByID(Convert.ToInt32(lb.Attributes["itemid"]));
         new GoalMilestoneServices().Delete(ms);
         Response.Redirect(SecurityContextManager.Current.CurrentURL);
     }
 }
Esempio n. 2
0
 protected void UpdateMilestoneClicked(object o, EventArgs e)
 {
     var milestone = new GoalMilestoneServices().GetByID(Convert.ToInt32(((LinkButton)o).Attributes["itemid"]));
 }
Esempio n. 3
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);
        }