private void Search()
        {
            List <Expression <Func <ProgramFunctionMaster, bool> > > expressions = new List <Expression <Func <ProgramFunctionMaster, 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 = _programFunctionMasterRepository.Find(expressions);
            Control();
        }
        private void LoadProgramFunction()
        {
            var programFunctionMasters      = _programFunctionMasterRepository.Find(_ => _.Status == GlobalConstants.StatusValue.Using).OrderBy(_ => _.ProgramName).ThenBy(_ => _.FunctionName);
            var oldProgramFunctionAuthority = _programFunctionAuthorityRepository.Find(_ => _.AuthorityGroupID.Equals(_id));

            dgvDuLieu.Rows.Clear();
            int check = 0;

            foreach (var programFunctionMaster in programFunctionMasters)
            {
                check = 0;
                foreach (var programFunctionAuthority in oldProgramFunctionAuthority)
                {
                    if (programFunctionAuthority.ProgramName == programFunctionMaster.ProgramName &&
                        programFunctionAuthority.FunctionName == programFunctionMaster.FunctionName)
                    {
                        check = 1;
                        break;
                    }
                }
                object[] rowAdd = { check, programFunctionMaster.ProgramName, programFunctionMaster.FunctionName, programFunctionMaster.Explanation };
                dgvDuLieu.Rows.Add(rowAdd);
            }
        }