コード例 #1
0
        private void btn添加_Click(object sender, EventArgs e)
        {
            AuthorizeComputer item = new AuthorizeComputer();

            item.创建人  = AccessController.CurrentUser.姓名;
            item.创建时间 = DateTime.Now;
            currRows.Add(item);
            gridControl1.RefreshDataSource();
            gridView1.FocusedRowHandle = gridView1.RowCount - 1;

            MyHelper.WriteLog(LogType.信息, "新增允许启动工资查询模块的电脑的记录", item.ToString <AuthorizeComputer>());
        }
コード例 #2
0
        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)
                {
                    AuthorizeComputer currentItem = (AuthorizeComputer)colView.GetFocusedRow();
                    currRows.Remove(currentItem);
                    currentItem.Delete();

                    MyHelper.WriteLog(LogType.信息, "删除可接入工资查询模块的电脑的记录", currentItem.ToString <AuthorizeComputer>());

                    gridControl1.RefreshDataSource();
                    MessageBox.Show("删除成功。", "删除提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }