Exemplo n.º 1
0
 private void bnThem_Click(object sender, EventArgs e)
 {
     ncc.themNCC(txtMaNCC.Text, txtTenNCC.Text, txtDiaChi.Text, txtGhiChu.Text);
     MessageBox.Show("Thêm thành công!");
     loaddgv();
     txtMaNCC.Text = "";
 }
        private void btnluuncc_Click(object sender, EventArgs e)
        {
            eNhaCungCap a = new eNhaCungCap();

            a.maNCC  = txtMaNCC.Text;
            a.tenNCC = txtTenNCC.Text;
            a.diaChi = txtAddress.Text;
            a.sDT    = txtphone.Text;
            a.email  = txtMail.Text;
            int m = nccbll.themNCC(a);

            if (m == 0)
            {
                MessageBox.Show("Trùng mã !", "Thông báo!", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
            else if (m == 1)
            {
                MessageBox.Show("Thêm thành công !", "Thông báo!", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
            }
        }