예제 #1
0
 private void btn_Add_Click(object sender, EventArgs e)
 {
     Agent a = new Agent();
     a.Name = txt_Name.Text;
     a.Phone = txt_Phone.Text;
     a.LevelName = cbx_Level.Text;
     a.Address = txt_Address.Text;
     a.Contact = txt_Contact.Text;
     a.Fox = txt_Fox.Text;
     a.Tel = txt_Tel.Text;
     bool re = a.Update();
     if (re)
     {
         MessageBox.Show("修改成功!");
         _isOK = true;
         this.Close();
     }
     else
     {
         MessageBox.Show("修改失败!");
     }
 }
        private void btn_Mod_Click(object sender, EventArgs e)
        {
            Agent a = new Agent();

            a.Name      = txt_Name.Text;
            a.Phone     = txt_Phone.Text;
            a.LevelName = cbx_Level.Text;
            a.Address   = txt_Address.Text;
            a.Contact   = txt_Contact.Text;
            a.Fox       = txt_Fox.Text;
            a.Tel       = txt_Tel.Text;
            bool re = a.Update();

            if (re)
            {
                MessageBox.Show("修改成功!");
                _isOK = true;
                this.Close();
            }
            else
            {
                MessageBox.Show("修改失败!");
            }
        }