Ejemplo n.º 1
0
 public ActionResult EditTaskNode(TaskNodeFormModel input,string[] dependOns)
 {
     if (ModelState.IsValid)
     {
         TaskNode tasknode;
         if (input.TaskNodeId==0)
         {
             tasknode = new TaskNode
             {
                 TaskName = input.TaskName,
                 DayToCost = input.DayToCost,
                 CountWorkDay =  input.CountWorkDay,
                 StageEnd =  input.StageEnd,
                 WbsTypeId = input.WbsTypeId,
                 StageValue = input.StageValue,
                 RoleId = input.RoleId,
                 NodeFlag = input.NodeFlag,
                 WBSCode = input.WBSCode,
                 DependOnNodes = new List<TaskNode>()
             };
             if (dependOns != null)
             {
                 foreach (var dependid in dependOns)
                 {
                     var dependnode = _taskRepository.Find(Convert.ToInt32(dependid));
                     tasknode.DependOnNodes.Add(dependnode);
                 }
             }
             _taskRepository.Add(tasknode);
         }
         else
         {
             tasknode = _taskRepository.Find(Convert.ToInt32(input.TaskNodeId));
             tasknode.TaskName = input.TaskName;
             tasknode.DayToCost = input.DayToCost;
             tasknode.CountWorkDay = input.CountWorkDay;
             tasknode.StageEnd = input.StageEnd;
             tasknode.StageValue = input.StageValue;
             tasknode.RoleId = input.RoleId;
             tasknode.DateModified = DateTime.Now.Date;
             tasknode.WBSCode = input.WBSCode;
             tasknode.NodeFlag = input.NodeFlag;
             if (dependOns!=null)
             {
                 tasknode.DependOnNodes.Clear();
                 foreach (var dependid in dependOns)
                 {
                     var dependnode = _taskRepository.Find(Convert.ToInt32(dependid));
                     tasknode.DependOnNodes.Add(dependnode);
                 }
             }
             else
             {
                 tasknode.DependOnNodes.Clear();
             }
         }
         UnitOfWork.Commit();
         return Json(new JsonResponse { Success = true });
     }
     return Json(new JsonResponse { Success = false });
 }
Ejemplo n.º 2
0
 public TaskNodeLogsSummary(TaskNode taskNode)
 {
     TaskName = taskNode.TaskName;
     CostDay = taskNode.DayToCost;
     StageName = taskNode.StageName;
     StageValue = taskNode.StageValue;
     WBSCode = taskNode.WBSCode;
     TaskNodeId = taskNode.TaskNodeId;
 }