예제 #1
0
            public void Clone_Action_With_AssignTo()
            {
                ObjectId          control = ObjectId.GenerateNewId();
                IPlanElementUtils peUtil  = new PlanElementUtils {
                };

                AD.Actions action = new AD.Actions {
                    ElementState = 1, AssignToId = control.ToString()
                };
                peUtil.CloneAction(action);

                string sample = action.AssignToId;

                Assert.AreEqual(control.ToString(), sample);
            }
예제 #2
0
            public void Set_AssignedTo_CM_Already_Assigned_In_Program()
            {
                string            assignedTO = ObjectId.GenerateNewId().ToString();
                IPlanElementUtils peUtil     = new PlanElementUtils {
                };
                DateTime assigned            = DateTime.UtcNow;

                AD.Actions act = new AD.Actions {
                    AssignDate = assigned
                };
                AD.Program prog = new AD.Program {
                    AssignToId = assignedTO
                };

                peUtil.SetInitialProperties(assignedTO, act, false);

                Assert.AreEqual(assignedTO, act.AssignToId);
            }
예제 #3
0
            public void Set_Assigned_To_No_CM_Assigned_In_Program()
            {
                string            assignedTO = null;
                IPlanElementUtils peUtil     = new PlanElementUtils {
                };
                DateTime assigned            = DateTime.UtcNow;

                AD.Actions act = new AD.Actions {
                    AssignDate = assigned
                };
                AD.Program prog = new AD.Program {
                    AssignToId = assignedTO
                };

                peUtil.SetInitialProperties(assignedTO, act, false);

                Assert.IsNull(act.AssignToId);
            }
예제 #4
0
            public void Set_Assigned_Date_Already_Assigned()
            {
                string            assignedDate = null;
                IPlanElementUtils peUtil       = new PlanElementUtils {
                };
                DateTime assigned = DateTime.UtcNow;

                AD.Actions act = new AD.Actions {
                    AssignDate = assigned
                };
                AD.Program prog = new AD.Program {
                    AssignToId = assignedDate
                };

                peUtil.SetInitialProperties(assignedDate, act, false);

                Assert.AreEqual(assigned.Date, ((DateTime)act.AssignDate).Date);
            }
예제 #5
0
        public static Actions UpdateProgramAction(Actions ac, DTO.Program p)
        {
            DTO.Program pr  = p;
            DTO.Actions act = null;
            pr.Modules.ForEach(m =>
            {
                foreach (Actions a in m.Actions)
                {
                    bool replaced = ReplaceAction(ac, m, a);
                    if (replaced)
                    {
                        act = a;
                        break;
                    }
                }
            });

            return(act);
        }