/// <summary> /// 修改工程量 /// </summary> public override void UpGCL() { bool flag = ToolKit.ParseBoolen(APP.Application.Global.Configuration.Configs["清单工程量设置"]); if (flag) { DataRow[] rows = this.GetDataSource.Select(string.Format("PID={0} and SSLB={1} and TX <> '子目-增加费'", this.Current.ID, this.Current.SSLB), "", DataViewRowState.CurrentRows); _Methods_Subheadings met = new _Methods_Subheadings(this.CurrentBusiness, this.Unit, null); foreach (DataRow row in rows) { row["GCL"] = (ToolKit.ParseDecimal(row["HL"]) * this.Current.GCL).ToString("F4"); _Entity_SubInfo info = new _Entity_SubInfo(); _ObjectSource.GetObject(info, row); met.Current = info; met.UpZMGLJGCL(); met.BeginCurrent();//计算子目当前数据 if (!string.IsNullOrEmpty(info.QDBH)) { DataRow[] rows1 = this.Unit.StructSource.ModelMeasures.Select(string.Format("QDBH={0} and XMBM='{1}'", info.QDBH, info.XMBM)); _Mothods_MSubheadings mett = new _Mothods_MSubheadings(this.CurrentBusiness, this.Unit, null); foreach (DataRow item in rows1) { _Entity_SubInfo sinfo = new _Entity_SubInfo(); _ObjectSource.GetObject(sinfo, item); sinfo.GCL = info.GCL * _Methods.GetNumber(sinfo.DW); mett.Current = sinfo; mett.UpGCL(); } } } } this.Begin(null); }
public void AllSubhendingCalcCurrent() { DataRow[] rows = this.GetDataSource.Select(string.Format("PID={0} and SSLB={1}", this.Current.ID, this.Current.SSLB), "", DataViewRowState.CurrentRows); _Methods_Subheadings met = new _Methods_Subheadings(this.CurrentBusiness, this.Unit, null); foreach (DataRow row in rows) { _Entity_SubInfo info = new _Entity_SubInfo(); _ObjectSource.GetObject(info, row); met.Current = info; met.BeginCurrent();//计算子目当前数据 } }
/// <summary> /// /// </summary> /// <param name="p_Sort"></param> /// <param name="info"></param> /// <returns></returns> public _Entity_SubInfo CreateZM(int p_Sort, _Entity_SubInfo info, bool isGCL) { if (string.IsNullOrEmpty(this.Current.XMBM) && string.IsNullOrEmpty(this.Current.XMMC)) { return(info); } info.PID = this.Current.ID; info.CPARENTID = this.Current.ID; info.FPARENTID = this.Current.ID; info.PPARENTID = this.Current.ID; info.SSLB = this.Current.SSLB; info.EnID = this.Current.EnID; info.UnID = this.Current.UnID; info.Deep = 6;//子目深度为6 this.SetSort(p_Sort, info); info.Key = ++this.CurrentBusiness.Current.ObjectKey; info.PKey = this.Current.Key; if (isGCL) { info.GCL = this.Current.GCL; SetZMGCL(info); } //设置子目的工程量以及消耗量 info.QDBH = this.Current.ID.ToString();//设置清单编码 用于措施到模板 if (info.SSLB.Equals(1)) { this.Unit.StructSource.ModelMeasures.Add(info); } else { this.Unit.StructSource.ModelSubSegments.Add(info); } //创建子目参数表 this.Unit.StructSource.ModelVariable.Init_ZM(info.ID, info.SSLB); //添加工料机 _Methods_Subheadings mSub = new _Methods_Subheadings(this.CurrentBusiness, this.Unit, info); mSub.Create(); if (OnZiMuAdded != null) { OnZiMuAdded(info); } mSub.BeginCurrent();//只计算当前 return(info); }