/// <summary> /// 删除分类名 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void barButtonItem11_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { TreeListNode row = null; if (intFocuses == 1) { row = this.treeList1.FocusedNode; intFocuses = 0; } else if (intFocuses == 2) { row = this.treeList2.FocusedNode; intFocuses = 0; } if (row == null) { return; } if (row.Nodes.Count > 0) { MsgBox.Show("有下级分类,不可删除"); return; } string parentid = row["ParentID"].ToString(); if (MsgBox.ShowYesNo("是否删除分类 " + row["Title"].ToString() + "?") == DialogResult.Yes) { Ps_Forecast_Math psp_Type = new Ps_Forecast_Math(); ForecastClass1.TreeNodeToDataObject(psp_Type, row); //psp_Type = Itop.Common.DataConverter.RowToObject<Ps_Forecast_Math>(row); Ps_Forecast_Math psp_Values = new Ps_Forecast_Math(); psp_Values.ID = psp_Type.ID; try { //DeletePSP_ValuesByType里面删除数据和分类 Common.Services.BaseService.Delete <Ps_Forecast_Math>(psp_Values); FORBaseColor bc1 = new FORBaseColor(); bc1.Remark = forecastReport.ID + "-" + type; bc1.Title = row["Title"].ToString(); Common.Services.BaseService.Update("DeleteFORBaseColorByTitleRemark", bc1); //this.treeList1.Nodes.Remove(row); } catch (Exception ex) { this.Cursor = Cursors.WaitCursor; LoadData(); this.Cursor = Cursors.Default; } LoadData(); RefreshChart(); } }
/// <summary> /// 修改分类名 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void barButtonItem10_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { TreeListNode row = null; if (intFocuses == 1) { row = this.treeList1.FocusedNode; intFocuses = 0; } else if (intFocuses == 2) { row = this.treeList2.FocusedNode; intFocuses = 0; } if (row == null) { return; } string parentid = row["ParentID"].ToString(); FormTypeTitle frm = new FormTypeTitle(); frm.TypeTitle = row["Title"].ToString(); frm.Text = "修改分类名"; if (frm.ShowDialog() == DialogResult.OK) { Ps_Forecast_Math psp_Type = new Ps_Forecast_Math(); ForecastClass1.TreeNodeToDataObject(psp_Type, row); //psp_Type = Itop.Common.DataConverter.RowToObject<Ps_Forecast_Math>(row); psp_Type.Title = frm.TypeTitle; try { Common.Services.BaseService.Update <Ps_Forecast_Math>(psp_Type); row.SetValue("Title", frm.TypeTitle); } catch (Exception ex) { MsgBox.Show("修改出错:" + ex.Message); } LoadData(); RefreshChart(); } }
private void treeList1_CellValueChanged(object sender, DevExpress.XtraTreeList.CellValueChangedEventArgs e) { TreeListNode row = this.treeList1.FocusedNode; if (row == null) { return; } Ps_Forecast_Math pf = new Ps_Forecast_Math(); ForecastClass1.TreeNodeToDataObject <Ps_Forecast_Math>(pf, row); Services.BaseService.Update <Ps_Forecast_Math>(pf); //CalculateSum2(row); //aaa(row); RefreshChart(); }
public void UpdateSpatataldata(string TypeTitle) { TreeListNode row = this.treeList1.FocusedNode; if (row == null) { return; } glebeProperty gp = new glebeProperty(); gp.ParentEleID = "0"; gp.SvgUID = "c5ec3bc7-9706-4cbd-9b8b-632d3606f933"; gp.ObligateField16 = TypeTitle; IList <glebeProperty> svglist = Services.BaseService.GetList <glebeProperty>("SelectglebePropertyByObligateField16", gp); //重新对选中的数据进行更新 Ps_Forecast_Math psp_Type = new Ps_Forecast_Math(); ForecastClass1.TreeNodeToDataObject <Ps_Forecast_Math>(psp_Type, row); IList <glebeYearValue> yearlist = Services.BaseService.GetList <glebeYearValue>("SelectglebeYearValueBywhere", "ParentID='" + svglist[0].UID + "'"); for (int i = 0; i < yearlist.Count; i++) { string y = "y" + yearlist[i].Year.ToString(); psp_Type.GetType().GetProperty(y).SetValue(psp_Type, yearlist[i].Burthen, null); } try { Common.Services.BaseService.Update <Ps_Forecast_Math>(psp_Type); //psp_Type.ID = (int)Common.Services.BaseService.Create("InsertPSP_P_Types", psp_Type); //dataTable.Rows.Add(Itop.Common.DataConverter.ObjectToRow(psp_Type, dataTable.NewRow())); LoadData(); //treeList1.EndUpdate(); RefreshChart(); } catch (Exception ex) { } }
private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { TreeListNode row = this.treeList1.FocusedNode; if (row == null) { return; } string parentid = row["ParentID"].ToString(); // FormTypeTitle frm = new FormTypeTitle(); string TypeTitle = row["Title"].ToString(); frmMain_Spatial fmain = new frmMain_Spatial(); frmMain_Spatial.MapType = "接线图"; frmMain_Spatial.progtype = "城市规划层"; string pid = ""; fmain.Show(); string progtype = "城市规划层"; //if (progtype == "地理信息层") { // fmain.ViewMenu(); //} if (pid == "") { fmain.Open("c5ec3bc7-9706-4cbd-9b8b-632d3606f933", ""); } else { fmain.Open("c5ec3bc7-9706-4cbd-9b8b-632d3606f933", pid); } // LoadImage = true; fmain.InitShape(); fmain.Init(progtype); fmain.InitScaleRatio(); fmain.LayerManagerShow(); fmain.OpenGHQYpropetty(TypeTitle); if (fmain.DialogResult == DialogResult.OK) { glebeProperty gp = new glebeProperty(); gp.ParentEleID = "0"; gp.SvgUID = "c5ec3bc7-9706-4cbd-9b8b-632d3606f933"; gp.ObligateField16 = TypeTitle; IList <glebeProperty> svglist = Services.BaseService.GetList <glebeProperty>("SelectglebePropertyByObligateField16", gp); //重新对选中的数据进行更新 Ps_Forecast_Math psp_Type = new Ps_Forecast_Math(); ForecastClass1.TreeNodeToDataObject <Ps_Forecast_Math>(psp_Type, row); IList <glebeYearValue> yearlist = Services.BaseService.GetList <glebeYearValue>("SelectglebeYearValueBywhere", "ParentID='" + svglist[0].UID + "'"); for (int i = 0; i < yearlist.Count; i++) { string y = "y" + yearlist[i].Year.ToString(); psp_Type.GetType().GetProperty(y).SetValue(psp_Type, yearlist[i].Burthen, null); } try { Common.Services.BaseService.Update <Ps_Forecast_Math>(psp_Type); //psp_Type.ID = (int)Common.Services.BaseService.Create("InsertPSP_P_Types", psp_Type); //dataTable.Rows.Add(Itop.Common.DataConverter.ObjectToRow(psp_Type, dataTable.NewRow())); LoadData(); //treeList1.EndUpdate(); RefreshChart(); } catch (Exception ex) { } } else { //MsgBox.Show("在规划地块中,没有圈选此区域,请在规划地块模块中圈选此地块再点击编辑!"); fmain.Owner = this; } }