private void OnEmployeeSelectd(object sender, EmployeeInfo emp) { WageLoanEntry item = new WageLoanEntry(); item.标识 = Guid.NewGuid(); item.员工编号 = emp.员工编号; item.是验证录入 = false; item.Save(); currEntryRows.Add(item); gridControl1.RefreshDataSource(); bandedGridView1.FocusedRowHandle = bandedGridView1.RowCount - 1; MyHelper.WriteLog(LogType.信息, "新增员工工资借款录入记录", item.ToString <WageLoanEntry>()); }
private void btn删除_Click(object sender, EventArgs e) { ColumnView colView = (ColumnView)gridControl1.MainView; if (colView != null) { if (MessageBox.Show("确实删除当前记录吗?", "删除提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2, 0, false) == DialogResult.Yes) { WageLoanEntry currentItem = (WageLoanEntry)colView.GetFocusedRow(); currEntryRows.Remove(currentItem); MyHelper.WriteLog(LogType.信息, "删除员工工资借款录入记录", currentItem.ToString <WageLoanEntry>()); gridControl1.RefreshDataSource(); WageLoanEntry.ClearWageLoanEntry(currentItem.员工编号); MessageBox.Show("删除成功。", "删除提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }