} } catch {
MessageBox.Show(\Êý¾Ý¿â´íÎó£¡\); } finally {
com.Dispose(); con.Dispose(); con.Close(); } } else {
MessageBox.Show(\δÊäÈëÓû§Ãû£¡\); } }
private void update_Click(object sender, EventArgs e) {
string myname = this.name.Text; string mypassword = this.password.Text; string mytype = this.comboBox1.Text; string myarea = this.comboBox2.Text; if (myname != \ && mypassword != \) {
string sql = %username='\ + myname + \;
SqlConnection con = new SqlConnection(source); con.Open();
SqlCommand com = new SqlCommand(sql, con); SqlDataReader sread = com.ExecuteReader(); try {
if (sread.Read())
{
sread.Close();
string ss = \ + myname + \ + mypassword + \ + mytype + \ + myarea + \ + myname + \;
SqlCommand co = new SqlCommand(ss, con); if (co.ExecuteNonQuery() != 0) {
MessageBox.Show(\¸üгɹ¦£¡\); co.Dispose(); } else {
MessageBox.Show(\¸üÐÂʧ°Ü£¡\); co.Dispose(); } } else {
sread.Close();
MessageBox.Show(\Óû§²»´æÔÚ£¡\); name.Text = \; password.Text = \; } } catch {
MessageBox.Show(\Êý¾Ý¿â´íÎó£¡\); } finally {
com.Dispose(); con.Dispose(); con.Close(); }
} else
MessageBox.Show(\δÊäÈëÓû§Ãû»òÃÜÂ룡\); }
private void search_Click(object sender, EventArgs e) {
if (flag) {
this.panel1.Visible = true;
string sql = \Óû§Ãû,password as ÃÜÂë,type as Óû§ÀàÐÍ,area_code as µØÇø´úÂë from users\;
SqlConnection con = new SqlConnection(source); try {
con.Open();
SqlCommand com = new SqlCommand(sql, con); SqlDataAdapter sda = new SqlDataAdapter(); sda.SelectCommand = com; DataSet ds = new DataSet(); sda.Fill(ds, \);
this.dataGridView1.DataSource = ds.Tables[0].DefaultView;
dataGridView1.DataSource = ds.Tables[\]; sda.Dispose(); com.Dispose(); }
catch(Exception ex) {
new Exception(ex.ToString()); } finally {
con.Dispose(); con.Close(); flag = false;
} } else {
this.panel1.Visible = false; flag = true; } } ±íµ¥Â¼È룺
public void save_Click(object sender, EventArgs e) {
if (id == 1) {
this.Dis_name = dis_name.Text; this.Write_name = write_name.Text; this.Date1 = date1.Text; this.S_in_name = s_in_name.Text; this.S_in_loc = s_in_loc.Text; this.S_in_owner = s_in_owner.Text; this.Date2 = date2.Text; this.Set = set.Text; this.Get = get.Text;
this.KPS_name = kps_name.Text; this.Check_name = check_name.Text; this.Date3 = date3.Text;
if (Dis_name != \ && Write_name != \ && Date1 != \ && S_in_name != \ && S_in_loc != \ && S_in_owner != \ && Date2 != \ && Set != \ && Get != \ && KPS_name != \ && Check_name != \ && Check_name != \ && Date3 != \) {
if (sys_name1.Text == \)
MessageBox.Show(\δÊäÈëÃ÷ϸÐÅÏ¢£¡\); else {
if (det1.Text == \ || num1.Value == 0)

