private void barButtonItem4_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (this.gridView2.FocusedRowHandle >= 0) { FrmAddPowerState frm = new FrmAddPowerState(); frm.Area = this; frm.Text = "添加记录"; frm.IsCreate = true; frm.ProjectID = ProjectID; string f = this.gridView2.GetRowCellValue(this.gridView2.FocusedRowHandle, "Title").ToString(); if (f == "现状") { f = "1"; } else if (f == "规划") { f = "2"; } frm.Flag = f; PSP_PowerSubstationInfo obj = new PSP_PowerSubstationInfo(); obj.UID = Guid.NewGuid().ToString(); frm.Object = obj; if (frm.ShowDialog() == DialogResult.OK) { frm.Close(); InitGrid1(); } } else { MessageBox.Show("请先选择规划或现状", "添加", MessageBoxButtons.OK); } }
private void barButtonItem5_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (this.gridView1.FocusedRowHandle >= 0) { FrmAddPowerState frm = new FrmAddPowerState(); frm.Text = "修改记录"; frm.ProjectID = ProjectID; string f = this.gridView2.GetRowCellValue(this.gridView2.FocusedRowHandle, "Title").ToString(); if (f == "现状") { f = "1"; } else if (f == "规划") { f = "2"; } frm.Flag = f; PSP_PowerSubstationInfo obj = this.gridView1.GetRow(this.gridView1.FocusedRowHandle) as PSP_PowerSubstationInfo; frm.Object = obj; if (frm.ShowDialog() == DialogResult.OK) { frm.Close(); InitGrid1(); } } else { MessageBox.Show("请先选择一条记录", "修改", MessageBoxButtons.OK); } }
private void barButtonItem4_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (this.gridView2.FocusedRowHandle >= 0) { FrmAddPowerState frm = new FrmAddPowerState(); frm.Area = this; frm.Text = "添加记录"; frm.IsCreate = true; frm.ProjectID = ProjectID; string f = this.gridView2.GetRowCellValue(this.gridView2.FocusedRowHandle, "Title").ToString(); if (f == "现状") f = "1"; else if (f == "规划") f = "2"; frm.Flag = f; PSP_PowerSubstationInfo obj = new PSP_PowerSubstationInfo(); obj.UID = Guid.NewGuid().ToString(); frm.Object = obj; if (frm.ShowDialog() == DialogResult.OK) { frm.Close(); InitGrid1(); } } else { MessageBox.Show("请先选择规划或现状", "添加", MessageBoxButtons.OK); } }
private void barButtonItem5_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (this.gridView1.FocusedRowHandle >= 0) { FrmAddPowerState frm = new FrmAddPowerState(); frm.Text = "修改记录"; frm.ProjectID = ProjectID; string f = this.gridView2.GetRowCellValue(this.gridView2.FocusedRowHandle, "Title").ToString(); if (f == "现状") f = "1"; else if (f == "规划") f = "2"; frm.Flag = f; PSP_PowerSubstationInfo obj = this.gridView1.GetRow(this.gridView1.FocusedRowHandle) as PSP_PowerSubstationInfo; frm.Object = obj; if (frm.ShowDialog() == DialogResult.OK) { frm.Close(); InitGrid1(); } } else { MessageBox.Show("请先选择一条记录", "修改", MessageBoxButtons.OK); } }