private void barEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (gridView1.RowCount < 1) { return; } if (gridView1.FocusedRowHandle < 0) { return; } SysDataFiles ds = gridView1.GetRow(gridView1.FocusedRowHandle) as SysDataFiles; FrmSysDataFileAdd frm = new FrmSysDataFileAdd(); frm.file = ds; frm.Text = "编辑数据文件"; if (frm.ShowDialog() == DialogResult.OK) { ds = frm.file; ServicesSys.BaseService.Update <SysDataFiles>(ds); InitData(); } }
private void barAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { SysDataFiles sdf = new SysDataFiles(); sdf.FileDesc = "用于创建城市数据库的文件"; FrmSysDataFileAdd frm = new FrmSysDataFileAdd(); frm.file = sdf; frm.Text = "添加数据文件"; if (frm.ShowDialog() == DialogResult.OK) { try { ServicesSys.BaseService.Create <SysDataFiles>(frm.file); } catch (Exception) { throw; } InitData(); } }