static void AddGoalItem(string id, string groupKey, string memberKey, string text, string parentId, DateTimeOffset actionTime, GoalType GoalType) { var Goal = new GoalItem { Id = id, ParentId = parentId, GroupKey = groupKey, MemberKey = memberKey, Text = text, GoalType = GoalType }; Goals.Add(Goal); SendFeedbackMessage(type: MsgType.Success, actionTime: actionTime, action: MapAction.GoalFeedback.NewGoalAdded.Name, content: Goal); }
static PresentItem GoalToPresentation2(string groupKey, string memberKey, GoalItem mi) { var presentItem = new PresentItem { Id = mi.Id, Text = "Goal: " + mi.Text, Link = "", Actions = GetActions(mi).ToList(), }; return(presentItem); }
static IEnumerable <PresentItemActions> GetActions(GoalItem mi) { Func <string, string, dynamic, PresentItemActions> createStep = (text, action, content) => new PresentItemActions { Text = text, Group = "/Goal", Action = action, Metadata = new { GroupKey = mi.GroupKey, MemberKey = mi.MemberKey, ReferenceKey = Guid.NewGuid().ToString() }, Content = content }; yield return(createStep("step", MapAction.Goal.NewGoal.Name, new { Text = "[text]", ParentId = mi.Id })); yield return(createStep("update", MapAction.Goal.UpdateGoal.Name, new { Text = "[text]", Id = mi.Id })); yield return(createStep("delete", MapAction.Goal.DelGoal.Name, new { Id = mi.Id })); yield return(createStep("task", MapAction.Task.NewTask.Name, new { Description = "[text]", ParentId = mi.Id })); }