本文整理汇总了C#中Feature.updateAllPercentCompletes方法的典型用法代码示例。如果您正苦于以下问题:C# Feature.updateAllPercentCompletes方法的具体用法?C# Feature.updateAllPercentCompletes怎么用?C# Feature.updateAllPercentCompletes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Feature
的用法示例。
在下文中一共展示了Feature.updateAllPercentCompletes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: updateAllPercentCompletes
public void updateAllPercentCompletes()
{
if (getParentID() != -1)
{
Feature parent = new Feature(getParentID());
decimal total = 0;
decimal counter = 0;
if (parent.myChildren.Count > 0)
{
foreach (Feature child in parent.myChildren)
{
counter++;
total += child.getPercentComplete();
}
parent.updatePercentComplete((int)(total / counter));
}
parent.updateAllPercentCompletes();
}
}
示例2: addNewMilestone
public static int addNewMilestone(int projectID, string Name, string Description, int Weight, int boardID)
{
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "INSERT INTO [TrackingTool_Features] VALUES(@projectID, NULL, @featureName, @featureDescription, @weight, @boardID, 0, 0, CURRENT_TIMESTAMP, NULL, NULL)";
cmd.Parameters.AddWithValue("@projectID", projectID);
cmd.Parameters.AddWithValue("@featureName", Name);
cmd.Parameters.AddWithValue("@featureDescription", Description);
cmd.Parameters.AddWithValue("@weight", Weight);
cmd.Parameters.AddWithValue("@boardID", boardID);
TTDB.TTQuery(cmd);
cmd = new SqlCommand();
cmd.CommandText = "SELECT * FROM [TrackingTool_Features] WHERE projectID = @projectID AND parentID IS NULL AND featureName = @featureName and featureDescription = @featureDescription and weight = @weight";
cmd.Parameters.AddWithValue("@projectID", projectID);
cmd.Parameters.AddWithValue("@featureName", Name);
cmd.Parameters.AddWithValue("@featureDescription", Description);
cmd.Parameters.AddWithValue("@weight", Weight);
DataTable DT = TTDB.TTQuery(cmd);
Feature ftr = new Feature(int.Parse(DT.Rows[0]["ID"].ToString()));
ftr.updateAllPercentCompletes();
if (DT.Rows.Count > 0)
{
return Int32.Parse(DT.Rows[0]["ID"].ToString());
}
else
{
return -1;
}
}