I can't figure out how to set the EstimatedHours property from the StarTeam SDK. The property EstimatedHours is readonly, and I can't figure out any way to set the value from the SDK, though through the UI you can set the "Plan, Work" field.
Setting the EstimatedStart/Finish
doesn't work:
var task = new Borland.StarTeam.Tas开发者_如何学Pythonk(cr.ParentFolder);
task.Name = "Name";
task.Notes = "Notes";
// task.EstimatedHours = 4.0; // readonly property
task.EstimatedStart = DateTime.Now;
task.EstimatedFinish = DateTime.Now.AddHours(4);
task.Update();
The only way I have figured out to set the Estimated Hours was with database access and a SQL query:
UPDATE t
SET StTaskEstimatedHours = 4
FROM dbo.syn_Task t
WHERE t.EndModifiedTime = 0 AND t.DeletedTime = 0
AND t.StTaskNumber = {task.Number}
精彩评论