public static void ModifyEdit_Sub(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; } _Entity_SubInfo info = new _Entity_SubInfo(); _ObjectSource.GetObject(info, att.Source as DataRow); GLODSOFT.QDJJ.BUSINESS._Methods met = GLODSOFT.QDJJ.BUSINESS._Methods.CreateIntace(bus, unit, info); _Modify_Method.Edit_Sub(att.FieldName, met, r); } }
protected ListMessageElement GetModificationDescription(ModifyAttribute attribute) { return(new ListMessageElement().AddElements( new StringMessageElement(attribute.Type) ).AddElements( GetAttributeValues(attribute) )); }
protected ListMessageElement GetModificationItem(ModifyAttribute attribute) { return(new ListMessageElement().AddElements( new EnumMessageElement((int)attribute.Modification) ).AddElements( GetModificationDescription(attribute) )); }
/// <summary> /// 修改的实现 /// </summary> /// <param name="p_attr"></param> public void Revocation(ModifyAttribute p_attr) { //还原属性 /*Command.ModifyObject(p_attr); * //定位目标 * CurrentTabForm.RevocationRefresh(); * this.Locate(p_attr); * //改变后刷新 * this.RefreshDataSource();*/ _Modify_Method.ModifyEdit_Metaanalysis(p_attr, this.CurrentBusiness, this.Activitie); LogContent.Remove(p_attr); GetContainer.ALogForm.Init(); }
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; } } }
public override void Revocation() { Attribute attr = this.LogContent.GetLastAttribute; if (attr != null) { //获取Attr开始撤销动作 ModifyAttribute ma = attr as ModifyAttribute; ActionAttribute aa = attr as ActionAttribute; if (ma != null) { this.Revocation(ma); } if (aa != null) { this.Revocation(aa); } } }
void treeList1_CellValueChanged(object sender, DevExpress.XtraTreeList.CellValueChangedEventArgs e) { if (BeforeOnCellValueChanged != null) { BeforeOnCellValueChanged(this, null); } switch (e.Column.FieldName) { case "Calculation": //费率 case "Coefficient": //计算基础 case "Feature": //判断特项是否为空 if (e.Node["Feature"].ToString() != string.Empty) { Method.Calculate(); /*if (this.m_CUnitProject.Property.Metaanalysis.IsEdit) * { * this.m_CUnitProject.Property.Metaanalysis.Calculate(); * }*/ } break; } ModifyAttribute modity = new ModifyAttribute(); modity.CurrentValue = e.Value; modity.OriginalValue = ChangeObject; modity.ObjectName = e.Column.Caption; modity.ModelName = "汇总分析"; modity.Source = this.metaanalysisList1.treeList1.Current.Row; modity.FieldName = e.Column.FieldName; //modity.ActingOn = "清单.子目"; ChangeObject = null; this.LogContent.Add(modity); //LogContent.Add(e); GetContainer.ALogForm.Init(); if (AfterOnCellValueChanged != null) { AfterOnCellValueChanged(this, null); } }
public static void ModifyEdit_Metaanalysis(ModifyAttribute att, _Business bus, _UnitProject unit) { DataRow r = att.Source as DataRow; if (r != null) { r[att.FieldName] = att.OriginalValue; if (att.FieldName == "Feature") { DataTable ParamTable = APP.Application.Global.DataTamp.TempDataSet.Tables["Params_Metaanalysis"].Copy(); DataRow[] rows = ParamTable.Select(string.Format("Code='{0}'", att.OriginalValue)); if (rows.Length > 0) { r["Name"] = rows[0]["Name"]; } } _Method_Metaanalysis Method = new _Method_Metaanalysis(unit); Method.Begin(null); } }
private void openParams_Metaanalysis() { CParams_Metaanalysis form = new CParams_Metaanalysis(); //循环去当前的数据特像 int i = 0; string str = string.Empty; foreach (DataRowView row in this.UnitProject.StructSource.ModelMetaanalysis.DefaultView) { if (i != this.UnitProject.StructSource.ModelMetaanalysis.Rows.Count - 1) { str += string.Format("'{0}',", row["Feature"].ToString()); } else { str += string.Format("'{0}'", row["Feature"].ToString()); } } form.DataSource = this.ParamTable; form.Filter = str; DialogResult r = form.ShowDialog(this); if (r == DialogResult.OK) { //确定了后处理当前编辑 ChangeObject = this.metaanalysisList1.treeList1.Current["Feature"]; this.metaanalysisList1.Edit(form.Current); ModifyAttribute modity = new ModifyAttribute(); modity.CurrentValue = this.metaanalysisList1.treeList1.Current["Feature"]; modity.OriginalValue = ChangeObject; modity.ObjectName = "费用代号"; modity.ModelName = "汇总分析"; modity.Source = this.metaanalysisList1.treeList1.Current.Row; modity.FieldName = "Feature"; //modity.ActingOn = "清单.子目"; ChangeObject = null; this.LogContent.Add(modity); //LogContent.Add(e); GetContainer.ALogForm.Init(); } }
/// <summary> /// 修改范围 /// </summary> private void barEditValue() { ModifyAttribute modity = new ModifyAttribute(); switch (barEditItem1.EditValue.ToString()) { case "当前单位工程": modity.CurrentValue = "当前单位工程"; modity.OriginalValue = "当前子目"; break; case "当前子目": modity.CurrentValue = "当前子目"; modity.OriginalValue = "当前单位工程"; break; default: break; } modity.ModelName = this.ParentForm.Text; Submit(modity); }
private void treeList1_CellValueChanged(object sender, CellValueChangedEventArgs e) { if (e.Column.FieldName != "Name") { this.Method.Begin(); } ModifyAttribute modity = new ModifyAttribute(); modity.CurrentValue = e.Value; modity.OriginalValue = ChangeObject; modity.ObjectName = e.Column.Caption; modity.ModelName = "其他项目"; modity.Source = this.treeList1.Current.Row; modity.FieldName = e.Column.FieldName; //modity.ActingOn = "清单.子目"; ChangeObject = null; this.LogContent.Add(modity); //LogContent.Add(e); GetContainer.ALogForm.Init(); ProjectStaistics.SetQTXM(); }
private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { CParams_Metaanalysis f = new CParams_Metaanalysis(); f.Text = "其他项目参数配置"; DataTable ParamTable = APP.Application.Global.DataTamp.TempDataSet.Tables["Params_Other"].Copy(); f.DataSource = ParamTable; f.Filter = this.Filter; DialogResult d = f.ShowDialog(); if (d == DialogResult.OK) { DataRowView view = f.Current; DataRowView rv = this.treeList1.Current; if (rv != null) { ChangeObject = rv["Feature"]; rv.BeginEdit(); rv["Feature"] = view["Code"]; rv["Name"] = view["Name"]; rv.EndEdit(); ModifyAttribute modity = new ModifyAttribute(); modity.CurrentValue = rv["Feature"]; modity.OriginalValue = ChangeObject; modity.ObjectName = "费用代号"; modity.ModelName = "其他项目"; modity.Source = this.treeList1.Current.Row; modity.FieldName = "Feature"; //modity.ActingOn = "清单.子目"; ChangeObject = null; this.LogContent.Add(modity); //LogContent.Add(e); GetContainer.ALogForm.Init(); } } }
/// <summary> /// 修改数据 /// </summary> /// <param name="e"></param> public void CellValueChanged(CellValueChangedEventArgs e) { this.GetCurrent(); //if (this.m_Methods_Quantity.Current != null) //{ DataRow[] allRows = this.m_Methods_Quantity.Current.Table.Select("MC='" + this.m_Methods_Quantity.Current["MC"] + "' and DW='" + this.m_Methods_Quantity.Current["DW"] + "'"); if (barEditItem1.EditValue.ToString().Equals("当前单位工程")) { for (int i = 0; i < allRows.Length; i++) { var row = allRows[i]; row["SCDJ"] = decimal.Parse(this.m_Methods_Quantity.Current["SCDJ"].ToString()); } } //DataRow[] rows = this.m_Methods_Quantity.Current.Table.Select("MC='" + this.m_Methods_Quantity.Current["MC"] + "' and DW='" + this.m_Methods_Quantity.Current["DW"] + "' and SCDJ=" + this.m_Methods_Quantity.Current["SCDJ"]); // if (rows.Length > 0) // { // string bh = this.m_Methods_Quantity.Current["YSBH"].ToString(); // DataRow[] cRows = this.m_Methods_Quantity.Current.Table.Select("YSBH='" + bh + "'"); // foreach (DataRow row in cRows) // { // if (row["YSBH"].Equals(bh)) // { // GridView gv = this.gridControl1.FocusedView as GridView; // DataRow dr = gv.GetDataRow(gv.FocusedRowHandle); // switch (e.Column.FieldName) // { // case "MC": // dr[e.Column.FieldName] = dr["YSMC"]; // row[e.Column.FieldName] = dr["YSMC"]; // break; // case "DW": // dr[e.Column.FieldName] = dr["YSDW"]; // row[e.Column.FieldName] = dr["YSDW"]; // break; // case "SCDJ": // dr[e.Column.FieldName] = dr["DEDJ"]; // row[e.Column.FieldName] = dr["DEDJ"]; // break; // } // } // } // if (e.Column.FieldName.Equals("BH") || e.Column.FieldName.Equals("MC") || e.Column.FieldName.Equals("DW") || e.Column.FieldName.Equals("SCDJ")) // { // MessageBox.Show("相同数据已经在用户价格库中存在。", "金建软件", MessageBoxButtons.OK, MessageBoxIcon.Information); // return; // } // } //} this.GetPartQuantityUnit(); if (barEditItem1.EditValue.ToString().Equals("当前单位工程")) { var rows = new List <DataRow>(); foreach (var row in allRows) { rows.AddRange(this.Activitie.StructSource.ModelSubSegments.Select("ID='" + row["ZMID"] + "'")); } GLODSOFT.QDJJ.BUSINESS._Methods.Calculate(this.CurrentBusiness, this.Activitie, rows.ToArray()); } using (var calculator = new Calculator(CurrentBusiness, Activitie)) { switch (e.Column.FieldName) { case "MC": case "DW": case "SCDJ": if (this.m_Methods_Quantity.Current != null) { APP.UserPriceLibrary.Update(e.Column.FieldName, this.m_Methods_Quantity.Current[e.Column.FieldName, DataRowVersion.Current], this.m_Methods_Quantity.Current); if (e.Column.FieldName == "SCDJ") { m_Methods_YTLBSummary.RefreshSCDJ(this.m_Methods_Quantity.Current); } //this.BatchCalculate(); calculator.Entities.Add(m_Methods_Subheadings.Current); } break; case "XHL": APP.UserPriceLibrary.Update(e.Column.FieldName, this.m_Methods_Quantity.Current[e.Column.FieldName, DataRowVersion.Current], this.m_Methods_Quantity.Current); m_Methods_YTLBSummary.RefreshSCDJ(this.m_Methods_Quantity.Current); if (this.m_Methods_Quantity.Current != null) { this.gridView1.UpdateCurrentRow(); if (this.m_Methods_Quantity.Current["ZCLB"].Equals("W")) { _Methods_Quantity.UpdateZCGCL(this.m_Methods_Quantity.Current); //this.m_Methods_Subheadings.Begin(); } else { APP.UserPriceLibrary.Range = 1; _Methods_Quantity.CalculateParentSCDJ(this.m_Methods_Quantity.Parent); //this.m_Methods_Subheadings.BatchCalculate(); } //this.BatchCalculate(); calculator.Entities.Add(m_Methods_Subheadings.Current); } break; default: break; } } this.RefreshDataSource(); ModifyAttribute modity = new ModifyAttribute(); modity.CurrentValue = e.Value; modity.OriginalValue = ChangeObject; modity.ModelName = this.ParentForm.Text; Submit(modity); }
/// <summary> /// 提交操作 /// </summary> /// <param name="modity"></param> private void Submit(ModifyAttribute modity) { //this.GetContainer.GetWorkAreas.LogContent.Add(modity); //this.GetContainer.ALogForm.Init(); }
protected ListMessageElement GetAttributeValues(ModifyAttribute attribute) { return(new ListMessageElement(0x31).AddElements(attribute.Values.Select(v => new StringMessageElement(v)).ToArray())); }