示例#1
0
 private void btnLuuTacGia_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtHoTen.Text.Equals(""))
         {
             MessageBox.Show("Bạn cần điền tên tác giả!", "Cảnh báo", MessageBoxButtons.OK);
         }
         else
         {
             TacGia entity = new TacGia();
             entity.HoTen = txtHoTen.Text;
             client.createAuthor(entity);
             MessageBox.Show("Thêm mới thành công!", "Chúc mừng", MessageBoxButtons.OK);
             resetform();
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Thêm mới thất bại", "Lỗi", MessageBoxButtons.OK);
     }
 }