ProjectDataSet.TaskDataTable.AddTaskRow 方法
将一个TaskRow对象添加到TaskDataTable对象。
命名空间: WebSvcProject
程序集: ProjectServerServices(位于 ProjectServerServices.dll 中)
语法
声明
Public Sub AddTaskRow ( _
row As ProjectDataSet.TaskRow _
)
用法
Dim instance As ProjectDataSet.TaskDataTable
Dim row As ProjectDataSet.TaskRow
instance.AddTaskRow(row)
public void AddTaskRow(
ProjectDataSet.TaskRow row
)
参数
row
类型:WebSvcProject.ProjectDataSet.TaskRow包含要添加的TaskRow对象。
备注
若要添加任务的前置任务的任务,指定的AddPosition属性。如果AddPosition为空,在项目的末尾添加任务。
重要信息 |
---|
Project Server 不允许在同一个项目中,重复的任务 Guid,但不会检查其他项目中的重复任务 Guid。永远不会重复使用TASK_UID的 GUID 时创建的任务,即使是在不同项目中的任务。重复任务 Guid 中断其他 Project Server 功能,例如,多维数据集生成服务和报告数据库的更新。 |
AddTaskRow方法签名被重载,如下所示:
第三方开发人员应使用的重载都一个ProjectDataSet.TaskRow参数,例如, AddTaskRow(ProjectDataSet.TaskRow row)。
Microsoft Visual Studio 在对象资源管理器中显示另一个TaskRow中的所有字段中使用单个参数的重载。
public TaskRow AddTaskRow( Guid PROJ_UID, Guid TASK_UID, Guid TASK_PARENT_UID, string TASK_NAME, int TASK_ID, bool TASK_IS_MILESTONE, bool TASK_IS_SUMMARY, bool TASK_IS_MARKED, bool TASK_IGNORES_RES_CAL, bool TASK_IS_EFFORT_DRIVEN, bool TASK_IS_CRITICAL, bool TASK_IS_EXTERNAL, bool TASK_IS_FROM_FINISH_SUBPROJ, bool TASK_IS_OVERALLOCATED, bool TASK_IS_RECURRING, bool TASK_IS_RECURRING_SUMMARY, bool TASK_IS_SUBPROJ, bool TASK_IS_READONLY_SUBPROJ, bool TASK_LOCKDOWN_BY_MANAGER, int TASK_LEVELING_DELAY, short TASK_LEVELING_DELAY_FMT, bool TASK_LEVELING_CAN_SPLIT, bool TASK_LEVELING_ADJUSTS_ASSN, bool TASK_DUR_IS_EST, int TASK_DUR, int TASK_DUR_FMT, int TASK_DUR_VAR, double TASK_EAC, double TASK_VAC, int TASK_ACT_DUR, int TASK_REM_DUR, short TASK_CONSTRAINT_TYPE, DateTime TASK_CONSTRAINT_DATE, DateTime TASK_ACT_START, DateTime TASK_ACT_FINISH, int TASK_PRIORITY, int TASK_PCT_COMP, int TASK_PCT_WORK_COMP, int TASK_TYPE, short TASK_FIXED_COST_ACCRUAL, DateTime TASK_DEADLINE, double TASK_WORK, double TASK_OVT_WORK, double TASK_REG_WORK, double TASK_ACT_WORK, double TASK_ACT_OVT_WORK, double TASK_REM_WORK, double TASK_REM_OVT_WORK, double TASK_COST, double TASK_OVT_COST, double TASK_FIXED_COST, double TASK_ACT_COST, double TASK_ACT_OVT_COST, double TASK_REM_COST, double TASK_REM_OVT_COST, int TASK_PHY_PCT_COMP, int TASK_EVMETHOD, int TASK_OUTLINE_LEVEL, string TASK_OUTLINE_NUM, Guid TASK_CAL_UID, DateTime TASK_START_DATE, int TASK_START_VAR, DateTime TASK_FINISH_DATE, int TASK_FINISH_VAR, DateTime TASK_RESUME_DATE, DateTime TASK_STOP_DATE, DateTime TASK_PRELEVELED_START, DateTime TASK_PRELEVELED_FINISH, DateTime TASK_EARLY_START, DateTime TASK_EARLY_FINISH, DateTime TASK_LATE_START, DateTime TASK_LATE_FINISH, DateTime TB_START, DateTime TB_FINISH, double TB_COST, double TB_WORK, int TB_DUR, short TB_DUR_FMT, double TASK_BCWS, double TASK_BCWP, double TASK_ACWP, int TASK_FREE_SLACK, int TASK_TOTAL_SLACK, bool TASK_HAS_LINKED_FIELDS, string TASK_WBS, int AddPosition, Guid AddAfterTaskUID, int DurationType, int WOBJ_DOC_REF_CNT, int WOBJ_ISSUE_REF_CNT, int WOBJ_RISK_REF_CNT, int WOBJ_OTHER_REF_CNT, DateTime CREATED_DATE, DateTime MOD_DATE, string PROJ_NAME, int PROJ_TYPE, int PROJ_OPT_CURRENCY_DIGITS, int PROJ_OPT_CURRENCY_POSITION, string PROJ_OPT_CURRENCY_SYMBOL, Guid TASK_EXT_PROJ_UID, double TASK_BUDGET_COST, bool TASK_IS_NULL, double TASK_BUDGET_WORK, string TASK_CONTACT, double TASK_COST_VAR, double TASK_CPI, double TASK_CV, int TaskCVP, int TASK_START_SLACK, int TASK_FINISH_SLACK, string TASK_HYPERLINK_FRIENDLY_NAME, string TASK_HYPERLINK_ADDRESS, string TASK_HYPERLINK_SUB_ADDRESS, bool TASK_IS_ROLLED_UP, string TASK_NOTES, double TASK_SPI, double TASK_SV, int TaskSVP, double TASK_TCPI, double TASK_WORK_VAR)
示例
using PSLibrary = Microsoft.Office.Project.Server.Library;
. . .
public static void CreateTaskRow(
WebSvcProject.ProjectDataSet dsProject,
string taskName,
PSLibrary.Task.AddPositionType position,
Guid predecessorGuid)
{
WebSvcProject.ProjectDataSet.TaskRow taskRow =
dsProject.Task.NewTaskRow();
taskRow.PROJ_UID = dsProject.Project[0].PROJ_UID;
taskRow.TASK_UID = Guid.NewGuid();
taskRow.AddPosition = position;
if (position == PSLibrary.Task.AddPosition.Middle)
{
taskRow.AddAfterTaskUID = predecessorGuid;
}
taskRow.TASK_NAME = taskName;
dsProject.Task.AddTaskRow(taskRow);
}
另请参阅
引用
ProjectDataSet.TaskDataTable 类