Beispiel #1
0
 private void btnThem_Click(object sender, EventArgs e)
 {
     if (KiemTra() == "")
     {
         NhaXuatBanDTO NXB = new NhaXuatBanDTO();
         NXB.MaNXB     = txtMaNXB.Text;
         NXB.TenNXB    = txtTenNXB.Text;
         NXB.DiaChi    = txtDiaChi.Text;
         NXB.DienThoai = txtDienThoai.Text;
         if (NhaXuatBanBUS.ThemNXB(NXB) == true)
         {
             txtMaNXB.Text = NhaXuatBanBUS.GetIDNXB();
             txtTenNXB.ResetText();
             txtDiaChi.ResetText();
             txtDienThoai.ResetText();
             LoadData();
         }
         else
         {
             MessageBox.Show("Thêm thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         MessageBox.Show(string.Format("{0}", KiemTra()), "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }