public ActionResult CreateQualifySixSearch(DetailQualifyFiveSearchModel model)
        {
            var instDicts       = checkUnitService.GetAllCheckUnit();
            var workStatus      = sysDictServcie.GetDictsByKey("workStatus");
            var personnelTitles = sysDictServcie.GetDictsByKey("personnelTitles");
            var personnelStatus = sysDictServcie.GetDictsByKey("personnelStatus");
            var unitcode        = repOne.GetById(model.pid);
            var peoples         = peopleRep.GetByCondition(r => r.Customid == unitcode.unitCode && r.Approvalstatus == "3");
            //var peoples = peopleRep.GetByCondition(r => r.Customid == "1900021");
            DhtmlxGrid grid       = new DhtmlxGrid();
            string     customname = string.Empty;
            int        pos        = model.posStart.HasValue ? model.posStart.Value : 0;
            int        index      = pos;

            foreach (var item in peoples)
            {
                customname = checkUnitService.GetCheckUnitByIdFromAll(instDicts, item.Customid);
                DhtmlxGridRow row = new DhtmlxGridRow(item.id.ToString());
                //勾选,序号,姓名,性别,年龄,学历,专业,身份证号,从事检测工作类别,从事检测工作年限,社会保险证号,岗位证书编号,职务,职称,在职状况,状态
                row.AddCell("");
                row.AddCell((++index).ToString());
                row.AddCell(item.Name);
                row.AddCell(item.Sex);
                row.AddCell(item.age);
                row.AddCell(item.Education);
                row.AddCell(item.Professional);
                //row.AddCell(customname);
                row.AddCell(item.SelfNum);
                row.AddCell(string.Empty);
                row.AddCell(item.gznx);
                row.AddCell(item.SBNum);
                row.AddCell(item.PostNum);
                row.AddCell(item.zw);
                row.AddCell(SysDictUtility.GetKeyFromDic(personnelTitles, item.Title));
                row.AddCell(SysDictUtility.GetKeyFromDic(workStatus, item.iscb));
                row.AddCell(SysDictUtility.GetKeyFromDic(personnelStatus, item.Approvalstatus));
                row.AddCell(item.educationpath);
                row.AddCell(item.titlepath);
                row.AddCell(item.selfnumPath);
                row.AddCell(item.PostPath);
                row.AddCell(new DhtmlxGridCell("查看", false).AddCellAttribute("title", "查看"));
                grid.AddGridRow(row);
            }

            string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting);

            return(Content(str, "text/xml"));
        }
Beispiel #2
0
        public ActionResult Search(DetailQualifyFiveSearchModel model)
        {
            int pos   = model.posStart.HasValue ? model.posStart.Value : 0;
            int count = model.count.HasValue ? model.count.Value : 30;
            PagingOptions <t_D_UserTableFive> pagingOption = new PagingOptions <t_D_UserTableFive>(pos, count, t => new { t.id });
            DhtmlxGrid grid          = new DhtmlxGrid();
            var        userTableFive = repFive.GetByConditonPage(r => r.pid == model.pid, pagingOption);

            grid.AddPaging(pagingOption.TotalItems, pos);
            int index = pos + 1;

            foreach (var item in userTableFive)
            {
                var zczshpath = string.Empty;
                var sgzshpath = string.Empty;
                var zcpath    = string.Empty;
                var xlpath    = string.Empty;

                var data = JsonConvert.DeserializeObject <DetailQualifyFiveSearchViewModel>(item.gzjl);

                DhtmlxGridRow row = new DhtmlxGridRow(item.id);
                row.AddCell(index);
                row.AddCell(data.jclb);
                row.AddCell(data.jclr);
                row.AddCell(data.name);
                row.AddCell(data.zgzsh);
                row.AddCell(data.sgzsh);
                row.AddCell(data.zcdwmc);
                row.AddCell(data.zc);
                row.AddCell(data.zy);
                row.AddCell(data.xl);
                row.AddCell(data.jcnx);
                row.AddCell(data.detectnumstartdate + "至" + data.detectnumenddate);
                row.AddCell(data.bz);
                row.AddLinkJsCell("注册证书附件查看", "uploadFile(\"{0}\")".Fmt(data.zgzshpath + "+" + "注册证书附件"));
                row.AddLinkJsCell("上岗证书附件查看", "uploadFile(\"{0}\")".Fmt(data.sgzshpath + "+" + "上岗证书附件"));
                row.AddLinkJsCell("职称附件查看", "uploadFile(\"{0}\")".Fmt(data.zcpath + "+" + "职称附件"));
                row.AddLinkJsCell("学历附件查看", "uploadFile(\"{0}\")".Fmt(data.xlpath + "+" + "学历附件"));
                row.AddCell(new DhtmlxGridCell("删除", false).AddCellAttribute("title", "删除"));

                index++;
                grid.AddGridRow(row);
            }

            string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting);

            return(Content(str, "text/xml"));
        }