/// <summary> /// 添加 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void btnAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { FormEditDepartment form = new FormEditDepartment(); form.curData = new Department(); form.FormState = DS.MSClient.FormState.New; if (form.ShowDialog(this) == DialogResult.OK) { btnSearch.PerformClick(); } }
/// <summary> /// 编辑 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void btnEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { var detail = gvDepartment.GetFocusedRow() as Department; if (detail == null) { return; } FormEditDepartment form = new FormEditDepartment(); form.curData = detail; form.FormState = DS.MSClient.FormState.Modify; if (form.ShowDialog(this) == DialogResult.OK) { btnSearch.PerformClick(); } }