Ejemplo n.º 1
0
        private void ledLoaiVatTu_EditValueChanged(object sender, EventArgs e)
        {
            Entities db = new Entities();

            ID_loai_vat_tu = int.Parse(ledLoaiVatTu.EditValue.ToString());
            VatTuCtrl.LoadBindingSource(sTOVatTuBindingSource, ID_loai_vat_tu, db);

            string[] Ma_nhom = { "NAN", "PROFILE" };

            var result = (from p in db.STO_LoaiVatTu
                          join p1 in db.STO_NhomVatTu on p.ID_nhom_vat_tu equals p1.ID_nhom_vat_tu
                          where p.ID_loai_vat_tu == ID_loai_vat_tu && Ma_nhom.Contains(p.Ma_loai_vat_tu)
                          select p).ToList();

            if (result.Any())
            {
                gridView.Columns["Don_vi"].Visible      = true;
                gridView.Columns["Don_vi"].VisibleIndex = 5;
            }
            else
            {
                gridView.Columns["Don_vi"].Visible = false;
            }

            GridHelper.BestFitAllColumns(gridView);
        }
Ejemplo n.º 2
0
        private void gridControl_Load()
        {
            Entities db = new Entities();

            NhomVatTuCtrl.LoadLookUpEdit(rleNhomVatTu, db);
            KhoVatTuCtrl.LoadLookUpEdit(rleKhoVatTu, db);
            LoaiVatTuCtrl.LoadBindingSource(sTOLoaiVatTuBindingSource, db);
            GridHelper.BestFitAllColumns(gridView);
        }
Ejemplo n.º 3
0
        private void frmLoaiVatTu_Load(object sender, EventArgs e)
        {
            Entities db = new Entities();

            gridControl_Load();

            LoaiVatTuCtrl.LoadLookUpEdit(lookUpEdit, db);
            VaiTroQuyenCtrl.ReconfigFormControls(this, db);
            GridHelper.ReconfigGridView(gridView);
            GridHelper.HAlignmentAllHeaderColumns(gridView);
            GridHelper.BestFitAllColumns(gridView);
        }
Ejemplo n.º 4
0
        private void frmNhomVatTu_Load(object sender, EventArgs e)
        {
            Entities db = new Entities();

            KhoVatTuCtrl.LoadLookUpEdit(rleKhoVatTu, db);
            NhomVatTuCtrl.LoadBindingSource(sTONhomVatTuBindingSource, db);
            NhomVatTuCtrl.LoadLookUpEdit(lookUpEdit, db);
            VaiTroQuyenCtrl.ReconfigFormControls(this, db);
            GridHelper.ReconfigGridView(gridView);
            GridHelper.HAlignmentAllHeaderColumns(gridView);
            GridHelper.BestFitAllColumns(gridView);
        }
Ejemplo n.º 5
0
        private void frmKhoVatTu_Load(object sender, EventArgs e)
        {
            Entities db = new Entities();

            try
            {
                KhoVatTuCtrl.LoadBindingSource(sTOKhoVatTuBindingSource, db);
                KhoVatTuCtrl.LoadLookUpEdit(lookUpEdit, db);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            GridHelper.ConfigGridView(grvKhoVatTu, null, null, false);
            GridHelper.HAlignmentAllHeaderColumns(grvKhoVatTu);
            GridHelper.BestFitAllColumns(grvKhoVatTu);
            //VatTuCtrl.LoadLookUpEdit(rleVatTu, db);
            VaiTroQuyenCtrl.ReconfigFormControls(this, db);
            GridHelper.ReconfigGridView(grvKhoVatTu);
            //GridHelper.ReconfigGridView(grvKhoVatTuCT);
        }