Esempio n. 1
0
        public virtual void Begin()
        {
            _SubheadingsInfo info = this.Parent as _SubheadingsInfo;

            if (info.ZJFS == _Constant.公式组价)
            {
                string str = info.JSJC;
                if (string.IsNullOrEmpty(str))
                {
                    str = "0";
                }
                // this.Activitie.Property.Statistics.Begin();
                str = ToolKit.ExpressionReplace(str, info.Activitie.Property.Statistics.ResultVarable.DataSource);
                decimal m = 1m;
                decimal.TryParse(info.FL, out m);
                decimal ZHHJ = ToolKit.Calculate(str) * m * info.GCL * 0.01m;

                this.ResultVarable.Set(_Statistics.FILED_ZHHJ, ZHHJ);
                if (this.Parent.GCL != 0m)
                {
                    this.ResultVarable.Set(_Statistics.FILED_ZHDJ, info.ZHHJ / this.Parent.GCL);
                }
            }
            else
            {
                SetValue();
            }
            #endregion

            SetValueToView();;
        }
Esempio n. 2
0
        /// <summary>
        /// 统计并计算子节点
        /// </summary>
        private void calculateChilden(DataRow row)
        {
            DataRow[] rows = this.m_Source.Select(string.Format("ParentID = {0}", row["ID"]));
            if (rows.Length == 0)
            {
                if (row["Feature"].ToString() == "ZZJ")
                {
                    int i = 0;
                }
                //直接计算
                string str = ToolKit.ExpressionReplace(row["Calculation"].ToString(), this.Parent.Property.Statistics.ResultVarable.DataSource);
                //完成统计
                //decimal d = ToolKit.Calculate(str);
                decimal d = 0;
                using (DataTable table = new DataTable())
                {
                    try
                    {
                        d = ToolKit.ParseDecimal(table.Compute(str, string.Empty));
                    }
                    catch
                    {
                        d = 0;
                    }
                }
                //decimal d = ToolKit.Expression(str);
                //费率若小于 0 大于 100 按照100计算
                decimal coe = ToolKit.ParseDecimal(row["Coefficient"]);
                if (coe < 0 || coe > 100)
                {
                    coe = 100;
                }
                d = d * coe * 0.01M;

                //结果赋值
                row.BeginEdit();
                row["Price"] = d;
                row.EndEdit();
                //添加到结果集合(汇总分析此处修改添加列特项进入参数列表)
                //this.Parent.Statistics.ResultVarable.Set(row["Number"].ToString(), d, row["Remark"].ToString());

                this.Parent.Property.Statistics.ResultVarable.Set(row["Feature"].ToString(), d, row["Remark"].ToString());
            }
            else
            {
                //继续计算(有孩子继续计算 并且统计当前节点)
                foreach (DataRow r in rows)
                {
                    this.calculateChilden(r);
                    //SetCurrentParent(r);
                }
                //计算完成后统计当前节点
                this.SetCurrentParent(row);

                if (isRate(row))
                {
                    this.SetRate(row);
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 计算 投标金额、标底金额
        /// </summary>
        /// <param name="ifCpTBJE">是否计算投标金额</param>
        public void CalculateParentTBJE_BDJE()
        {
            IEnumerable <_SubheadingsFeeInfo> list = this.Parent.SubheadingsFeeList.Cast <_SubheadingsFeeInfo>().OrderBy(p => p.ID);


            foreach (_SubheadingsFeeInfo item in list)
            {
                string tbjsjc = ToolKit.ExpressionReplace(item.TBJSJC, this.Variable.DataSource);
                string bdjsjc = ToolKit.ExpressionReplace(item.BDJSJC, this.Variable.DataSource);
                switch (item.ID)
                {
                case 1:    //人工
                    item.TBJE = (ToolKit.Calculate(tbjsjc)) * item.FL * 0.01m;
                    item.BDJE = (ToolKit.Calculate(bdjsjc)) * item.FL * 0.01m;
                    break;

                case 2:    //材料
                    item.TBJE = (ToolKit.Calculate(tbjsjc)) * item.FL * 0.01m;
                    item.BDJE = (ToolKit.Calculate(bdjsjc)) * item.FL * 0.01m;
                    //用途类别材料
                    m_ResultValue.JGCL     = m_ResultValue.JGCL * item.FL * 0.01m;
                    m_ResultValue.YGCL     = m_ResultValue.YGCL * item.FL * 0.01m;
                    m_ResultValue.PBZDCL   = m_ResultValue.PBZDCL * item.FL * 0.01m;
                    m_ResultValue.ZDJCL    = m_ResultValue.ZDJCL * item.FL * 0.01m;
                    m_ResultValue.DEJGCL   = m_ResultValue.DEJGCL * item.FL * 0.01m;
                    m_ResultValue.DEYGCL   = m_ResultValue.DEYGCL * item.FL * 0.01m;
                    m_ResultValue.DEPBZDCL = m_ResultValue.DEPBZDCL * item.FL * 0.01m;
                    m_ResultValue.DEZDJCL  = m_ResultValue.DEZDJCL * item.FL * 0.01m;
                    break;

                case 3:    //机械
                    item.TBJE = (ToolKit.Calculate(tbjsjc)) * item.FL * 0.01m;
                    item.BDJE = (ToolKit.Calculate(bdjsjc)) * item.FL * 0.01m;
                    //
                    m_ResultValue.DZJXTB = m_ResultValue.DZJXTB * item.FL * 0.01m;
                    break;

                case 4:    //主材
                case 5:    //设备
                case 6:    //风险
                case 7:    //直接费
                case 8:    //管理费
                case 9:    //利润
                case 10:   //子目单价
                case 11:   //合价
                    item.TBJE = ToolKit.Calculate(tbjsjc) * item.FL * 0.01m;
                    item.BDJE = ToolKit.Calculate(bdjsjc) * item.FL * 0.01m;
                    break;
                }
                this.DEVariable.Set(item.YYH, item.BDJE, item.MC, item.FYLB);
                this.Variable.Set(item.YYH, item.TBJE, item.MC, item.FYLB);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 计算 投标金额、标底金额
        /// </summary>
        /// <param name="ifCpTBJE">是否计算投标金额</param>
        public void CalculateParentTBJE_BDJE()
        {
            IEnumerable <_SubheadingsFeeInfo> list = from info in this.Parent.SubheadingsFeeList.Cast <_SubheadingsFeeInfo>()
                                                     orderby info.ID
                                                     select info;

            foreach (_SubheadingsFeeInfo item in list)
            {
                string tbjsjc = ToolKit.ExpressionReplace(item.TBJSJC, this.Variable.DataSource);
                string bdjsjc = ToolKit.ExpressionReplace(item.BDJSJC, this.Variable.DataSource);
                switch (item.ID)
                {
                case 1:
                    item.TBJE = (ToolKit.Calculate(tbjsjc) + m_BaseResultValue.RGBFHHJ) * item.FL * 0.01m;
                    item.BDJE = (ToolKit.Calculate(bdjsjc) + m_BaseResultValue.RGBFHHJ) * item.FL * 0.01m;
                    break;

                case 2:
                    item.TBJE = (ToolKit.Calculate(tbjsjc) + m_BaseResultValue.CLBFHHJ) * item.FL * 0.01m;
                    item.BDJE = (ToolKit.Calculate(bdjsjc) + m_BaseResultValue.CLBFHHJ) * item.FL * 0.01m;
                    break;

                case 3:
                    item.TBJE = (ToolKit.Calculate(tbjsjc) + m_BaseResultValue.JXBFHHJ) * item.FL * 0.01m;
                    item.BDJE = (ToolKit.Calculate(bdjsjc) + m_BaseResultValue.JXBFHHJ) * item.FL * 0.01m;
                    break;

                default:
                    item.TBJE = ToolKit.Calculate(tbjsjc) * item.FL * 0.01m;
                    item.BDJE = ToolKit.Calculate(bdjsjc) * item.FL * 0.01m;
                    break;
                }
                this.Variable.Set(item.YYH, item.TBJE, item.MC);
                this.DEVariable.Set(item.YYH, item.BDJE, item.MC);
                //其他条件计算
                if (item.ID == 2)
                {
                    m_ResultValue.JGCL   = m_BaseResultValue.JGCL * item.FL;
                    m_ResultValue.YGCL   = m_BaseResultValue.YGCL * item.FL;
                    m_ResultValue.PBZDCL = m_BaseResultValue.PBZDCL * item.FL;
                    m_ResultValue.ZDJCL  = m_BaseResultValue.ZDJCL * item.FL;

                    m_ResultValue.DEJGCL   = m_BaseResultValue.DEJGCL * item.FL;
                    m_ResultValue.DEYGCL   = m_BaseResultValue.DEYGCL * item.FL;
                    m_ResultValue.DEPBZDCL = m_BaseResultValue.DEPBZDCL * item.FL;
                    m_ResultValue.DEZDJCL  = m_BaseResultValue.DEZDJCL * item.FL;
                }
                if (item.ID == 3)
                {
                    m_ResultValue.DZJXTB = m_BaseResultValue.DZJXTB * item.FL;
                }
            }
        }
Esempio n. 5
0
        /// <summary>
        /// 直接组价计算
        /// </summary>
        public void ZBegin()
        {
            string str = this.JSJC;

            if (string.IsNullOrEmpty(str))
            {
                str = "0";
            }
            this.Parent.Parent.Parent.Property.Statistics.Begin();
            str = ToolKit.ExpressionReplace(str, this.Parent.Parent.Parent.Property.Statistics.ResultVarable.DataSource);
            decimal m = 1m;

            decimal.TryParse(this.FL, out m);
            this.ZHHJ = ToolKit.Calculate(str) * m * this.GCL * 0.01m;
            this.Begin();
        }
Esempio n. 6
0
        private void SetHJ()
        {

            _MFixedListInfo info = this.Parent as _MFixedListInfo;
            if (info != null)
            {

                m_ResultValue = new Result();
                if (info.ZJFS == _Constant.子目组价)
                {
                    foreach (_SubheadingsInfo item in info.SubheadingsList)
                    {

                        //所有的合价累计
                        m_ResultValue.DEZHHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_DEZHHJ);
                        m_ResultValue.DEZJFHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_DEZJFHJ);
                        m_ResultValue.DERGFHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_DERGFHJ);
                        m_ResultValue.DECLFHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_DECLFHJ);
                        m_ResultValue.DEZCFHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_DEZCFHJ);
                        m_ResultValue.DESBFHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_DESBFHJ);
                        m_ResultValue.DEJXFHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_DEJXFHJ);
                        m_ResultValue.DEGLFHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_DEGLFHJ);
                        m_ResultValue.DELRHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_DELRHJ);
                        m_ResultValue.DEFXHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_DEFXHJ);

                        m_ResultValue.DEJGJEHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_DEJGJEHJ);
                        m_ResultValue.DEYGJEHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_DEYGJEHJ);
                        m_ResultValue.DEPBZDHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_DEPBZDHJ);
                        m_ResultValue.DEZGHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_DEZGHJ);

                        m_ResultValue.ZHHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_ZHHJ);
                        m_ResultValue.ZJFHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_ZJFHJ);
                        m_ResultValue.RGFHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_RGFHJ);
                        m_ResultValue.CLFHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_CLFHJ);
                        m_ResultValue.ZCFHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_ZCFHJ);
                        m_ResultValue.SBFHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_SBFHJ);
                        m_ResultValue.JXFHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_JXFHJ);
                        m_ResultValue.GLFHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_GLFHJ);
                        m_ResultValue.LRHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_LRHJ);
                        m_ResultValue.FXHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_FXHJ);


                        m_ResultValue.JGJEHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_JGJEHJ);
                        m_ResultValue.YGJEHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_YGJEHJ);
                        m_ResultValue.PBZDHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_PBZDHJ);
                        m_ResultValue.ZGHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_ZGHJ);


                        m_ResultValue.JCHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_JCHJ);
                        m_ResultValue.CJHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_CJHJ);
                        //m_ResultValue.HHJXRGF += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_HHJXRGF);
                        //m_ResultValue.HHJXRGFJC += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_HHJXRGFJC);
                        //m_ResultValue.DEHHJXRGF += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_DEHHJXRGF);

                        m_ResultValue.FBFXCJHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_FBFXCJHJ);
                        m_ResultValue.FBFXJCHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_FBFXJCHJ);
                        m_ResultValue.FBFXRGJCHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_FBFXRGJCHJ);
                        m_ResultValue.FBFXCLJCHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_FBFXCLJCHJ);
                        m_ResultValue.FBFXJXJCHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_FBFXJXJCHJ);

                        m_ResultValue.FBFXRGCJHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_FBFXRGCJHJ);
                        m_ResultValue.FBFXCLCJHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_FBFXCLCJHJ);
                        m_ResultValue.FBFXJXCJHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_FBFXJXCJHJ);

                        m_ResultValue.DEGFHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_DEGFHJ);
                        m_ResultValue.GFHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_GFHJ);
                        m_ResultValue.DESJHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_DESJHJ);
                        m_ResultValue.SJHJ += item.Statistics.ResultVarable.GetDecimal(_Statistics.FILED_SJHJ);

                    }
                }
                else
                {
                    if (info.Parent != null)
                    {
                        string str = info.JSJC;
                        if (string.IsNullOrEmpty(str)) str = "0";
                        // this.Parent.Parent.Parent.Property.Statistics.Begin();
                        str = ToolKit.ExpressionReplace(str, info.Parent.Parent.Parent.Property.Statistics.ResultVarable.DataSource);
                        decimal m = 1m;
                        decimal.TryParse(info.FL, out m);
                        decimal ZHHJ = ToolKit.Calculate(str) * m * info.GCL * 0.01m;
                        m_ResultValue.ZHHJ = ZHHJ;
                    }
                }
            }


        }