Esempio n. 1
0
        public override void FastCalculate()
        {
            if (this.Current.NeedCalculate)
            {
                var statistics = new _Project_Statistics(this.Current as _UnitProject, this);
                statistics.CalculateWithouSubsegment();

                this.Current.NeedCalculate = false;
            }
        }
Esempio n. 2
0
        public override void FastCalculate()
        {
            try
            {
                //合并数据项目结构数据
                this.Current.StructSource.MergeData();
                //计算数据
                _Project_Statistics sta = null;
                //循环计算
                foreach (_UnitProject info in this.ObjectList.Values)
                {
                    if (info.NeedCalculate)
                    {
                        sta = new _Project_Statistics(info, this);
                        sta.CalculateWithouSubsegment();

                        //删除当前单位工程下数据
                        DataTable table = null;
                        //分部分项表
                        table = info.StructSource.ModelSubSegments;
                        if (table != null)
                        {
                            this.Current.StructSource.ModelSubSegments.MergeData(table);
                        }
                        //措施项目表
                        table = info.StructSource.ModelMeasures;
                        if (table != null)
                        {
                            this.Current.StructSource.ModelMeasures.MergeData(table);
                        }
                        //其他项目表
                        table = info.StructSource.ModelOtherProject;
                        if (table != null)
                        {
                            this.Current.StructSource.ModelOtherProject.MergeData(table);
                        }
                        //工料机
                        table = info.StructSource.ModelQuantity;
                        if (table != null)
                        {
                            this.Current.StructSource.ModelQuantity.MergeData(table);
                        }

                        //汇总分析表
                        table = info.StructSource.ModelMetaanalysis;
                        if (table != null)
                        {
                            this.Current.StructSource.ModelMetaanalysis.MergeData(table);
                        }

                        //计算结果表
                        table = info.StructSource.ModelProjVariable;
                        if (table != null)
                        {
                            this.Current.StructSource.ModelProjVariable.MergeData(table);
                        }

                        info.NeedCalculate = false;
                    }
                }

                //参数累加计算
                this.Current.StructSource.Statistics();
                //保存数据
                //this.Save();
                //重新读取当前项目数据
                //this.Load();
            }
            catch (Exception e)
            {
                throw e;
            }
        }