Example #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            if (lbShow.Text == "Nhân viên")
            {
                tabControl.TabPages.Remove(tabNhanVien);
                mnHome.DropDownItems.Remove(submenuAddAccount);
                mnHome.DropDownItems.Remove(submnDelAccount);
            }
            frmChooseReport frm = new frmChooseReport();

            frm.TopLevel        = false;
            frm.Visible         = true;
            frm.FormBorderStyle = FormBorderStyle.None;
            frm.Dock            = DockStyle.Fill;
            tabControl.TabPages[5].Controls.Add(frm);

            //Load NV
            DataTable dtDSNV = new DataTable();

            dtDSNV = nvCtr.GetData();
            dtgvDSNV.DataSource = dtDSNV; //hiển thị dl trong dtgv
            DTBDNhanVien();               //lấy dự liệu từ dtgv hiển thị lên cac textbox
            DisEnlNV(false);

            //LoadHH
            DataTable dtDSHH = new DataTable();

            dtDSHH            = hhCtr.GetData();
            dtgvHH.DataSource = dtDSHH;
            DTBDHH();
            DisEnlHH(false);

            //Load KH\
            DataTable dtDSKH = new System.Data.DataTable();

            dtDSKH            = khCtr.GetData();
            dtgvKH.DataSource = dtDSKH;
            DTBDKH();
            DisEnlKH(false);

            //Load NCC
            DataTable dtDSNCC = new DataTable();

            dtDSNCC            = nccCtr.GetData();
            dtgvNCC.DataSource = dtDSNCC; //hiển thị dl trong dtgv
            DTBDNCC();                    //lấy dự liệu từ dtgv hiển thị lên cac textbox
            DisEnlNCC(false);

            //Load Hoa Don
            DisEnlHD(false);
            DataTable dt = new DataTable();

            dt = hdCtr.GetData();
            dtgvDSHD.DataSource = dt;
            DTBDHD();
            txtCreateDate.Enabled = false;
            //DataTable dt1 = new DataTable();
            //dt1 = ctCtr.GetData(txtMa.Text.Trim());
            //dtgvDSHH.DataSource = dt1;
        }
Example #2
0
        private bool kiemtraSL(string mahh, int sl)
        {
            DataTable dt = new DataTable();

            dt = hhctr.GetData("Where MaHang = '" + cmbHH.SelectedValue.ToString() + "' and SoLuong>= " + sl);
            if (dt.Rows.Count > 0)
            {
                return(true);
            }
            return(false);
        }
Example #3
0
        private void LoadcmbHH()
        {
            HangHoaCtr hhctr = new HangHoaCtr();

            cmbHH.DataSource    = hhctr.GetData();
            cmbHH.DisplayMember = "TenHang";
            cmbHH.ValueMember   = "MaHang";
        }
        private void frmHangHoa_Load(object sender, EventArgs e)
        {
            DataTable dtDS = new System.Data.DataTable();

            dtDS = hhCtr.GetData();
            dtgvDS.DataSource = dtDS;
            binhding();
            DisEnl(false);
        }