示例#1
0
        private _ObjectInfo GetQIncreaseCosts()
        {
            _ObjectInfo       info  = null;
            _SubheadingsInfo  info1 = this.Parent as _SubheadingsInfo;
            _MSubheadingsInfo info2 = this.Parent as _MSubheadingsInfo;

            if (info1 != null)
            {
                foreach (_ObjectInfo item in info1.Parent.IncreaseCostsList)
                {
                    if (item.XMBM == this.DH)
                    {
                        return(item);
                    }
                }
            }
            if (info2 != null)
            {
                foreach (_ObjectInfo item in info2.Parent.IncreaseCostsList)
                {
                    if (item.XMBM == this.DH)
                    {
                        return(item);
                    }
                }
            }

            return(info);
        }
示例#2
0
        /// <summary>
        /// 清单的下面的增加费计算
        /// </summary>
        private void PBegin()
        {
            _ObjectInfo       info  = GetQIncreaseCosts();
            _SubheadingsInfo  info1 = info as _SubheadingsInfo;
            _MSubheadingsInfo info2 = info as _MSubheadingsInfo;

            if (info1 != null)
            {
                Result result = GetResult();
                info1.Statistics.ResultVarable.Set(_Statistics.FILED_RGFDJ, result.RGF);
                info1.Statistics.ResultVarable.Set(_Statistics.FILED_CLFDJ, result.CLF);
                info1.Statistics.ResultVarable.Set(_Statistics.FILED_JXFDJ, result.JXF);

                decimal temp = result.JXF + result.CLF + result.RGF;
                info1.Statistics.ResultVarable.Set(_Statistics.FILED_ZJFDJ, temp);
                info1.Statistics.ResultVarable.Set(_Statistics.FILED_ZHDJ, temp);
                info1.Begin();
            }

            if (info2 != null)
            {
                Result result = GetResult();
                info2.Statistics.ResultVarable.Set(_Statistics.FILED_RGFDJ, result.RGF);
                info2.Statistics.ResultVarable.Set(_Statistics.FILED_CLFDJ, result.CLF);
                info2.Statistics.ResultVarable.Set(_Statistics.FILED_JXFDJ, result.JXF);

                decimal temp = result.JXF + result.CLF + result.RGF;
                info2.Statistics.ResultVarable.Set(_Statistics.FILED_ZJFDJ, temp);
                info2.Statistics.ResultVarable.Set(_Statistics.FILED_ZHDJ, temp);
                info2.Begin();
            }
        }
示例#3
0
        /// <summary>
        /// xml创建使用
        /// </summary>
        /// <param name="info"></param>
        public virtual void CreateByXml(_SubheadingsInfo info)
        {
            //info.Activitie = this.Activitie;
            info.STATUS = false;
            info.IsCalc = true;
            //info.ID = this.m_Parent.ObjectID;
            info.PARENTID  = this.ID;
            info.CPARENTID = this.ID;
            info.FPARENTID = this.ID;
            info.PPARENTID = this.ID;

            this.m_SubheadingsList.Add(info);

            info.Create();
            if (info.LB == "子目")
            {
                //info.Subheadings_Statistics.Begin();
                //子目添加完成执行的事件
                if (info.IsHs)
                {
                    if (OnZiMuAdded != null)
                    {
                        OnZiMuAdded(info);
                    }
                }
            }
            else
            {
                // info.Begin();
                // this.Parent.DataSource.ResetBindings(false);
            }

            info.STATUS = true;
        }
示例#4
0
        public override void Create(_SubheadingsInfo info)
        {
            if (this.XMBM == "" && this.XMMC == "")
            {
                return;
            }
            //info.Activitie = this.Activitie;
            info.STATUS   = false;
            info.ID       = this.m_Parent.Parent.ObjectID;
            info.PARENTID = this.ID;
            info.Parent   = this;
            info.STATUS   = true;
            info.ZJFS     = _Constant.子目组价;
            if (!string.IsNullOrEmpty(info.JSJC))
            {
                info.ZJFS = _Constant.公式组价;
            }
            if (info.XMBM != "" && info.BEIZHU == "")
            {
                if (!string.IsNullOrEmpty(this.OLDXMBM))
                {
                    info.BEIZHU = this.OLDXMBM + "D" + DateTime.Now.ToString("yyyyMMddHHmmss");
                }
                else
                {
                    info.BEIZHU = this.XMBM + "D" + DateTime.Now.ToString("yyyyMMddHHmmss");
                }
            }

            this.SubheadingsList.Add(info);
            this.Parent.Parent.ObjectsList.Add(info);
            info.Create();
            info.Subheadings_Statistics.Begin();
            info.IsCalc = true;
        }
示例#5
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();;
        }
示例#6
0
 public virtual void OnZiMuAddEvent(_SubheadingsInfo info)
 {
     if (OnZiMuAdded != null)
     {
         OnZiMuAdded(info);
     }
 }
示例#7
0
        private Result GetResult()
        {
            Result result = new Result();

            _SubheadingsInfo  info1 = this.Parent as _SubheadingsInfo;
            _MSubheadingsInfo info2 = this.Parent as _MSubheadingsInfo;

            if (info1 != null)
            {
                foreach (_SubheadingsInfo item in info1.Parent.SubheadingsList)
                {
                    if (item.LB == "子目")
                    {
                        result.CLF += (from n in item.IncreaseCostsList.Cast <_IncreaseCostsInfo>() where n.DH == this.DH select n.CLF).Sum();
                        result.RGF += (from n in item.IncreaseCostsList.Cast <_IncreaseCostsInfo>() where n.DH == this.DH select n.RGF).Sum();
                        result.JXF += (from n in item.IncreaseCostsList.Cast <_IncreaseCostsInfo>() where n.DH == this.DH select n.JXF).Sum();
                    }
                }
            }
            if (info2 != null)
            {
                foreach (_SubheadingsInfo item in info2.Parent.SubheadingsList)
                {
                    if (item.LB == "子目")
                    {
                        result.CLF += (from n in item.IncreaseCostsList.Cast <_IncreaseCostsInfo>() where n.DH == this.DH select n.CLF).Sum();
                        result.RGF += (from n in item.IncreaseCostsList.Cast <_IncreaseCostsInfo>() where n.DH == this.DH select n.RGF).Sum();
                        result.JXF += (from n in item.IncreaseCostsList.Cast <_IncreaseCostsInfo>() where n.DH == this.DH select n.JXF).Sum();
                    }
                }
            }
            return(result);
        }
示例#8
0
        /// <summary>
        /// 双击跳转事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gridControl_DoubleClick(object sender, EventArgs e)
        {
            GridControl      m_GroupControl    = sender as GridControl;
            _SubheadingsInfo m_SubheadingsInfo = null;

            if (m_GroupControl != null)
            {
                if (m_GroupControl.Name == "gridControlFBFX")
                {
                    //只有双击子目对象有效其它不处理
                    m_SubheadingsInfo = this.bindingSourceFBFX.Current as _SubheadingsInfo;
                    if (m_SubheadingsInfo != null)
                    {
                        //选中双击子目对应在分部分项上的子目
                        m_SubheadingsInfo.Activitie.Property.SubSegments.ChangeSource();
                        m_SubheadingsInfo.Activitie.Property.SubSegments.DataSource.Position = m_SubheadingsInfo.Activitie.Property.SubSegments.DataSource.IndexOf(m_SubheadingsInfo);
                        this.Position(m_SubheadingsInfo);
                        this.DialogResult = DialogResult.OK;
                    }
                }
                else
                {
                    m_SubheadingsInfo = this.bindingSourceCSXM.Current as _SubheadingsInfo;
                    if (m_SubheadingsInfo != null)
                    {
                        m_SubheadingsInfo.Activitie.Property.MeasuresProject.DataSource.Position = m_SubheadingsInfo.Activitie.Property.MeasuresProject.DataSource.IndexOf(m_SubheadingsInfo);
                        this.Position(m_SubheadingsInfo);
                        this.DialogResult = DialogResult.Yes;
                    }
                }
            }
        }
        public override void Calculate()
        {
            _SubheadingsInfo info = this.Parent as _SubheadingsInfo;

            if (info.ZJFS != _Constant.公式组价 || info.LB == "子目-增加费")
            {
                info.Subheadings_Statistics.Calculate();
            }
            this.Begin();
        }
示例#10
0
        /// <summary>
        /// 设置选中
        /// </summary>
        /// <param name="p_SubheadingsInfo"></param>
        private void Position(_SubheadingsInfo p_SubheadingsInfo)
        {
            //查看选中的子目中是否存在双击反查的工料机 如果存在则选中工料机 如果不存在或者存在于组成中不选中
            IEnumerable <_ObjectQuantityUnitInfo> list = p_SubheadingsInfo.SubheadingsQuantityUnitList.Cast <_ObjectQuantityUnitInfo>().Where(p => p.BH == this.m_DataSource.BH);

            if (list.Count() == 1)
            {
                //选中反查工料机
                p_SubheadingsInfo.SubheadingsQuantityUnitList_BindingSource.Position = p_SubheadingsInfo.SubheadingsQuantityUnitList_BindingSource.IndexOf(list.ToList()[0] as _SubheadingsQuantityUnitInfo);
            }
        }
示例#11
0
 public override void Create(string m_DEH, int d)
 {
     DataRow[] rows = this.Activitie.Property.Libraries.FixedLibrary.LibraryDataSet.Tables["定额表"].Copy().Select(string.Format("DINGEH='{0}'", m_DEH));
     if (rows.Length > 0)
     {
         _SubheadingsInfo sinfo = new _SubheadingsInfo();
         this.Activitie.Property.SubSegments.Methods.SetSubheadingsInfo(sinfo, rows[0], this.Activitie.Property.Libraries.FixedLibrary.FullName);
         //view1.BEIZHU = (view1 as _SubheadingsInfo).Parent.OLDXMBM + "D" + DateTime.Now.ToString("yyyyMMddHHmmss");
         this.Create(sinfo);
         sinfo.XMBM += "*" + d + "";
     }
 }
示例#12
0
 public override void CreateByXml(_SubheadingsInfo info)
 {
     // info.Activitie = this.Activitie;
     if (this.XMBM == "" && this.XMMC == "")
     {
         return;
     }
     info.Parent = this;
     info.ID     = this.Parent.Parent.Parent.Parent.ObjectID;
     this.Parent.Parent.Parent.Parent.ObjectsList.Add(info);
     base.CreateByXml(info);
     if (info.XMBM != "" && info.BEIZHU == "")
     {
         info.BEIZHU = this.OLDXMBM + "D" + DateTime.Now.ToString("yyyyMMddHHmmss");
     }
 }
示例#13
0
        /// <summary>
        /// 清创建子目
        /// </summary>
        /// <returns>子目对象</returns>
        public _SubheadingsInfo Create()
        {
            _SubheadingsInfo info = new _SubheadingsInfo();

            info.Parent    = this;
            info.STATUS    = false;
            info.IsCalc    = true;
            info.PARENTID  = this.ID;
            info.CPARENTID = this.ID;
            info.FPARENTID = this.ID;
            info.PPARENTID = this.ID;

            info.Create();
            this.m_SubheadingsList.Add(info);
            info.STATUS = false;
            info.Subheadings_Statistics.Begin();
            this.Activitie.BeginEdit(this);
            return(info);
        }
示例#14
0
        /// <summary>
        /// 填充分部分项项目数据
        /// </summary>
        private void FileFBFX(_UnitProject p_UnitProject)
        {
            IEnumerable <_ObjectQuantityUnitInfo> m_list = p_UnitProject.Property.SubSegments.GetAllQuantityUnit.Cast <_ObjectQuantityUnitInfo>().Where(p => p.BH == m_DataSource.BH);

            foreach (_ObjectQuantityUnitInfo item in m_list)
            {
                _SubheadingsInfo m_SubheadingsInfo = null;
                if (item.GetType() == typeof(_SubheadingsQuantityUnitInfo))
                {
                    m_SubheadingsInfo = (item as _SubheadingsQuantityUnitInfo).Parent;
                }
                else
                {
                    m_SubheadingsInfo = (item as _QuantityUnitComponentInfo).Parent.Parent;
                }
                m_SubheadingsInfo.XHL = m_SubheadingsInfo.GetAllQuantityUnit.Cast <_ObjectQuantityUnitInfo>().Sum(p => p.XHL);
                this.GetFBFXInfo(m_SubheadingsInfo);
            }
        }
示例#15
0
        public virtual void Create(_SubheadingsInfo info)
        {
            //info.Activitie = this.Activitie;
            info.STATUS = false;
            info.IsCalc = true;
            //info.ID = this.m_Parent.ObjectID;
            info.PARENTID  = this.ID;
            info.CPARENTID = this.ID;
            info.FPARENTID = this.ID;
            info.PPARENTID = this.ID;
            int m = GCLSR();

            if (m > 0)
            {
                decimal d = _ConvertUnit.Convert(this.DW, info.DW);
                info.HL = d;
            }

            //info.Sort = this.Activitie.Property.SubSegments.GetSortByType(info.GetType()) + 1;
            this.m_SubheadingsList.Add(info);

            info.Create();
            if (info.LB == "子目")
            {
                info.Subheadings_Statistics.Begin();
                //子目添加完成执行的事件
                if (info.IsHs)
                {
                    this.OnZiMuAddEvent(info);
                }
            }
            else
            {
                info.Begin();
                // this.Parent.DataSource.ResetBindings(false);
            }

            info.STATUS = true;
            this.ActionAttribute("Create", "子目", info, null);
            this.Activitie.BeginEdit(this);
        }
示例#16
0
        /// <summary>
        /// 创建子目到指定位置
        /// </summary>
        /// <param name="info"></param>
        /// <param name="Index_info"></param>
        public override void Create(_SubheadingsInfo info, _SubheadingsInfo Index_info)
        {
            if (this.XMBM == "" && this.XMMC == "")
            {
                return;
            }
            info.Parent = this;
            info.ID     = this.Parent.Parent.Parent.Parent.ObjectID;
            this.Parent.Parent.Parent.Parent.ObjectsList.Insert(info, Index_info);
            base.Create(info);
            //if (info.IsHs)
            //{

            //        base.OnZiMuAddEvent(info);

            //}
            if (info.XMBM != "" && info.BEIZHU == "")
            {
                info.BEIZHU = this.OLDXMBM + "D" + DateTime.Now.ToString("yyyyMMddHHmmss");
            }
        }
示例#17
0
 public virtual void Del(_SubheadingsInfo info)
 {
 }
示例#18
0
 /// <summary>
 /// 删除指定子目
 /// </summary>
 /// <param name="info"></param>
 public virtual void Remove(_SubheadingsInfo info)
 {
     this.m_SubheadingsList.Remove(info);
     this.Activitie.BeginEdit(this);
     // this.Parent.Parent.Parent.Parent.ObjectsList.Remove(info);
 }
示例#19
0
 /// <summary>
 /// 清创建子目
 /// </summary>
 /// <returns>子目对象</returns>
 public virtual void Create(_SubheadingsInfo info, _SubheadingsInfo Index_info)
 {
 }
示例#20
0
 public override void Remove(_SubheadingsInfo info)
 {
     base.Remove(info);
     this.Parent.Parent.ObjectsList.Remove(info);
     this.Begin();
 }
示例#21
0
 /// <summary>
 /// 初始化:子目取费对象
 /// </summary>
 public _SubheadingsFeeInfo(_SubheadingsInfo p_Parent)
 {
     this.m_Parent = p_Parent;
 }
示例#22
0
 /// <summary>
 /// 初始化:标准换算对象
 /// </summary>
 /// <param name="p_Parent">所属:子目</param>
 public _StandardConversionInfo(_SubheadingsInfo p_Parent)
 {
     this.m_Parent = p_Parent;
 }
示例#23
0
 /// <summary>
 /// 初始化:子目工料机集合对象
 /// </summary>
 /// <param name="p_Parent">所属:子目</param>
 public _SubheadingsQuantityUnitList(_SubheadingsInfo p_Parent)
 {
     this.m_Parent = p_Parent;
 }
示例#24
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public _Subheadings_Statisticss(_SubheadingsInfo p_Parent)
 {
     this.m_Parent = p_Parent;
     this.Create();
 }
 /// <summary>
 /// 初始化:子目工料机对象
 /// </summary>
 /// <param name="p_Parent">所属:子目</param>
 public _SubheadingsQuantityUnitInfo(_SubheadingsInfo p_Parent)
 {
     this.m_Parent = p_Parent;
     this.m_QuantityUnitComponentList = new _QuantityUnitComponentList(this);
 }