private void frmChitietTheloai_Load(object sender, EventArgs e) 

        {
            
 DataTable dtx = B_TheLoai.GetAllTL();

            dgvTheLoai.DataSource = dtx;
            dt = dtx;
            DataTable nh = B_NhomHang.GetAllNhomHang();

            FillCbo(nh, cbxMaNhom, "MaNhom", "TenNhom"); 

        }
Beispiel #2
0
        private void frmChitietNhanvien_Load(object sender, EventArgs e)
        {
            DataTable dtx = B_NhanVien.GetAllNhanVien();

            dt = dtx;
            dgvNhanVien.DataSource = dtx;
            DataTable nhom = B_NhomHang.GetAllNhomHang();

            FillCbo(nhom, cbxNhom, "MaNhom", "TenNhom");
            DataTable ca = B_CaLam.GetAllCaLam();

            FillCbo(ca, cbxCa, "MaCa", "TenCa");
            DataTable cv = B_CongViec.GetAllCV();

            FillCbo(cv, cbxCV, "MaCV", "TenCV");
        }
        private void FormTimkiem_Load(object sender, EventArgs e)
        {
            DataTable dt = B_HangHoa.getDataForSearch();

            dgvResult.DataSource          = dt;
            cbxFindChatLieu.SelectedIndex = -1;
            cbxFindNhom.SelectedIndex     = -1;
            cbxFindCongDung.SelectedIndex = -1;
            DataTable clieu = B_ChatLieu.GetAllCL();

            FillCbo(clieu, cbxFindChatLieu, "MaChatLieu", "TenChatLieu");
            DataTable cdung = B_CongDung.GetAllCD();

            FillCbo(cdung, cbxFindCongDung, "MaCongDung", "TenCongDung");
            DataTable nhom = B_NhomHang.GetAllNhomHang();

            FillCbo(nhom, cbxFindNhom, "MaNhom", "TenNhom");
        }
 private void btnXoa_Click(object sender, EventArgs e)
 {
     if (checkDuplicated() == 2)
     {
         MessageBox.Show("Không Có Mã Đó Để Thay Đổi Liên Quan", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtMaNhom.Text = "";
         return;
     }
     else
     {
         if (MessageBox.Show("Bạn Muốn Xóa Không ?", "Cảnh Báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
         {
             B_NhomHang.DeleteNhomHang(txtMaNhom.Text);
             MessageBox.Show("Xóa Thành Công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             dgvNhomHang.DataSource = B_NhomHang.GetAllNhomHang();
             dt = B_NhomHang.GetAllNhomHang();
             clearTxt();
         }
     }
 }
 private void btnSua_Click(object sender, EventArgs e)
 {
     if (checkDuplicated() == 2)
     {
         MessageBox.Show("Không Có Mã Đó Để Thay Đổi Liên Quan", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtMaNhom.Text = "";
         return;
     }
     else
     {
         NhomHangDTO ob = checkData();
         if (ob != null)
         {
             B_NhomHang.saveNH(ob, sys.UPDATE);
             MessageBox.Show("Sửa Thành Công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             dt = B_NhomHang.GetAllNhomHang();
             dgvNhomHang.DataSource = dt;
             clearTxt();
         }
     }
 }
        private void btnThem_Click(object sender, EventArgs e)
        {
            NhomHangDTO ob = checkData();

            if (ob != null)
            {
                if (checkDuplicated() == 1)
                {
                    MessageBox.Show("Mã Nhóm Hàng Hóa Trùng", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    txtMaNhom.Focus();
                    return;
                }
                else
                {
                    B_NhomHang.saveNH(ob, sys.INSERT);
                    MessageBox.Show("Thêm Thành Công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    dt = B_NhomHang.GetAllNhomHang();
                    dgvNhomHang.DataSource = dt;
                    clearTxt();
                }
            }
        }
 private void frmChitietNhomhanghoa_Load(object sender, EventArgs e)
 {
     dt = B_NhomHang.GetAllNhomHang();
     dgvNhomHang.DataSource = dt;
 }
Beispiel #8
0
 
 public partial class frmChitietHanghoa : Form
    { 
 private const int EM_SETCUEBANNER = 0x1501; 
        [DllImport("user32.dll", CharSet = CharSet.Auto)] 
 private static extern Int32 SendMessage(IntPtr hWnd, int msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam); 
                                                                                                                                                                                                                                                                                                                                                    // local var for goods
        DataTable dtCheckDupOrNone;
        byte[] currentImg;
        static SystemConstant sys = new SystemConstant();
        public frmChitietHanghoa()
        {
            InitializeComponent();
            frmChitietHanghoa_Load(null, null);
            if (frmLogin.session.role == 2)
            {
                btnThem.Enabled = btnSua.Enabled = btnXoa.Enabled = btnIn.Enabled = false;
            }
            Handling.FormHandling.clearBorderGroupBox(gbxChitiet);
            Handling.FormHandling.clearBorderGroupBox(gbxChucnang);
        }
        private void loadTextBox()
        {
            SendMessage(txtMaVach.Handle, EM_SETCUEBANNER, 0, "Nhập Mã");
            SendMessage(txtTenHangHoa.Handle, EM_SETCUEBANNER, 0, "Tên");
            SendMessage(txtDonGiaNhap.Handle, EM_SETCUEBANNER, 0, "Nhập Số");
            SendMessage(txtSoLuong.Handle, EM_SETCUEBANNER, 0, "Nhập Số");
        }
        private void frmChitietHanghoa_Load(object sender, EventArgs e)
        {
            DataTable nh = B_NhomHang.GetAllNhomHang();
            FillCbo(nh, cbxNhomHang, "MaNhom", "TenNhom");
            DataTable tl = B_TheLoai.GetAllTL();
            FillCbo(tl, cbxTheLoai, "MaLoai", "TenLoai");
            DataTable dv = B_DonViTinh.GetAllDVT();
            FillCbo(dv, cbxDonVi, "MaDonVi", "TenDonVi");
            DataTable chatLieu = B_ChatLieu.GetAllCL();
            FillCbo(chatLieu, cbxChatLieu, "MaChatLieu", "TenChatLieu");
            DataTable congDung = B_CongDung.GetAllCD();
            FillCbo(congDung, cbxCongDung, "MaCongDung", "TenCongDung");
            DataTable noiSX = B_NoiSX.GetAllNSX();
            FillCbo(noiSX, cbxNoiSX, "MaNoiSX", "TenNoiSX");
            dtCheckDupOrNone = B_HangHoa.GetAllHangHoa();
            dgvHangHoa.DataSource = dtCheckDupOrNone;
            loadTextBox();
        }
        private void btnCreateCode_Click(object sender, EventArgs e)