/// <summary> /// this will notify other users of a change and show the document changes /// </summary> /// <param name="ProjectID"></param> public void TryUpdateChange(int ProjectID, ASP.NetMVCExample.Models.ProjectView.ProjectTasks Change) { ICollection <ValidationResult> ValidationResults; bool ChangeSuccess = Change.TryValidate(out ValidationResults); //if (ChangeSuccess) //update task and database //else if (Sessions[ProjectID].UnSavedTasks.ContainsKey(Change.TaskID)) // else up date task if exists //else // make new Task for Clients.Group(ProjectID.ToProjectGroupName(), Context.ConnectionId).NotifyChange(ChangeSuccess, Change); }
/// <summary> /// recursivly builds a chain (well sets the number in the chain so we can sort on the client side) /// probably the fastest way we can do this /// </summary> /// <param name="T">For non recusive calls the start point| inside the current link in the chain</param> /// <param name="NumberInChain">For non recusive calls the start point| inside the current link number in the chain</param> void TaskChainBuilder(ProjectTasks T, ref int NumberInChain) { if (T.NextTask.Count() > 0) { foreach (int i in T.NextTask) { ProjectTasks TNext = Tasks.Find(x => { return(x.TaskID == i); }); TNext.NumberInChain = NumberInChain; NumberInChain++; TaskChainBuilder(TNext, ref NumberInChain); } } NumberInChain--; }
/// <summary> /// /// </summary> /// <param name="ProjectID"></param> /// <param name="Change"></param> public void DeleteTask(int ProjectID, ASP.NetMVCExample.Models.ProjectView.ProjectTasks Change) { Clients.Group(ProjectID.ToProjectGroupName(), Context.ConnectionId).NotifyChange(Change.TaskID); }