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


C# Whitfieldcore.GetTotalMaterialPriceForEstimation方法代码示例

本文整理汇总了C#中Whitfieldcore.GetTotalMaterialPriceForEstimation方法的典型用法代码示例。如果您正苦于以下问题:C# Whitfieldcore.GetTotalMaterialPriceForEstimation方法的具体用法?C# Whitfieldcore.GetTotalMaterialPriceForEstimation怎么用?C# Whitfieldcore.GetTotalMaterialPriceForEstimation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Whitfieldcore的用法示例。


在下文中一共展示了Whitfieldcore.GetTotalMaterialPriceForEstimation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: grd1_ItemDataBound

    public void grd1_ItemDataBound(object sender, DataGridItemEventArgs e)
    {
        Whitfieldcore _wc = new Whitfieldcore();
        String DetailId = "";

        //(a.EnghourRate * b.eng_hours + a.fabhourrate * b.fab_hours + a.insthourrate * b.install_hours + a.mischourrate*b.misc_hours + a.fabhourrate*b.fin_hours) total_labor
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            DetailId = grdpl1.DataKeys[Convert.ToInt32(e.Item.ItemIndex)].ToString();
            String TotMatPriceWO = _wc.GetTotalMaterialPriceForWorkOrder(Convert.ToInt32(ViewState["EstNum"].ToString()), DetailId);

            if (TotMatPriceWO == "0")
            {
                TotMatPriceWO = "1";
            }

            Decimal TotMatPriceProj = _wc.GetTotalMaterialPriceForEstimation(Convert.ToInt32(ViewState["EstNum"]));

            if (TotMatPriceProj == 0)
            {
                TotMatPriceProj = 100;
            }

            //Contingency Dispersement
            ((Label)(e.Item.FindControl("lblContDisp"))).Text = ((Convert.ToDecimal(TotMatPriceWO) / TotMatPriceProj) * 100).ToString("00.00");

            //Material Cost
            ((Label)(e.Item.FindControl("lblMatCost"))).Text =    _wc.GetTotalMaterialPriceForWorkOrder(Convert.ToInt32(ViewState["EstNum"].ToString()), DetailId);

            String tmpContDisp = ((Label)(e.Item.FindControl("lblContDisp"))).Text;
            if (((Label)(e.Item.FindControl("lblContDisp"))).Text == "1")
                tmpContDisp = "0";

            //Contengency
            //Response.Write("Contengency:" + _contAmt.ToString() + " tmpContDisp:" + tmpContDisp);

            _contAmt = Convert.ToDecimal(_wc.GetContengency(Convert.ToInt32(ViewState["EstNum"].ToString())));

            String TotalContengency = (Convert.ToDecimal(_contAmt) * Convert.ToDecimal(Convert.ToDecimal(tmpContDisp) / 100)).ToString("00.00");
            ((Label)(e.Item.FindControl("lblContigency"))).Text =  TotalContengency;

            //Material Cost + Contingency
            ((Label)(e.Item.FindControl("lblMatPlusCont"))).Text = (Convert.ToDecimal(((Label)(e.Item.FindControl("lblMatCost"))).Text) + Convert.ToDecimal(TotalContengency)).ToString("00.00");

            //Overhead = (Total Labor + total Material + Contingency)* Overhead percent
            //(Total Labor + total Material + Contingency)* Overhead percent
            //Response.Write("OHPercent:" + _wc.GetOverHeadPercent(Convert.ToInt32(ViewState["EstNum"].ToString())));
            //Response.Write("<br>Profit Markup:" + _wc.GetProfitMarkUp(Convert.ToInt32(ViewState["EstNum"].ToString())));

            //Overhead = (Total Labor + total Material + Contingency)* Overhead percent
            //((Label)(e.Item.FindControl("lbloverhead"))).Text = ((Convert.ToDecimal(((Label)(e.Item.FindControl("lblTotlabor"))).Text) + Convert.ToDecimal(((Label)(e.Item.FindControl("lblMatPlusCont"))).Text)) * Convert.ToDecimal(Convert.ToDecimal(_wc.GetOverHeadPercent(Convert.ToInt32(ViewState["EstNum"].ToString()))) / 100)).ToString("00.00");

            ((Label)(e.Item.FindControl("lbloverhead"))).Text = ((Convert.ToDecimal(((Label)(e.Item.FindControl("lblfinhours"))).Text) + Convert.ToDecimal(((Label)(e.Item.FindControl("lblMiscHours"))).Text) + Convert.ToDecimal(((Label)(e.Item.FindControl("lblEnghours"))).Text) + Convert.ToDecimal(((Label)(e.Item.FindControl("lblfabhours"))).Text)) * Convert.ToDecimal(((HiddenField)(e.Item.FindControl("hdntot_rate"))).Value)).ToString("00.00");

            //Profit = (Total Labor + Total Material + Contingency + Overhead) * profit percent
                //txtMarkUpPercent.Text.Trim()
            ((Label)(e.Item.FindControl("lblProfit"))).Text = ((Convert.ToDecimal(((Label)(e.Item.FindControl("lbloverhead"))).Text) + Convert.ToDecimal(((Label)(e.Item.FindControl("lblTotlabor"))).Text) + Convert.ToDecimal(((Label)(e.Item.FindControl("lblMatPlusCont"))).Text)) * Convert.ToDecimal(Convert.ToDecimal(_wc.GetProfitMarkUp(Convert.ToInt32(ViewState["EstNum"].ToString()))) / 100)).ToString("00.00");

            ((Label)(e.Item.FindControl("lblSellPrice"))).Text = (Convert.ToDecimal(((Label)(e.Item.FindControl("lbloverhead"))).Text) + Convert.ToDecimal(((Label)(e.Item.FindControl("lblProfit"))).Text) + Convert.ToDecimal(((Label)(e.Item.FindControl("lblTotlabor"))).Text) + Convert.ToDecimal(((Label)(e.Item.FindControl("lblMatPlusCont"))).Text)).ToString("00.00");

            Grandlabor += Convert.ToDecimal(((Label)(e.Item.FindControl("lblTotlabor"))).Text.Trim());
            GrandContDisp += Convert.ToDecimal(((Label)(e.Item.FindControl("lblContDisp"))).Text.Trim());
            GrandCont += Convert.ToDecimal(((Label)(e.Item.FindControl("lblContigency"))).Text.Trim());
            GrandTotal += Convert.ToDecimal(((Label)(e.Item.FindControl("lblMatPlusCont"))).Text.Trim());
            GrandOverHead += Convert.ToDecimal(((Label)(e.Item.FindControl("lbloverhead"))).Text.Trim());
            GrandProfit += Convert.ToDecimal(((Label)(e.Item.FindControl("lblProfit"))).Text.Trim());
            GrandSellPrice += Convert.ToDecimal(((Label)(e.Item.FindControl("lblSellPrice"))).Text.Trim());

            TotalFabHours += Convert.ToInt32(((Label)(e.Item.FindControl("lblfabhours"))).Text);
            TotalfinHours += Convert.ToInt32(((Label)(e.Item.FindControl("lblfinhours"))).Text);
            TotalInstallHours += Convert.ToInt32(((Label)(e.Item.FindControl("lblinstallhours"))).Text);
            TotalEngHours += Convert.ToInt32(((Label)(e.Item.FindControl("lblEnghours"))).Text);
            TotalMiscHours += Convert.ToInt32(((Label)(e.Item.FindControl("lblMiscHours"))).Text);
            TotalMatCost += Convert.ToDecimal(((Label)(e.Item.FindControl("lblMatCost"))).Text);
        }
        else if (e.Item.ItemType == ListItemType.Footer)
        {
            e.Item.Cells[6].Text = "Item Totals:";
            e.Item.Cells[6].Font.Bold = true;
            e.Item.Cells[6].HorizontalAlign = HorizontalAlign.Right;
            e.Item.Cells[7].Text = TotalEngHours.ToString();
            e.Item.Cells[7].Font.Bold = true;
            e.Item.Cells[7].HorizontalAlign = HorizontalAlign.Center;
            e.Item.Cells[8].Text = TotalFabHours.ToString();
            e.Item.Cells[8].Font.Bold = true;
            e.Item.Cells[8].HorizontalAlign = HorizontalAlign.Center;
            e.Item.Cells[9].Text = TotalfinHours.ToString();
            e.Item.Cells[9].Font.Bold = true;
            e.Item.Cells[9].HorizontalAlign = HorizontalAlign.Center;
            e.Item.Cells[10].Text = TotalInstallHours.ToString();
            e.Item.Cells[10].Font.Bold = true;
            e.Item.Cells[10].HorizontalAlign = HorizontalAlign.Center;
            e.Item.Cells[11].Text = TotalMiscHours.ToString();
            e.Item.Cells[11].Font.Bold = true;
            e.Item.Cells[11].HorizontalAlign = HorizontalAlign.Center;

            e.Item.Cells[12].Text = String.Format("{0:0.##}", Decimal.Floor(Grandlabor));
            e.Item.Cells[12].Font.Bold = true;
            e.Item.Cells[12].HorizontalAlign = HorizontalAlign.Center;

//.........这里部分代码省略.........
开发者ID:frdharish,项目名称:WhitfieldAPPs,代码行数:101,代码来源:whitfield_estimation.aspx.cs


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