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); }
public static _Method_Sub GetSub(_Business bus, _UnitProject p_Unit) { _Entity_SubInfo Sub_info = new _Entity_SubInfo(); DataRow row = p_Unit.StructSource.ModelSubSegments.GetRowByOther("1"); _ObjectSource.GetObject(Sub_info, row); _Method_Sub mrt = new _Method_Sub(bus, p_Unit, Sub_info); return(mrt); }
private _Method_Sub GetSub() { DataRow[] rows = this.Unit.StructSource.ModelSubSegments.Select("PID=0"); if (rows.Length > 0) { _Entity_SubInfo info = new _Entity_SubInfo(); _ObjectSource.GetObject(info, rows[0]); _Method_Sub sub = new _Method_Sub(this.CurrentBusiness, this.Unit, info); return(sub); } return(null); }
public _Methods_Infomation(_UnitProject p_Unit, _Business p_bus) { m_Unit = p_Unit; this._UnInfo = APP.UnInformation; this.m_CurrentBusiness = p_bus; method_Sub = _Method_Sub.GetSub(this.m_CurrentBusiness, this.m_Unit); methods_Fixed = new _Methods_Fixed(this.m_CurrentBusiness, this.m_Unit, null); dt = this.Unit.Property.Libraries.FixedLibrary.LibraryDataSet.Tables["材机表"].Copy(); if (!dt.Columns.Contains("fl")) { dt.Columns.Add("fl", typeof(double)); } if (!dt.Columns.Contains("SCDJ")) { dt.Columns.Add("SCDJ", typeof(double)); } if (dt.PrimaryKey.Length == 0) { dt.PrimaryKey = new DataColumn[] { dt.Columns["CAIJBH"] }; } }
/// <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; }
public void Import(string filaname) { this.m_FileName = filaname; if (this.m_IsClear) { //this.ClerSub(); } this.GetTable(); bool flag = false; _Method_Sub sub = this.GetSub(); _Entity_SubInfo info = new _Entity_SubInfo(); int count = 1; foreach (DataRow item in this.table.Rows) { if (ToolKit.ParseInt(item[0]) > 0) { flag = true; } if (flag) { if (item[0] == DBNull.Value && item[1] == DBNull.Value && item[2] == DBNull.Value && item[3] == DBNull.Value) { return; } int XH = ToolKit.ParseInt(item[0]); string XMBM = item[1].ToString(); string XMMC = item[2].ToString(); string DW = item[3].ToString(); decimal GCL = ToolKit.ParseDecimal(item[4]); if (XH > 0)//清单 { if (XMBM.Length > 9) { string xmbm = XMBM.Substring(0, 9); DataRow[] rows = this.Unit.Property.Libraries.ListGallery.LibraryDataSet.Tables["清单表"].Select(string.Format("QINGDBH='{0}'", xmbm)); if (rows.Length > 0) { info = new _Entity_SubInfo(); _Methods.SetFixedInfo(info, rows[0], this.Unit.Property.Libraries.ListGallery.FullName, this.Unit.StructSource.ModelSubSegments, "ZYLB"); info.XH = XH; info.XMBM = XMBM; info.XMMC = XMMC; info.DW = DW; info.GCL = GCL; int m = GLODSOFT.QDJJ.BUSINESS._Methods.GetCountByBH(xmbm, this.Unit.StructSource.ModelSubSegments); info.BEIZHU = GLODSOFT.QDJJ.BUSINESS._Methods.GetQDbeizhu(xmbm, m, "EXCL"); sub.Create(-1, info); } else//补充清单 { info = new _Entity_SubInfo(); info.XH = XH; info.XMBM = XMBM; info.OLDXMBM = xmbm; info.XMMC = XMMC; info.DW = DW; info.LB = "清单"; info.ZJWZ = "999999"; info.GCL = GCL; int m = GLODSOFT.QDJJ.BUSINESS._Methods.GetCountByBH(xmbm, this.Unit.StructSource.ModelSubSegments); info.BEIZHU = GLODSOFT.QDJJ.BUSINESS._Methods.GetQDbeizhu(xmbm, m, "EXCL"); sub.Create(-1, info); } } else//补充清单 { info = new _Entity_SubInfo(); info.XH = XH; info.XMBM = XMBM; info.OLDXMBM = XMBM; info.XMMC = XMMC; info.DW = DW; info.LB = "清单"; info.ZJWZ = "999999"; info.GCL = GCL; int m = GLODSOFT.QDJJ.BUSINESS._Methods.GetCountByBH(XMBM, this.Unit.StructSource.ModelSubSegments); info.BEIZHU = GLODSOFT.QDJJ.BUSINESS._Methods.GetQDbeizhu(XMBM, m, "EXCL"); sub.Create(-1, info); } } else//子目的处理 { string xmbm = XMBM.Replace("换", ""); xmbm = xmbm.Split(' ')[0]; DataRow[] rows = this.Unit.Property.Libraries.FixedLibrary.LibraryDataSet.Tables["定额表"].Select(string.Format("DINGEH='{0}'", xmbm)); _Methods_Fixed fix = new _Methods_Fixed(this.CurrentBusiness, this.Unit, info); if (rows.Length > 0) { _Entity_SubInfo sinfo = new _Entity_SubInfo(); _Methods.SetSubheadingsInfo(sinfo, rows[0], this.Unit.Property.Libraries.FixedLibrary.FullName); // _ObjectSource.GetObject(sinfo, rows[0]); sinfo.XH = XH; sinfo.XMBM = XMBM; sinfo.XMMC = XMMC; sinfo.DW = DW; sinfo.LB = "子目"; sinfo.GCL = GCL; sinfo.OLDXMBM = xmbm; sinfo.BEIZHU = GLODSOFT.QDJJ.BUSINESS._Methods.GetDEbeizhu("EXCL", count, info.OLDXMBM); fix.Create(false, -1, sinfo); count++; } else { _Entity_SubInfo sinfo = new _Entity_SubInfo(); sinfo.XH = XH; sinfo.XMBM = XMBM; sinfo.OLDXMBM = xmbm; sinfo.XMMC = XMMC; sinfo.DW = DW; sinfo.GCL = GCL; sinfo.LB = "子目"; sinfo.BEIZHU = GLODSOFT.QDJJ.BUSINESS._Methods.GetDEbeizhu("EXCL", count, info.OLDXMBM); fix.Create(false, -1, sinfo); count++; } } } } }