Пример #1
0
 private void btnSuaNCC_Click(object sender, EventArgs e)
 {
     if (txtTenNCC.Text == "")
     {
         MessageBox.Show("Bạn phải điền tên nhà cung cấp", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
         txtTenNCC.Focus();
     }
     else
     {
         DocDuLieu.ThucHienLenh("update tNhaCungCap set TenNCC=N'" + txtTenNCC.Text + "' where MaNCC='" + txtMaNCC.Text + "'");
         XoaNCC();
         CapNhapNhaCungCap();
     }
 }
Пример #2
0
 private void btnSuaNXB_Click(object sender, EventArgs e)
 {
     if (txtTenNXB.Text == "")
     {
         MessageBox.Show("Bạn phải điền tên nhà xuất bản", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
         txtTenNXB.Focus();
     }
     else
     {
         DocDuLieu.ThucHienLenh("update tNhaXuatBan set TenNXB=N'" + txtTenNXB.Text + "' where MaNCC='" + txtMaNXB.Text + "'");
         XoaNXB();
         CapNhapNhaSanXuat();
     }
 }
Пример #3
0
 //Xử lý sự kiện nút sửa
 private void btnSuaTheLoai_Click(object sender, EventArgs e)
 {
     if (txtTenTheLoai.Text == "")
     {
         MessageBox.Show("Bạn phải điền tên sản phẩm", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
         txtTenTheLoai.Focus();
     }
     else
     {
         DocDuLieu.ThucHienLenh("update tTheLoai set TenTheLoai=N'" + txtTenTheLoai.Text + "' where MaTheLoai='" + txtMaTheLoai.Text + "'");
         XoaTheLoai();
         CapNhapTheLoai();
     }
 }
Пример #4
0
 private void btnSuaNhanVien_Click(object sender, EventArgs e)
 {
     if (txtTenNhanVien.Text.Trim() == "")
     {
         MessageBox.Show("Bạn phải điền tên khách hàng", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
         txtTenNhanVien.Focus();
         return;
     }
     if (txtDiaChiNhanVien.Text.Trim() == "")
     {
         MessageBox.Show("Bạn phải điền địa chỉ", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
         txtDiaChiNhanVien.Focus();
         return;
     }
     if (txtSoDienThoaiNhanVien.Text.Trim() == "")
     {
         MessageBox.Show("Bạn phải điền số điện thoại", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
         txtSoDienThoaiNhanVien.Focus();
         return;
     }
     DocDuLieu.ThucHienLenh("update tNhanVien set TenNV=N'" + txtTenNhanVien.Text + "',DiaChi=N'" + txtDiaChiNhanVien.Text + "',DienThoai=N'" + txtSoDienThoaiNhanVien.Text.Trim() + "' where MaNV='" + txtMaNhanVien.Text + "'");
     XoaNhanVien();
     CapNhapNhanVien();
 }