当前位置: 首页>>代码示例>>C#>>正文


C# Feature.updateAllPercentCompletes方法代码示例

本文整理汇总了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();
        }
    }
开发者ID:Ravai,项目名称:honey-badger,代码行数:20,代码来源:Feature.cs

示例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;
        }
    }
开发者ID:Ravai,项目名称:honey-badger,代码行数:31,代码来源:Feature.cs


注:本文中的Feature.updateAllPercentCompletes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。