Esempio n. 1
0
        public EO_EmployeeDataTable EoEmployee_getList(EoEmployeeQryModel qm)
        {
            string[] empIds = null;
            //有指定群組
            if (!qm.Q_DepartmentCode_XX.isNullOrEmpty())
            {
                var dtDeptMember = NsDmHelper.EO_DeptMember
                                   .select(t => t.EODM_MemberId)
                                   .where (t => t.EODM_DeptCode_XX == qm.Q_DepartmentCode_XX.toConstReq1())
                                   .query();

                empIds = dtDeptMember.Select(x => x.EODM_MemberId).Distinct().ToArray();
            }

            var dt = NsDmHelper.EO_Employee
                     .selectAll(t => t.AllExt)
                     .where (t =>
                             t.EOE_EmployeeCode == qm.Q_EmployeeCode.toConstOpt1()
                             & t.EOE_LoginAccount_XX == qm.Q_LoginAccount_XX.toConstOpt1()
                             //& t.EOE_IsOrganManager == qm.Q_IsOrganManager.toConstOpt1()
                             //& t.EOE_IsManager == qm.Q_IsManager.toConstOpt1()
                             //& t.EOE_IsDeptMgr == qm.Q_IsDeptMgr.toConstOpt1()
                             //& t.EOE_OrganId == qm.Q_EnterOrgId.toConstOpt1()
                             & t.EOE_EmployeeTitleCode_XX == qm.Q_EmployeeTitleCode_XX.toConstOpt1()
                             & t.EOE_Enabled == qm.Q_Enabled.toConstOpt1()
                             & t.EOE_EmployeeName.contains(qm.Q_EmployeeName.toConstOpt1())
                             & t.EOE_EmployeeId.batchin(empIds.toConstOpt1())
                             )
                     .query();

            return(dt);
        }
        public ActionResult CodeQuery(FormCollection collection)
        {
            var qm  = new EoEmployeeQryModel();
            var bln = this.TryUpdateModel(qm);

            ViewBag.RequestKey = qm.RequestKey;
            return(View(qm));
        }
        public ActionResult List(FormCollection collection, int jtStartIndex = 0, int jtPageSize = 0, string jtSorting = null)
        {
            //查詢參數
            var para  = new EoEmployeeQryModel();
            var isOK  = this.TryUpdateModel(para);
            var token = collection["__RequestVerificationToken"];

            var dt = EoDataService.Instance.EoEmployee_getList(para);

            //排序
            var dtSorted = dt.sort(jtSorting);

            if (Request.IsAjaxRequest())
            {
                return(converToJTableSource(dtSorted, jtStartIndex, jtPageSize));
            }
            else
            {
                return(View(dt));
            }
        }