/// <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); }
/// <summary> /// Copy当前清单到指定清单之下 /// </summary> /// <param name="QD_info"></param> public override void CopyTo(_Entity_SubInfo QD_info) { DataRow[] rows = this.Unit.StructSource.ModelSubSegments.Select(string.Format("PID={0} and SSLB={1}", this.Current.ID, this.Current.SSLB)); this.Current.Key = ++this.CurrentBusiness.Current.ObjectKey; if (QD_info == null) { this.SetSort(-1, this.Current); } else { this.SetSort(QD_info.Sort, this.Current); } int intCount = GLODSOFT.QDJJ.BUSINESS._Methods.GetCountByBH(this.Current.OLDXMBM, this.Unit.StructSource.ModelSubSegments); this.Current.BEIZHU = GLODSOFT.QDJJ.BUSINESS._Methods.GetQDbeizhu(this.Current.OLDXMBM, intCount, "YJFZ"); this.Unit.StructSource.ModelSubSegments.Add(this.Current); foreach (DataRow item in rows) { _Entity_SubInfo info = new _Entity_SubInfo(); _ObjectSource.GetObject(info, item); _Methods_Subheadings m = new _Methods_Subheadings(this.CurrentBusiness, this.Unit, info); m.CopyTo(this.Current); } }
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); }
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> private void CreateSubByCurrent() { DataRow[] rs = this.GetDataSource.Select(string.Format("PID={0}", this.Current.ID)); if (rs.Length > 0) { return; } _Entity_SubInfo info = new _Entity_SubInfo(); info.XMBM = "补" + this.Current.OLDXMBM.Replace("补", ""); info.OLDXMBM = this.Current.OLDXMBM.Replace("补", ""); info.XMMC = "补充定额"; info.GCL = this.Current.GCL; info.SC = true; info.LB = "子目"; info.DW = this.Current.DW; info.TX = this.Unit.ProType.Replace("【", "").Replace("】", "").Substring(0, 2); info.LibraryName = this.Unit.Property.Libraries.FixedLibrary.FullName; this.Create(false, -1, info); _Methods_Subheadings m = new _Methods_Subheadings(this.CurrentBusiness, this.Unit, info); _Methods_ParamsSeting m_Methods_ParamsSeting = new _Methods_ParamsSeting(this.Unit); DataRow dr_UnitFee = m_Methods_ParamsSeting.GetUnitFeeInfo(info.OLDXMBM); decimal gLF = ToolKit.ParseDecimal(dr_UnitFee["GLFFL"]) * 0.01m; decimal LR = ToolKit.ParseDecimal(dr_UnitFee["LRFL"]) * 0.01m; decimal xhl = this.Current.ZJTJ / (1 + gLF + LR + gLF * LR); DataRow r = this.Unit.StructSource.ModelQuantity.NewRow(); r["YSBH"] = APP.RepairQuantityUnit.GetRepairBH(this.Unit, "材料"); r["YSMC"] = info.XMMC; r["YSDW"] = info.DW; r["YSXHL"] = xhl; r["DEDJ"] = 1; r["BH"] = r["YSBH"]; r["MC"] = info.XMMC; r["DW"] = info.DW; r["XHL"] = xhl; r["SCDJ"] = 1; r["LB"] = "材料"; r["ZCLB"] = "W"; r["SDCLB"] = string.Empty; r["SDCXS"] = 0; r["IFSC"] = true; r["IFFX"] = false; r["IFSDSCDJ"] = false; r["IFZYCL"] = true; r["YTLB"] = string.Empty; m.CreateGLJ(r); }
public void Update_Quantity(DataRow p_DataRow, string p_FieldName) { string m_ID = string.Empty; foreach (_UnitProject item in this.ObjectList.Values) { DataRow dr = item.StructSource.ModelQuantity.Select(string.Format("BH='{0}' AND MC='{1}' AND DW='{2}' AND SCDJ={3} AND YTLB='{4}' AND LB='{5}' AND IFSDSCDJ='{6}'", p_DataRow["BH"], p_DataRow["MC"], p_DataRow["DW"], p_DataRow["SCDJ", DataRowVersion.Current], p_DataRow["YTLB"], p_DataRow["LB"], p_DataRow["IFSDSCDJ"])).FirstOrDefault(); if (dr != null) { _Methods_Subheadings m_Methods_Subheadings = new _Methods_Subheadings(item); APP.UserPriceLibrary.AllQuantityUnit = item.StructSource.ModelQuantity; APP.UserPriceLibrary.UnName = item.Name; APP.UserPriceLibrary.Range = 0; APP.UserPriceLibrary.Update(p_FieldName, p_DataRow[p_FieldName, DataRowVersion.Proposed], p_DataRow); m_Methods_Subheadings.BatchCalculate(); m_ID += item.ID + ","; } } if (m_ID != string.Empty) { m_ID = m_ID.Substring(0, m_ID.Length - 1); } else { m_ID = "-1"; } DataRow[] drs = this.Current.StructSource.ModelProject.Select(string.Format("Deep=2 AND ID not in({0})", m_ID)); foreach (DataRow item in drs) { DataRow dr = this.Current.StructSource.ModelQuantity.Select(string.Format("BH='{0}' AND MC='{1}' AND DW='{2}' AND SCDJ={3} AND YTLB='{4}' AND LB='{5}' AND IFSDSCDJ='{6}' AND UnID={7}", p_DataRow["BH"], p_DataRow["MC"], p_DataRow["DW"], p_DataRow["SCDJ", DataRowVersion.Current], p_DataRow["YTLB"], p_DataRow["LB"], p_DataRow["IFSDSCDJ"], item["ID"])).FirstOrDefault(); if (dr != null) { using (_UnitProject m_UnitProject = new _UnitProject()) { _ObjectSource.GetObject(m_UnitProject, item); this.ProjectSummaryLoad(m_UnitProject); if (dr != null) { _Methods_Subheadings m_Methods_Subheadings = new _Methods_Subheadings(m_UnitProject); APP.UserPriceLibrary.AllQuantityUnit = m_UnitProject.StructSource.ModelQuantity; APP.UserPriceLibrary.UnName = m_UnitProject.Name; APP.UserPriceLibrary.Range = 0; APP.UserPriceLibrary.Update(p_FieldName, p_DataRow[p_FieldName, DataRowVersion.Proposed], p_DataRow); m_Methods_Subheadings.BatchCalculate(); this.SaveUnitFormXml(m_UnitProject); } } } } }
public override void Calculate() { DataRow[] rows = this.GetDataSource.Select(string.Format("PID={0}", this.Current.ID), "", DataViewRowState.CurrentRows); foreach (DataRow item in rows) { _Entity_SubInfo info = new _Entity_SubInfo(); _ObjectSource.GetObject(info, item); _Methods_Subheadings met = new _Methods_Subheadings(this.CurrentBusiness, this.Unit, info); met.Calculate(); } _FixedList_Statistics sta = new _FixedList_Statistics(this.Current, this.Unit); sta.DataSource = this.GetDataSource; sta.Begin(GetDataSource.Select("PID = '" + Current.ID + "'")); }
/// <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); }
public void Update_Quantity(DataTable p_DataTable, string p_FieldName) { if (p_DataTable == null) { return; } string m_ID = "-10"; foreach (_UnitProject item in this.ObjectList.Values) { _Methods_Subheadings m_Methods_Subheadings = null; foreach (DataRow glj_item in p_DataTable.Rows) { if (glj_item.HasVersion(DataRowVersion.Original)) { DataRow dr = item.StructSource.ModelQuantity.Select(string.Format("BH='{0}' AND MC='{1}' AND DW='{2}' AND SCDJ={3} AND YTLB='{4}' AND LB='{5}' AND IFSDSCDJ='{6}'", glj_item["BH"], glj_item["MC"], glj_item["DW"], glj_item["SCDJ", DataRowVersion.Original], glj_item["YTLB"], glj_item["LB"], glj_item["IFSDSCDJ"])).FirstOrDefault(); if (dr != null) { if (m_Methods_Subheadings == null) { m_Methods_Subheadings = new _Methods_Subheadings(item); } APP.UserPriceLibrary.AllQuantityUnit = item.StructSource.ModelQuantity; APP.UserPriceLibrary.UnName = item.Name; APP.UserPriceLibrary.Range = 0; dr.BeginEdit(); dr[p_FieldName] = glj_item[p_FieldName]; APP.UserPriceLibrary.Update(p_FieldName, dr[p_FieldName, DataRowVersion.Current], dr); dr.EndEdit(); if (p_FieldName.Equals("SCDJ")) { _Methods_YTLBSummary m_Methods_YTLBSummary = new _Methods_YTLBSummary(item); m_Methods_YTLBSummary.RefreshSCDJ(glj_item); } m_ID += item.ID + ","; } } } if (m_Methods_Subheadings != null) { m_Methods_Subheadings.BatchCalculate(); } } if (m_ID != string.Empty) { m_ID = m_ID.Substring(0, m_ID.Length - 1); DataRow[] drs = this.Current.StructSource.ModelProject.Select(string.Format("Deep=2 AND ID not in({0})", m_ID)); foreach (DataRow item in drs) { using (_UnitProject m_UnitProject = new _UnitProject()) { _Methods_Subheadings m_Methods_Subheadings = null; bool m_load = true; foreach (DataRow glj_item in p_DataTable.Rows) { if (glj_item.HasVersion(DataRowVersion.Original)) { DataRow dr = this.Current.StructSource.ModelQuantity.Select(string.Format("BH='{0}' AND MC='{1}' AND DW='{2}' AND SCDJ={3} AND YTLB='{4}' AND LB='{5}' AND IFSDSCDJ='{6}' AND UnID={7}", glj_item["BH"], glj_item["MC"], glj_item["DW"], glj_item["SCDJ", DataRowVersion.Original], glj_item["YTLB"], glj_item["LB"], glj_item["IFSDSCDJ"], item["ID"])).FirstOrDefault(); if (dr != null) { if (m_load) { _ObjectSource.GetObject(m_UnitProject, item); this.ProjectSummaryLoad(m_UnitProject); m_Methods_Subheadings = new _Methods_Subheadings(m_UnitProject); m_load = false; } APP.UserPriceLibrary.AllQuantityUnit = m_UnitProject.StructSource.ModelQuantity; APP.UserPriceLibrary.UnName = m_UnitProject.Name; APP.UserPriceLibrary.Range = 0; dr.BeginEdit(); dr[p_FieldName] = glj_item[p_FieldName]; APP.UserPriceLibrary.Update(p_FieldName, dr[p_FieldName, DataRowVersion.Current], dr); dr.EndEdit(); if (p_FieldName.Equals("SCDJ")) { _Methods_YTLBSummary m_Methods_YTLBSummary = new _Methods_YTLBSummary(m_UnitProject); m_Methods_YTLBSummary.RefreshSCDJ(glj_item); } } } } if (m_Methods_Subheadings != null) { m_Methods_Subheadings.BatchCalculate(); this.SaveUnitFormXml(m_UnitProject); } } } } }