예제 #1
0
 private void btnLuuTheLoai_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtTheLoai.Text.Equals(""))
         {
             MessageBox.Show("Bạn cần điền đầy đủ thông tin!", "Cảnh báo", MessageBoxButtons.OK);
         }
         else
         {
             DanhMucSach entity = new DanhMucSach();
             entity.TenDanhMuc = txtTheLoai.Text;
             client.createCategory(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);
     }
 }