private void Search()
        {
            _projectDataContext      = new ProjectDataContext();
            _registBarcodeRepository = new RegistBarcodeRepository(_projectDataContext);
            List <Expression <Func <RegistBarcode, bool> > > expressions = new List <Expression <Func <RegistBarcode, bool> > >();
            DateTime fromDate = DateTime.Parse(dtpFromDate.Value.ToString("yyyy-MM-dd 00:00:00"));
            DateTime toDate   = DateTime.Parse(dtpToDate.Value.ToString("yyyy-MM-dd 23:59:59"));

            expressions.Add(_ => _.RegistDate >= fromDate && _.RegistDate <= toDate);
            dgvDuLieu.DataSource = _registBarcodeRepository.Find(expressions).OrderBy(_ => _.RegistDate).ThenBy(_ => _.ShiftNo).ThenBy(_ => _.SEQ);
            Control();
        }
示例#2
0
        private void Search()
        {
            List <Expression <Func <RegistBarcode, bool> > > expressions = new List <Expression <Func <RegistBarcode, bool> > >();

            if (!chkAllStatus.Checked)
            {
                GlobalConstants.StatusValue statusValue;
                Enum.TryParse <GlobalConstants.StatusValue>((chkUsing.Checked ? GlobalConstants.StatusValue.Using.ToString() : GlobalConstants.StatusValue.NoUse.ToString()), out statusValue);
                expressions.Add(_ => _.Status == statusValue);
            }
            dgvDuLieu.DataSource = _registBarcodeRepository.Find(expressions);
            Control();
        }