public static void ModifyEdit_Mea(ModifyAttribute att, _Business bus, _UnitProject unit) { DataRow r = att.Source as DataRow; if (r != null) { if (r["LB"].ToString().Contains("子目") && att.FieldName == "GCL") { decimal w = 0m; int m = ToolKit.ParseInt(APP.Application.Global.Configuration.Configs["工程量输入方式"]); if (m > 0) { w = _Methods.GetNumber(r["DW"].ToString()); } if (w == 0) { w = 1; } r["GCL"] = ToolKit.ParseDecimal((ToolKit.ParseDecimal(att.OriginalValue) * w).ToString("F4")); } else { r[att.FieldName] = att.OriginalValue; } GLODSOFT.QDJJ.BUSINESS._Methods met = GLODSOFT.QDJJ.BUSINESS._Methods.CreateIntaceMet(bus, unit, r); switch (att.FieldName) { case "JSJC": case "FL": met.Begin(null); break; case "GCL": met.UpGCL(); break; default: break; } } }
private void RemoveParent(DataRow row) { _SubSegmentsSource source = this.Unit.StructSource.ModelSubSegments; DataRow[] rows = source.Select(string.Format(" PID = {0}", row["PID"]), string.Empty, DataViewRowState.CurrentRows); if (rows.Length < 2) { DataRow row1 = source.GetRowByOther(row["PID"].ToString()); if (row1 != null) { if (row1["PID"].Equals(0)) { row.Delete(); _Entity_SubInfo info = new _Entity_SubInfo(); _ObjectSource.GetObject(info, row1); GLODSOFT.QDJJ.BUSINESS._Methods mets = GLODSOFT.QDJJ.BUSINESS._Methods.CreateIntace(this.CurrentBusiness, this.Unit, info); mets.Begin(null); } else { this.RemoveParent(row1); } } } else { DataRow r = source.GetRowByOther(row["ID"].ToString()); if (r != null) { if (!r["PID"].Equals(0)) { string id = r["PID"].ToString(); r.Delete(); DataRow r1 = source.GetRowByOther(id); _Entity_SubInfo info = new _Entity_SubInfo(); _ObjectSource.GetObject(info, r1); GLODSOFT.QDJJ.BUSINESS._Methods mets = GLODSOFT.QDJJ.BUSINESS._Methods.CreateIntace(this.CurrentBusiness, this.Unit, info); mets.Begin(null); } } } }