public static ProductiveTaskPackage Create(string code, ProductiveTask task) { if (string.IsNullOrEmpty(code)) { throw new DomainExcetption(NamedObjectDTO.Empty, "不能使用空的编号创建任务包"); } ProductiveTaskPackage result = new ProductiveTaskPackage(code); result.AddTaskItem(task); return(result); }
public static ProductiveTaskPackage Create(string code, ProductiveTask master, ProductiveTask mortar) { if (string.IsNullOrEmpty(code)) { throw new DomainExcetption(NamedObjectDTO.Empty, "不能使用空的编号创建任务包"); } if (master == null) { throw new DomainExcetption(NamedObjectDTO.Empty, "不能创建主任务为空的任务包"); } ProductiveTaskPackage result = new ProductiveTaskPackage(code); result.AddTaskItem(master); result.AddTaskItem(mortar); return(result); }