Beispiel #1
0
 public override void Calculate()
 {
     _MFixedListInfo info = this.Parent as _MFixedListInfo;
     foreach (_SubheadingsInfo item in info.SubheadingsList)
     {
         item.Statistics.Calculate();
     }
     this.Begin();
 }
Beispiel #2
0
 /// <summary>
 /// 通用项目删除清单
 /// </summary>
 /// <param name="info"></param>
 public void Del(_MFixedListInfo info)
 {
     _SubheadingsInfo[] infos = info.SubheadingsList.Cast <_SubheadingsInfo>().ToArray();
     foreach (_SubheadingsInfo item in infos)
     {
         info.Remove(item);
         // this.Parent.ObjectsList.Remove(item);
     }
     this.Parent.ObjectsList.Remove(info);
 }
Beispiel #3
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;
                    }
                }
            }


        }
Beispiel #4
0
        private void LoadTable(DataTable dt)
        {
            if (dt == null)
            {
                return;
            }
            DataRow[] crows = dt.Select("ParentID=1");//父级编号为1的为通用项目
            int       xh    = 1;

            for (int i = 0; i < crows.Length; i++)
            {
                _CommonrojectInfo info = new _CommonrojectInfo();

                info.JSJC    = "";
                info.FL      = "";
                info.GCL     = 0m;
                info.XMMC    = crows[i]["Name"].ToString();
                info.XMBM    = crows[i]["Codes"].ToString();
                info.OLDXMBM = crows[i]["Codes"].ToString();
                //通用项目添加到集合
                this.Create(info);
                DataRow[] rows = dt.Select("ParentID=" + crows[i]["ID"] + "");//父级编号为为通用项目ID的项为清单
                int       m    = 1;
                for (int j = 0; j < rows.Length; j++)
                {
                    _MFixedListInfo minfo = new _MFixedListInfo();

                    minfo.XMMC    = rows[j]["Name"].ToString();
                    minfo.LB      = rows[j]["Type"].ToString();
                    minfo.GCL     = 1m;
                    minfo.JSJC    = rows[j]["Calculation"].ToString();
                    minfo.FL      = rows[j]["Rate"].ToString();
                    minfo.DW      = rows[j]["Unit"].ToString();
                    minfo.XMBM    = rows[j]["Codes"].ToString();
                    minfo.OLDXMBM = rows[j]["Codes"].ToString();
                    minfo.XH      = xh++;
                    if (rows[j]["Remark"].ToString().Contains("通用项目"))
                    {
                        minfo.XH2 = int.Parse(rows[j]["Remark"].ToString().Replace("通用项目", ""));
                    }
                    if (i == 0 && m < 5)
                    {
                        minfo.ISTY = true;
                    }
                    m++;
                    info.Create(minfo);
                    DataRow[] srows = dt.Select("ParentID=" + rows[j]["ID"] + "");//父级编号为为清单ID的项为子目
                    for (int k = 0; k < srows.Length; k++)
                    {
                        _MSubheadingsInfo sinfo = new _MSubheadingsInfo();

                        sinfo.XMMC        = srows[k]["Name"].ToString();
                        sinfo.LB          = srows[k]["Type"].ToString();
                        sinfo.JSJC        = srows[k]["Calculation"].ToString();
                        sinfo.FL          = srows[k]["Rate"].ToString();
                        sinfo.DW          = srows[k]["Unit"].ToString();
                        sinfo.LibraryName = this.Parent.Property.DLibraries.FixedLibrary.FullName;
                        sinfo.GCL         = 1m;
                        sinfo.XMBM        = srows[k]["Codes"].ToString();
                        sinfo.OLDXMBM     = srows[k]["Codes"].ToString();
                        minfo.Create(sinfo);
                    }
                }
            }
        }