📄 freadermanage.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Library
{
public partial class fReaderManage : Form
{
//属性
#region 用来实现单例模式
private static fReaderManage instance = null;
public static fReaderManage Instance
{
get
{
if (instance == null)
{
instance = new fReaderManage();
}
return instance;
}
}
private fReaderManage()
{
InitializeComponent();
instance = this;
}
private void fReaderManage_FormClosed(object sender, FormClosedEventArgs e)
{
instance = null;
}
#endregion
//窗体首次加载时
private void toolStripButton4_Click(object sender, EventArgs e)
{
Close();
}
private void ShowDetail()
{
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
fReaderDetail frd = new fReaderDetail();
frd.ShowDialog();
if (frd.DialogResult == DialogResult.OK)
{
ShowDetail();
}
}
private void toolStripButton2_Click(object sender, EventArgs e)
{
//修改
fReaderDetail frd = new fReaderDetail();
frd.Tag = dataGridView1.CurrentRow;
frd.ShowDialog();
//刷新
if (frd.DialogResult == DialogResult.OK)
{
ShowDetail();
}
}
private void toolStripButton3_Click(object sender, EventArgs e)
{
if (MessageBox.Show("是否确认删除该条记录?", "系统提示:", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)
== DialogResult.Yes)
{
Library.ExecuteNoQuery("delete from Reader where ReaderID=" + dataGridView1.CurrentRow.Cells["ColumnReaderID"].Value.ToString());
ShowDetail();
}
}
private void toolStripButton5_Click(object sender, EventArgs e)
{
dataGridView1.DataSource = Library.ExecuteDataSet("select * from Reader").Tables[0];
}
private void fReaderManage_Load(object sender, EventArgs e)
{
dataGridView1.DataSource = Library.ExecuteDataSet("select * from Reader").Tables[0];
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -