private void frmNhapVT_Load(object sender, EventArgs e)
        {
            createTable_CTNhap();
            createTable_PhieuNhap();
            createTable_TonKho();
            load();
            HienThi();

            string    sql1 = "select * from NHACUNGCAP";
            DataTable dt1  = conn.getDataTable(sql1, "NHACUNGCAP");

            cboMaNCC.DataSource    = dt1;
            cboMaNCC.DisplayMember = "TENNCC";
            cboMaNCC.ValueMember   = "MANCC";
            cboMaNCC.Text          = "";

            string    sql2 = "select * from TAIKHOAN,NHANVIEN where TAIKHOAN.MANV = NHANVIEN.MANV AND ID='" + frmDangNhap.ID_USER + "'";
            DataTable dt2  = conn.getDataTable(sql2, "TAIKHOAN,NHANVIEN");

            cboNV.DataSource    = dt2;
            cboNV.DisplayMember = "TENNV";
            cboNV.ValueMember   = "MANV";

            loadVatTu();
        }
Example #2
0
        private void frmBanVT_Load(object sender, EventArgs e)
        {
            createTable_HOADON();
            createTable_CTHOADON();
            createTable_TonKho();
            load_Begin();
            createTable_KhachHang();
            HienThi();

            string    strSQL = "SELECT * FROM KHACHHANG";
            DataTable dt     = conn.getDataTable(strSQL, "KHACHHANG");

            cboTenKH.DataSource    = dt;
            cboTenKH.DisplayMember = "TENKH";
            cboTenKH.ValueMember   = "MAKH";

            cboTenKH.Text = "";
            txtMaKH.Clear();
            txtSDTKH.Clear();
            txtDiaChiKH.Clear();
            txtMaKH.Focus();


            string    sql3 = "select * from VATTU";
            DataTable dt3  = conn.getDataTable(sql3, "VATTU");

            cboMaVT.DataSource    = dt3;
            cboMaVT.DisplayMember = "TENVT";
            cboMaVT.ValueMember   = "MAVT";
            cboMaVT.Text          = "";

            pckNgayXuat.Text = DateTime.Now.Date.ToString();

            string    s   = "SELECT * from NHANVIEN,TAIKHOAN WHERE NHANVIEN.MANV = TAIKHOAN.MANV AND ID ='" + frmDangNhap.ID_USER + "'";
            DataTable dt2 = conn.getDataTable(s, "NHANVIEN,TAIKHOAN");

            cboNhanVien.DataSource    = dt2;
            cboNhanVien.ValueMember   = "MANV";
            cboNhanVien.DisplayMember = "TENNV";
        }
        private void frmVatTu_Load(object sender, EventArgs e)
        {
            createTable_VatTu();
            dgVVatTu.DataSource = conn.Dset.Tables["VATTU"];

            string    s  = "select * from LOAIVT";
            DataTable dt = conn.getDataTable(s, "LOAIVT");

            cboMaLoai.DataSource    = dt;
            cboMaLoai.DisplayMember = "TENLOAI";
            cboMaLoai.ValueMember   = "MALOAI";

            cboMaLoai.Text = "";
            load_begin();
        }