private void frmNguyenLieu_Load(object sender, EventArgs e)
        {
            chkTrangThai.Checked = true;
            dgvDSNguyenLieu.AutoGenerateColumns = false;
            txtMaNL.Enabled = false;
            DataGridViewComboBoxColumn dgvcolNL = (DataGridViewComboBoxColumn)dgvDSNguyenLieu.Columns["colLoaiNL"];
            DataTable dtNguyenLieu = LoaiNguyenLieuBUS.LoadDSLoaiNguyenLieu();

            // Đỗ dữ liệu cho cbo trong dgv
            dgvcolNL.DataSource    = dtNguyenLieu;
            dgvcolNL.DisplayMember = "TenLoaiNL";
            dgvcolNL.ValueMember   = "MaLoaiNL";
            // Đỗ dữ liệu cho cbo LoaiNguyenLieu
            cboLoaiNL.DataSource    = dtNguyenLieu;
            cboLoaiNL.DisplayMember = "TenLoaiNL";
            cboLoaiNL.ValueMember   = "MaLoaiNL";

            DataGridViewComboBoxColumn dgvcolNCC = (DataGridViewComboBoxColumn)dgvDSNguyenLieu.Columns["colNhaCungCap"];
            DataTable dtNhaCungCap = NhaCungCapBUS.LayDSNhaCungCap();

            // Đỗ dữ liệu cho cbo trong dgv
            dgvcolNCC.DataSource    = dtNhaCungCap;
            dgvcolNCC.DisplayMember = "TenNhaCC";
            dgvcolNCC.ValueMember   = "MaNCC";
            // Đỗ dữ liệu cho cbo NhaCungCap
            cboNhaCC.DataSource    = dtNhaCungCap;
            cboNhaCC.DisplayMember = "TenNhaCC";
            cboNhaCC.ValueMember   = "MaNCC";

            LoadDSNguyenLieu();
            AddStatus(1);
            RefeshForm();
        }
Example #2
0
        public void HienDSLoaiNL()
        {
            DataTable dtLoaiNL = LoaiNguyenLieuBUS.LoadDSLoaiNguyenLieu();

            rpvBaoCao.LocalReport.ReportEmbeddedResource = s + "rptDSLoaiNL.rdlc";
            rpvBaoCao.LocalReport.DataSources.Add(new ReportDataSource("DSLoaiNL", dtLoaiNL));
            rpvBaoCao.RefreshReport();
        }
Example #3
0
        private void frmBaoCaoThongKe_Load(object sender, EventArgs e)
        {
            cboLoaiMon.DataSource    = LoaiMonBUS.LayDanhSachLoaiMon();
            cboLoaiMon.DisplayMember = "TenLoaiMon";
            cboLoaiMon.ValueMember   = "MaLoaiMon";

            cboLoaiNL.DataSource    = LoaiNguyenLieuBUS.LoadDSLoaiNguyenLieu();
            cboLoaiNL.DisplayMember = "TenLoaiNL";
            cboLoaiNL.ValueMember   = "MaLoaiNL";
        }
        private void frmNguyenLieu_Activated(object sender, EventArgs e)
        {
            cboLoaiNL.DataSource    = LoaiNguyenLieuBUS.LoadDSLoaiNguyenLieu();
            cboLoaiNL.DisplayMember = "TenLoaiNL";
            cboLoaiNL.ValueMember   = "MaLoaiNL";

            cboNhaCC.DataSource    = NhaCungCapBUS.LayDSNhaCungCap();
            cboNhaCC.DisplayMember = "TenNhaCC";
            cboNhaCC.ValueMember   = "MaNCC";
        }
Example #5
0
 void LoadDSLoaiNguyenLieu()
 {
     if (chkNLConSuDung.Checked == false)
     {
         dgvDSLoaiNL.DataSource = LoaiNguyenLieuBUS.LoadDSLoaiNguyenLieu();
         AddStatus(1);
         btnXoa.Show();
         btnLamMoi.Show();
     }
     else
     {
         dgvDSLoaiNL.DataSource = LoaiNguyenLieuBUS.LayDSLoaiNguyenLieuKhongConSuDung();
         AddStatus(0);
         txtMaLoaiNL.Clear();
         txtTenLoaiNL.Clear();
         chkTrangThai.Checked = false;
     }
     dgvDSLoaiNL.CurrentCell = null;
 }