示例#1
0
        public override void Begin(List <int> session)
        {
            if (session != null)
            {
                if (session.Contains(Current.ID))
                {
                    return;
                }
                else
                {
                    session.Add(Current.ID);
                }
            }


            _Entity_SubInfo info = null;
            DataRow         row  = null;
            _Methods        met  = null;

            _SubSegment_Statistics sta = new _SubSegment_Statistics(this.Current, this.Unit);

            sta.DataSource = this.GetDataSource;
            sta.Begin();

            //计算子目所属分部
            info = new _Entity_SubInfo();
            row  = this.Unit.StructSource.ModelSubSegments.GetRowByOther("1");
            _ObjectSource.GetObject(info, row);
            met = new _Method_Sub(this.CurrentBusiness, this.Unit, info);
            met.Begin(session);
        }
示例#2
0
        /// <summary>
        /// 分部分项编辑之后的撤销
        /// </summary>
        public static void Edit_Sub(string filedName, _Methods met, DataRow row)
        {
            switch (filedName)
            {
            case _ObjectInfo.FILED_GCL:
                met.UpGCL();
                break;

            case "HL":
                met.UpHL();
                break;

            case "ZJTJ":
                met.UpZJTJ();
                break;

            case _ObjectInfo.FILED_GCLJSS:
                met.Current.TYGS = string.Empty;
                row["GCL"]       = ToolKit.Calculate(row["GCLJSS"].ToString());
                _ObjectSource.GetObject(met.Current, row);
                met.UpGCL();
                break;

            default:
                break;
            }
        }
示例#3
0
        public static _Methods CreateIntaceMet(_Business m_Currentbus, _UnitProject p_un, _Entity_SubInfo info)
        {
            _Methods m = new _Methods(m_Currentbus, p_un, info);

            if (info.PID == 0)
            {
                m = new _Mothod_Measures(m_Currentbus, p_un, info);
                return(m);
            }
            if (string.IsNullOrEmpty(info.LB) && info.PID != 0)
            {
                m = new _Motheds_CommonProj(m_Currentbus, p_un, info);
                return(m);
            }

            if (info.LB.Equals("清单"))
            {
                m = new _Mothods_MFixed(m_Currentbus, p_un, info);
                return(m);
            }
            if (info.LB.Contains("子目"))
            {
                m = new _Mothods_MSubheadings(m_Currentbus, p_un, info);
                return(m);
            }
            return(m);
        }
示例#4
0
        public static _Methods CreateIntace(_Business m_Currentbus, _UnitProject p_un, _Entity_SubInfo info)
        {
            _Methods m = new _Methods(m_Currentbus, p_un, info);

            switch (info.LB)
            {
            case "分部-专业":
                m = new _Methods_Pro(m_Currentbus, p_un, info);
                break;

            case "分部-章":
                m = new _Method_Chapt(m_Currentbus, p_un, info);
                break;

            case "分部-节":
                m = new _Method_Fest(m_Currentbus, p_un, info);
                break;

            case "清单":
                m = new _Methods_Fixed(m_Currentbus, p_un, info);
                break;

            case "子目":
                m = new _Methods_Subheadings(m_Currentbus, p_un, info);
                break;

            default:
                break;
            }
            return(m);
        }
示例#5
0
        public override void Begin(List <int> session)
        {
            if (session != null)
            {
                if (session.Contains(Current.ID))
                {
                    return;
                }
                else
                {
                    session.Add(Current.ID);
                }
            }

            _Entity_SubInfo info = null;
            DataRow         row  = null;
            _Methods        met  = null;

            _FixedList_Statistics sta = new _FixedList_Statistics(this.Current, this.Unit);

            sta.DataSource = this.GetDataSource;
            sta.Begin(this.Unit.StructSource.ModelMeasures.Select("PID = " + this.Current.ID));

            //计算子目所属节
            info = new _Entity_SubInfo();
            row  = this.Unit.StructSource.ModelMeasures.GetRowByOther(this.Current.PID.ToString());
            if (row == null)
            {
                return;
            }
            _ObjectSource.GetObject(info, row);
            met = new _Motheds_CommonProj(this.CurrentBusiness, this.Unit, info);
            met.Begin(session);
        }
示例#6
0
        public override void Begin(List <int> session)
        {
            if (session != null)
            {
                if (session.Contains(Current.ID))
                {
                    return;
                }
                else
                {
                    session.Add(Current.ID);
                }
            }

            //工料机计算(没经过子目取费)

            /*_Entity_SubInfo info = null;
             * DataRow row = null;
             * _Methods met = null;
             *
             *
             * _Subheadings_Statistics stat = new _Subheadings_Statistics(this.Current, this.Unit);
             * stat.DataSource = this.GetDataSource;
             * stat.Begin();
             * //计算子目经过子目取费
             * _ResultSubheadings_Statictics sta = new _ResultSubheadings_Statictics(this.Current, this.Unit);
             * sta.DataSource = this.GetDataSource;
             * sta.Begin();
             *
             * //计算子目所属清单
             * info = new _Entity_SubInfo();
             * row = this.Unit.StructSource.ModelSubSegments.GetRowByOther(this.Current.PID.ToString());
             * _ObjectSource.GetObject(info, row);
             * met = new _Methods_Fixed(this.Unit, info);
             * met.Begin();*/
            _Entity_SubInfo info = null;
            DataRow         row  = null;
            _Methods        met  = null;

            _Subheadings_Statistics stat = new _Subheadings_Statistics(this.Current, this.Unit);

            stat.Begin();
            //计算子目经过子目取费
            _ResultSubheadings_Statictics sta = new _ResultSubheadings_Statictics(this.Current, this.Unit);

            sta.DataSource = this.GetDataSource;
            sta.Begin();

            //计算子目所属清单
            info = new _Entity_SubInfo();
            row  = this.Unit.StructSource.ModelMeasures.GetRowByOther(this.Current.PID.ToString());
            _ObjectSource.GetObject(info, row);
            met = new _Mothods_MFixed(this.CurrentBusiness, this.Unit, info);
            met.Begin(session);
        }
示例#7
0
        void ProjWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            foreach (DataRowView item in this.treeList1.CheckNodes)
            {
                _Entity_SubInfo info = new _Entity_SubInfo();
                _ObjectSource.GetObject(info, item);
                CopyTo(info);

                GLODSOFT.QDJJ.BUSINESS._Methods calculateMethod = GLODSOFT.QDJJ.BUSINESS._Methods.CreateIntace(this.CurrentBusiness, this.Activitie, info);
                calculateMethod.Begin(null);
            }
        }
示例#8
0
        /// <summary>
        /// 子目取费计算
        /// </summary>
        public override void SubheadingsFeeCurrent()
        {
            //工料机计算(没经过子目取费)
            _Entity_SubInfo         info = null;
            DataRow                 row  = null;
            _Methods                met  = null;
            _Subheadings_Statistics stat = new _Subheadings_Statistics(this.Current, this.Unit);

            stat.FBegin();
            //计算子目经过子目取费
            _ResultSubheadings_Statictics sta = new _ResultSubheadings_Statictics(this.Current, this.Unit);

            sta.DataSource = this.GetDataSource;
            sta.Begin();
            //计算子目所属清单
            info = new _Entity_SubInfo();
            row  = this.Unit.StructSource.ModelSubSegments.GetRowByOther(this.Current.PID.ToString());
            _ObjectSource.GetObject(info, row);
            met = new _Methods_Fixed(this.CurrentBusiness, this.Unit, info);
            met.Begin(null);
        }
示例#9
0
        /// <summary>
        /// 单位工程计算
        /// </summary>
        public void Calculate()
        {
            this.Unit.IsCalculated = false;
            this.RestXH();
            //this.DeleteKong();
            _Methods method = null;

            method = new _Method_Sub(null, this.Unit, this.GetSub());
            method.Calculate();
            method = new _Mothod_Measures(null, this.Unit, this.GetTop1MeasureItem());
            method.Calculate();
            this.Begin();
            method = new _Method_OtherProject(null, this.Unit);
            method.Calculate();
            this.Begin();
            method = new _Method_Metaanalysis(this.Unit);
            method.Calculate();

            CalculateWithouSubsegment();
            this.Unit.NeedCalculate = true;
        }
示例#10
0
        /// <summary>
        /// 计算子目
        /// </summary>
        public override void Begin(List <int> session)
        {
            if (session != null)
            {
                if (session.Contains(Current.ID))
                {
                    return;
                }
                else
                {
                    session.Add(Current.ID);
                }
            }

            //工料机计算(没经过子目取费)
            _Entity_SubInfo info = null;
            DataRow         row  = null;
            _Methods        met  = null;

            if (Current.LB != "子目-增加费")
            {
                _Subheadings_Statistics stat = new _Subheadings_Statistics(this.Current, this.Unit);
                stat.Begin();
                //计算子目经过子目取费
                _ResultSubheadings_Statictics sta = new _ResultSubheadings_Statictics(this.Current, this.Unit);
                sta.DataSource = this.GetDataSource;
                sta.Begin();
            }

            //计算子目所属清单
            info = new _Entity_SubInfo();
            row  = this.Unit.StructSource.ModelSubSegments.GetRowByOther(this.Current.PID.ToString());
            var fix = _Entity_SubInfo.Parse(row);

            //var increase = new _Methods_IncreaseInfo(Current, new _Entity_IncreaseCosts());
            _ObjectSource.GetObject(info, row);
            met = new _Methods_Fixed(this.CurrentBusiness, this.Unit, info);
            met.Begin(session);
        }
示例#11
0
        private void LoadTable(DataTable dt)
        {
            if (dt == null)
            {
                return;
            }

            _Methods met = null;

            DataRow[] crows = dt.Select("ParentID=1");//父级编号为1的为通用项目
            int       xh    = 1;

            for (int i = 0; i < crows.Length; i++)
            {
                _Entity_SubInfo info = new _Entity_SubInfo();
                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();
                info.SC      = true;
                info.JBHZ    = true;
                //通用项目添加到集合
                this.Create(i, info);
                DataRow[] rows = dt.Select("ParentID=" + crows[i]["ID"] + "");//父级编号为为通用项目ID的项为清单
                int       m    = 1;
                for (int j = 0; j < rows.Length; j++)
                {
                    _Entity_SubInfo minfo = new _Entity_SubInfo();

                    minfo.XMMC    = rows[j]["Name"].ToString();
                    minfo.LB      = rows[j]["Type"].ToString();
                    minfo.GCL     = 1m;
                    minfo.JSJC    = rows[j]["Calculation"].ToString();
                    minfo.FL      = ToolKit.ParseDecimal(rows[j]["Rate"]);
                    minfo.DW      = rows[j]["Unit"].ToString();
                    minfo.XMBM    = rows[j]["Codes"].ToString();
                    minfo.OLDXMBM = rows[j]["Codes"].ToString();
                    minfo.SC      = true;
                    minfo.JBHZ    = true;
                    minfo.XH      = xh++;
                    minfo.ZJFS    = "子目组价";
                    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);
                    met = new _Motheds_CommonProj(this.CurrentBusiness, this.Unit, info);
                    met.Create(j, minfo);

                    DataRow[] srows = dt.Select("ParentID=" + rows[j]["ID"] + "");//父级编号为为清单ID的项为子目
                    for (int k = 0; k < srows.Length; k++)
                    {
                        _Entity_SubInfo sinfo = new _Entity_SubInfo();
                        sinfo.XMMC        = srows[k]["Name"].ToString();
                        sinfo.LB          = srows[k]["Type"].ToString();
                        sinfo.JSJC        = srows[k]["Calculation"].ToString();
                        sinfo.FL          = ToolKit.ParseDecimal(srows[k]["Rate"]);
                        sinfo.DW          = srows[k]["Unit"].ToString();
                        sinfo.LibraryName = this.Unit.Property.DLibraries.FixedLibrary.FullName;
                        sinfo.GCL         = 1m;
                        sinfo.XMBM        = srows[k]["Codes"].ToString();
                        sinfo.OLDXMBM     = srows[k]["Codes"].ToString();
                        sinfo.SC          = true;
                        sinfo.JBHZ        = true;
                        if (!string.IsNullOrEmpty(sinfo.JSJC))
                        {
                            sinfo.ZJFS = "公式组价";
                        }
                        //minfo.Create(sinfo);
                        met = new _Mothods_MFixed(this.CurrentBusiness, this.Unit, minfo);
                        met.Create(k, sinfo);
                    }
                }
            }
        }
示例#12
0
        private void LoadTempletTable(DataTable dt, Calculator calculator)
        {
            if (dt == null)
            {
                return;
            }
            try
            {
                _Methods met = null;
                string where = "PID=1";
                DataRow[] rs = dt.Select("PID=0");
                if (rs.Length > 0)
                {
                    where = string.Format("PID={0}", rs[0]["ID"]);
                }
                DataRow[] crows = dt.Select(where);//父级编号为1的为通用项目
                int       xh    = 1;
                for (int i = 0; i < crows.Length; i++)
                {
                    _Entity_SubInfo info = GetInfoByRow(crows[i]);
                    //info.JSJC = "";
                    ////info.FL = "";
                    //info.GCL = 0m;
                    //info.XMMC = crows[i]["XMMC"].ToString();
                    //info.XMBM = crows[i]["XMBM"].ToString();
                    //info.OLDXMBM = crows[i]["OLDXMBM"].ToString();
                    //info.JBHZ =ToolKit.ParseBoolen (crows[i]["JBHZ"]);
                    //info.SC = ToolKit.ParseBoolen (crows[i]["SC"]);
                    //通用项目添加到集合
                    this.Create(i, info);
                    DataRow[] rows = dt.Select("PID=" + crows[i]["ID"] + "");//父级编号为为通用项目ID的项为清单
                    int       m    = 1;
                    for (int j = 0; j < rows.Length; j++)
                    {
                        _Entity_SubInfo minfo = GetInfoByRow(rows[j]);

                        //minfo.XMMC = rows[j]["XMMC"].ToString();
                        //minfo.LB = rows[j]["LB"].ToString();
                        //minfo.GCL = 1m;
                        //minfo.JSJC = rows[j]["JSJC"].ToString();
                        //minfo.FL = ToolKit.ParseDecimal(rows[j]["FL"]);
                        //minfo.DW = rows[j]["DW"].ToString();
                        //minfo.XMBM = rows[j]["XMBM"].ToString();
                        //minfo.OLDXMBM = rows[j]["OLDXMBM"].ToString();
                        //minfo.JBHZ = ToolKit.ParseBoolen(rows[j]["JBHZ"]);
                        //minfo.SC = ToolKit.ParseBoolen(rows[j]["SC"]);
                        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);
                        met = new _Motheds_CommonProj(this.CurrentBusiness, this.Unit, info);
                        calculator.Entities.Add(met.Create(j, minfo));

                        DataRow[] srows = dt.Select("PID=" + rows[j]["ID"] + "");//父级编号为为清单ID的项为子目
                        for (int k = 0; k < srows.Length; k++)
                        {
                            _Entity_SubInfo sinfo = GetInfoByRow(srows[k]);
                            //sinfo.XMMC = srows[k]["XMMC"].ToString();
                            //sinfo.LB = srows[k]["LB"].ToString();
                            //sinfo.JSJC = srows[k]["JSJC"].ToString();
                            //minfo.FL = ToolKit.ParseDecimal(rows[k]["FL"]);
                            //sinfo.DW = srows[k]["DW"].ToString();
                            sinfo.LibraryName = this.Unit.Property.DLibraries.FixedLibrary.FullName;
                            //sinfo.GCL = 1m;
                            //sinfo.XMBM = srows[k]["XMBM"].ToString();
                            //sinfo.OLDXMBM = srows[k]["OLDXMBM"].ToString();
                            //sinfo.JBHZ = ToolKit.ParseBoolen(srows[k]["JBHZ"]);
                            //sinfo.SC = ToolKit.ParseBoolen(srows[k]["SC"]);
                            //minfo.Create(sinfo);
                            met = new _Mothods_MFixed(this.CurrentBusiness, this.Unit, minfo);
                            calculator.Entities.Add(met.Create(k, sinfo));
                        }
                    }
                }
            }
            catch (Exception e)
            {
                throw e;
            }
        }
示例#13
0
        private void Create(DataRowView p_QD)
        {
            int i = 0;

            foreach (DataRowView v in this.m_ArrDE)
            {
                _Entity_SubInfo sinfo = new _Entity_SubInfo();
                _ObjectSource.GetObject(sinfo, v.Row);
                DataRow[] rowsGLJ  = this.Activitie.StructSource.ModelQuantity.Select(string.Format("ZMID={0} and SSLB={1}  and ZCLB='W'", sinfo.ID, sinfo.SSLB));
                DataRow[] rowsZMQF = this.Activitie.StructSource.ModelSubheadingsFee.Select(string.Format("ZMID={0} and SSLB={1}", sinfo.ID, sinfo.SSLB));
                DataRow[] rowsBZHS = this.Activitie.StructSource.ModelStandardConversion.Select(string.Format("ZMID={0} and SSLB={1}", sinfo.ID, sinfo.SSLB));
                DataRow[] rowsZJF  = this.Activitie.StructSource.ModelIncreaseCosts.Select(string.Format("ZMID={0} and SSLB={1}", sinfo.ID, sinfo.SSLB));
                DataRow[] rowsBL   = this.Activitie.StructSource.ModelVariable.Select(string.Format("ID={0} and Type={1}", sinfo.ID, sinfo.SSLB));
                sinfo.PID       = ToolKit.ParseInt(p_QD["ID"]);
                sinfo.Key       = ++this.CurrentBusiness.Current.ObjectKey;
                sinfo.PKey      = ToolKit.ParseInt(p_QD["Key"]);
                sinfo.CPARENTID = sinfo.PID;
                sinfo.FPARENTID = sinfo.PID;
                sinfo.PPARENTID = sinfo.PID;
                //sinfo.SSLB = this.Current.SSLB;
                //sinfo.EnID = this.Current.EnID;
                // sinfo.UnID = this.Current.UnID;
                sinfo.BEIZHU = GLODSOFT.QDJJ.BUSINESS._Methods.GetDEbeizhu(strCZBM, ++i, p_QD["OLDXMBM"].ToString());
                this.Activitie.StructSource.ModelSubSegments.Add(sinfo);
                foreach (DataRow item in rowsGLJ)
                {
                    DataRow[] rowsZC = this.Activitie.StructSource.ModelQuantity.Select(string.Format("PID={0} and SSLB={1}", item["ID"], sinfo.SSLB));

                    DataRow r_glj = this.Activitie.StructSource.ModelQuantity.Add(item);
                    r_glj["ZMID"] = sinfo.ID;
                    r_glj["QDID"] = ToolKit.ParseInt(p_QD["ID"]);
                    foreach (DataRow row in rowsZC)
                    {
                        DataRow phb = this.Activitie.StructSource.ModelQuantity.Add(row);
                        phb["ZMID"] = sinfo.ID;
                        phb["QDID"] = ToolKit.ParseInt(p_QD["ID"]);
                        phb["PID"]  = r_glj["ID"];
                    }
                }
                foreach (DataRow item in rowsZMQF)
                {
                    DataRow r_glj = this.Activitie.StructSource.ModelSubheadingsFee.Add(item);
                    r_glj["ZMID"] = sinfo.ID;
                    r_glj["QDID"] = ToolKit.ParseInt(p_QD["ID"]);
                }
                foreach (DataRow item in rowsBZHS)
                {
                    DataRow r_glj = this.Activitie.StructSource.ModelSubheadingsFee.Add(item);
                    r_glj["ZMID"] = sinfo.ID;
                    r_glj["QDID"] = ToolKit.ParseInt(p_QD["ID"]);
                }
                foreach (DataRow item in rowsZJF)
                {
                    DataRow r_glj = this.Activitie.StructSource.ModelSubheadingsFee.Add(item);
                    r_glj["ZMID"] = sinfo.ID;
                    r_glj["QDID"] = ToolKit.ParseInt(p_QD["ID"]);
                }
                foreach (DataRow item in rowsBL)
                {
                    DataRow r = this.Activitie.StructSource.ModelVariable.NewRow();
                    r.ItemArray = item.ItemArray;
                    r["ID"]     = sinfo.ID;
                    this.Activitie.StructSource.ModelVariable.Rows.Add(r);
                }

                GLODSOFT.QDJJ.BUSINESS._Methods calculateMethod = GLODSOFT.QDJJ.BUSINESS._Methods.CreateIntace(this.CurrentBusiness, this.Activitie, sinfo);
                _Modify_Method.Edit_Sub("HL", calculateMethod, v.Row);
            }
        }