public ActionResult GridSearch(CheckStatisDataGridSearchModel model)
        {
            var        response = GetGridSerarchResponse(model);
            DhtmlxGrid grid     = new DhtmlxGrid();

            var allInsts = checkUnitService.GetAllCheckUnit();
            var allItems = itemNameService.GetAllItemName();
            var pos      = model.posStart.HasValue ? model.posStart.Value : 0;
            int index    = pos + 1;


            if (response.IsValid)
            {
                var totalCount = (int)response.Total;
                grid.AddPaging(totalCount, pos);
                foreach (var item in response.Documents)
                {
                    DhtmlxGridRow row = new DhtmlxGridRow(item.SYSPRIMARYKEY);
                    row.AddCell(index++);
                    row.AddCell(checkUnitService.GetCheckUnitByIdFromAll(allInsts, item.CUSTOMID));
                    row.AddCell(item.PROJECTNAME);
                    row.AddCell(itemNameService.GetItemCNNameFromAll(allItems, item.REPORTJXLB, item.ITEMNAME));
                    row.AddCell(GetUIDtString(item.CHECKDATE));
                    row.AddCell(GetUIDtString(item.PRINTDATE));
                    row.AddLinkJsCell(item.REPORTNUM, "getPKRReport(\"{0}\")".Fmt(item.REPORTNUM));
                    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"));
        }
        public ActionResult Search(PileUpdataInfo model)
        {
            int pos = model.posStart.HasValue ? model.posStart.Value : 0;

            var        client   = new JsonServiceClient(GetSceneDataUrl);
            var        response = client.Get(model);
            DhtmlxGrid grid     = new DhtmlxGrid();

            if (response.IsSucc)
            {
                int totalCount = (int)response.totalCount;
                grid.AddPaging(totalCount, pos);
                int index = pos;
                foreach (var item in response.datas)
                {
                    DhtmlxGridRow row = new DhtmlxGridRow(item.id);
                    row.AddCell(++index);
                    row.AddCell(item.customname);
                    row.AddCell(item.basicinfoid);
                    row.AddCell(item.utype);
                    row.AddCell(item.ordervalue);
                    row.AddCell(item.newvalue);
                    row.AddCell(item.addtime.HasValue ? item.addtime.Value.ToString("yyyy-MM-dd'T'HH:mm:ss") : string.Empty);
                    grid.AddGridRow(row);
                }
            }
            string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting);

            return(Content(str, "text/xml"));
        }
Ejemplo n.º 3
0
        public ActionResult Search(ZJCheckSearchModel model)
        {
            int            pos        = model.posStart.HasValue ? model.posStart.Value : 0;
            GetZJCheckList searchdata = new GetZJCheckList()
            {
                CheckUnitName = model.CheckUnitName,
                CheckEquip    = model.CheckEquip,
                CheckPeople   = model.CheckPeople,
                Area          = model.Area,
                Report        = model.Report,
                ZX            = model.ZX,
                posStart      = model.posStart,
                count         = model.count,
                ProjectName   = model.ProjectName,
                StartDate     = model.StartDate,
                EndDate       = model.EndDate
            };
            var        response   = zJCheckService.GetZJCheck(searchdata);
            int        totalCount = (int)response.totalCount;
            DhtmlxGrid grid       = new DhtmlxGrid();

            grid.AddPaging(totalCount, pos);
            int index = pos;

            foreach (var item in response.datas)
            {
                var strpeople = string.Empty;
                if (!item.testingpeople.IsNullOrEmpty())
                {
                    var           names         = JsonConvert.DeserializeObject <List <LiftingEquipmentPeopleModel> >(item.testingpeople);
                    List <string> testingPeople = new List <string>();
                    foreach (var name in names)
                    {
                        testingPeople.Add(name.name);
                    }
                    strpeople = testingPeople.Join(",");
                }


                DhtmlxGridRow row = new DhtmlxGridRow(item.Id);
                row.AddCell(++index);
                row.AddCell(item.customname);
                row.AddCell(item.projectname);
                row.AddCell(item.areainfo);
                row.AddCell((int)item.pilenum);
                row.AddCell(strpeople);
                row.AddCell(string.Empty);
                row.AddCell(item.testingequipment);
                row.AddCell(item.checknum);
                row.AddCell(item.reportcount);
                row.AddCell(item.filepath.IsNullOrEmpty() ? "否" : "是");
                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"));
        }
Ejemplo n.º 4
0
        public ActionResult Search(STCheckEquipModels model)
        {
            var        data = GetSearchResult(model);
            DhtmlxGrid grid = new DhtmlxGrid();
            int        pos  = model.posStart.HasValue ? model.posStart.Value : 0;

            grid.AddPaging(data.TotalCount, pos);
            var buttons     = GetCurrentUserPathActions();
            var allSTUnit   = GetCurrentInstsST();
            var compayTypes = sysDictServcie.GetDictsByKey("customStatus");

            for (int i = 0; i < data.Results.Count; i++)
            {
                var           equip = data.Results[i];
                var           start = equip.timestart.HasValue? GetUIDtString(equip.timestart.Value, "yyyy-MM-dd"):"";
                var           end   = equip.timeend.HasValue? GetUIDtString(equip.timeend.Value, "yyyy-MM-dd"): "";
                DhtmlxGridRow row   = new DhtmlxGridRow(equip.id.ToString());
                row.AddCell("");
                row.AddCell(pos + i + 1);
                row.AddCell(equip.EquName + equip.Equtype + equip.Equspec);
                row.AddCell(sTCustomService.GetSTUnitByIdFromAll(allSTUnit, equip.customid));
                if (start != "" && end != "")
                {
                    row.AddCell(start + "至" + end);
                }
                else
                {
                    row.AddCell(string.Empty);
                }

                row.AddCell(SysDictUtility.GetKeyFromDic(compayTypes, equip.approvalstatus));
                Dictionary <string, string> dict = new Dictionary <string, string>();
                if (HaveButtonFromAll(buttons, "ApplyChange") && sTCheckEquipService.CanApplyChangeCustom(equip.approvalstatus))
                {
                    dict.Add("[申请修改]", "applyChange({0},\"{1}\")".Fmt(equip.id, equip.EquName));
                }

                if (HaveButtonFromAll(buttons, "ConfirmApplyChange") && (equip.approvalstatus == "5"))
                {
                    dict.Add("[审核申请修改]", "confirmApplyChange({0},\"{1}\")".Fmt(equip.id, equip.EquName));
                }
                row.AddLinkJsCells(dict);
                if (HaveButtonFromAll(buttons, "Edit") && (equip.approvalstatus == "0" || equip.approvalstatus == "5"))// && checkUnitService.CanEditCustom(custom.APPROVALSTATUS))
                {
                    row.AddCell(new DhtmlxGridCell("编辑", false).AddCellAttribute("title", "编辑"));
                }
                else
                {
                    row.AddCell(string.Empty);
                }
                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"));
        }
        public ActionResult StatisGrid(SysSearchModel model)
        {
            int pos = model.posStart.HasValue ? model.posStart.Value : 0;

            model.GroupType = "Item";
            var response = GetStatisData(model);

            DhtmlxGrid grid = new DhtmlxGrid();

            if (response.IsValid)
            {
                int index      = pos;
                var bucks      = response.Aggs.Terms(aggeKey).Buckets;
                var allItems   = itemNameService.GetAllItemName();
                int totalCount = bucks.Count;
                grid.AddPaging(totalCount, pos);
                string CustomId  = InstUserCustomId();
                string itemValue = string.Empty;
                foreach (var item in bucks)
                {
                    string itemKey = item.Key;
                    switch (aggeKey)
                    {
                    case "ItemNum":
                        var itemKeys = item.Key.Split('|');
                        var jxlb     = itemKeys[0];
                        var itemCode = itemKeys[1];
                        itemValue = itemNameService.GetItemCNNameFromAll(allItems, jxlb, itemCode);
                        break;

                    case "Custom":
                        itemValue = checkUnitService.GetCheckUnitById(item.Key);
                        break;

                    case "Project":
                        itemValue = item.Key;
                        //item.Key= HttpUtility.UrlEncode(item.Key);
                        break;
                    }
                    DhtmlxGridRow row = new DhtmlxGridRow(item.Key);
                    row.AddCell((index + 1).ToString());
                    row.AddCell(itemValue);
                    row.AddCell((item.DocCount.HasValue ? item.DocCount.Value : 0).ToString());
                    row.AddLinkJsCell("材料动态分析表查看", "showUnquailfyAnalysis(\"{0}\",\"{1}\")".Fmt(itemKey, itemValue));
                    grid.AddGridRow(row);

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

            return(Content(str, "text/xml"));
        }
Ejemplo n.º 6
0
        public ActionResult Search(SysSearchModel model)
        {
            ISearchResponse <es_t_bp_item> response = GetSearchResult(model);
            int        pos        = model.posStart.HasValue ? model.posStart.Value : 0;
            int        totalCount = (int)response.Total;
            DhtmlxGrid grid       = new DhtmlxGrid();

            grid.AddPaging(totalCount, pos);
            int index             = pos;
            var allItems          = itemNameService.GetAllItemName();
            var allInsts          = checkUnitService.GetAllCheckUnit();
            var reportConclusions = sysDictService.GetDictsByKey("ReportConclusionCode");

            foreach (var item in response.Documents)
            {
                DhtmlxGridRow row = new DhtmlxGridRow(item.SYSPRIMARYKEY);

                row.AddCell(index + 1);
                if (item.CONCLUSIONCODE == "Y")
                {
                    row.AddCell(item.PROJECTNAME);
                }
                else
                {
                    row.AddCell(new DhtmlxGridCell("{0}".Fmt(item.PROJECTNAME), false).AddCellAttribute("style", "color:red"));
                    //row.AddCell(item.PROJECTNAME);
                }

                row.AddCell(SysDictUtility.GetKeyFromDic(reportConclusions, item.CONCLUSIONCODE, "/"));
                row.AddCell(checkUnitService.GetCheckUnitByIdFromAll(allInsts, item.CUSTOMID));
                if (item.ITEMCHNAME.IsNullOrEmpty())
                {
                    row.AddCell(itemNameService.GetItemCNNameFromAll(allItems, item.REPORTJXLB, item.ITEMNAME));
                }
                else
                {
                    row.AddCell(item.ITEMCHNAME);
                }
                row.AddLinkJsCell(item.REPORTNUM, "detailsReport(\"{0}\")".Fmt(item.SYSPRIMARYKEY));
                row.AddCell(item.SAMPLENUM);
                row.AddCell(item.ENTRUSTDATE.HasValue ? item.ENTRUSTDATE.Value.ToString("yyyy-MM-dd") : "/");
                row.AddCell(item.CHECKDATE.HasValue ? item.CHECKDATE.Value.ToString("yyyy-MM-dd") : "/");
                row.AddCell(reportService.GetReportDataStatus(item.SAMPLEDISPOSEPHASEORIGIN));
                index++;
                grid.AddGridRow(row);
            }
            string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting);

            return(Content(str, "text/xml"));
        }
        public ActionResult Search(STCheckPeopleSearchModel model)
        {
            var        data = GetSearchResult(model);
            DhtmlxGrid grid = new DhtmlxGrid();
            int        pos  = model.posStart.HasValue ? model.posStart.Value : 0;

            grid.AddPaging(data.TotalCount, pos);
            var buttons     = GetCurrentUserPathActions();
            var allSTUnit   = GetCurrentInstsST();
            var compayTypes = sysDictServcie.GetDictsByKey("customStatus");

            for (int i = 0; i < data.Results.Count; i++)
            {
                var           people = data.Results[i];
                DhtmlxGridRow row    = new DhtmlxGridRow(people.Id.ToString());
                row.AddCell("");
                row.AddCell(pos + i + 1);
                row.AddCell(people.Name);
                row.AddCell(sTCustomService.GetSTUnitByIdFromAll(allSTUnit, people.Customid));
                row.AddCell(people.SelfNum);
                row.AddCell(people.PostNum);
                row.AddCell(people.Tel);
                row.AddCell(SysDictUtility.GetKeyFromDic(compayTypes, people.Approvalstatus));
                Dictionary <string, string> dict = new Dictionary <string, string>();
                if (HaveButtonFromAll(buttons, "ApplyChange") && sTCheckPeopleService.CanApplyChangeCustom(people.Approvalstatus))
                {
                    dict.Add("[申请修改]", "applyChange({0},\"{1}\")".Fmt(people.Id, people.Name));
                }

                if (HaveButtonFromAll(buttons, "ConfirmApplyChange") && (people.Approvalstatus == "5"))
                {
                    dict.Add("[审核申请修改]", "confirmApplyChange({0},\"{1}\")".Fmt(people.Id, people.Name));
                }
                row.AddLinkJsCells(dict);
                if (HaveButtonFromAll(buttons, "Edit") && (people.Approvalstatus == "0" || people.Approvalstatus == "6"))// && checkUnitService.CanEditCustom(custom.APPROVALSTATUS))
                {
                    row.AddCell(new DhtmlxGridCell("编辑", false).AddCellAttribute("title", "编辑"));
                }
                else
                {
                    row.AddCell(string.Empty);
                }
                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"));
        }
Ejemplo n.º 8
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"));
        }
Ejemplo n.º 9
0
        public ActionResult Search(SysSoftwareVersSearchModel model)
        {
            var        data    = GetSearchResult(model);
            DhtmlxGrid grid    = new DhtmlxGrid();
            var        buttons = GetCurrentUserPathActions();
            int        pos     = model.posStart.HasValue ? model.posStart.Value : 0;

            grid.AddPaging(data.TotalCount, pos);
            for (int i = 0; i < data.Results.Count; i++)
            {
                var           softwareVers = data.Results[i];
                DhtmlxGridRow row          = new DhtmlxGridRow(softwareVers.id.ToString());
                row.AddCell(pos + i + 1);
                row.AddCell(softwareVers.usercode);
                row.AddCell(softwareVers.name);
                row.AddCell(softwareVers.FileVersion);
                row.AddCell(softwareVers.FileVersionDate);
                row.AddCell(softwareVers.EndDate);

                ///暂时未找到数据来源
                row.AddCell(string.Empty);
                row.AddCell(string.Empty);
                row.AddCell(string.Empty);

                if (HaveButtonFromAll(buttons, "Edit"))
                {
                    row.AddCell(new DhtmlxGridCell("编辑", false).AddCellAttribute("title", "编辑"));
                }
                else
                {
                    row.AddCell(string.Empty);
                }
                //if (HaveButtonFromAll(buttons, "Delete"))
                //{
                //    row.AddCell(new DhtmlxGridCell("删除", false).AddCellAttribute("title", "删除"));
                //}
                //else
                //{
                //    row.AddCell(string.Empty);
                //}
                grid.AddGridRow(row);
            }
            string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting);

            return(Content(str, "text/xml"));
        }
Ejemplo n.º 10
0
        public ActionResult Search(SysLogViewModels searchModel)
        {
            var predicate = PredicateBuilder.True <SysLog>();

            if (!string.IsNullOrWhiteSpace(searchModel.LogUserName))
            {
                predicate = predicate.And(p => p.UerName.Contains(searchModel.LogUserName));
            }
            if (!string.IsNullOrWhiteSpace(searchModel.LogType))
            {
                predicate = predicate.And(p => p.LogEvent.Contains(searchModel.LogType));
            }
            if (searchModel.LogStartDt.HasValue)
            {
                predicate = predicate.And(p => p.LogTime >= searchModel.LogStartDt.Value);
            }
            if (searchModel.LogEndDt.HasValue)
            {
                predicate = predicate.And(p => p.LogTime <= searchModel.LogEndDt.Value.AddDays(1));
            }

            int pos   = searchModel.posStart.HasValue ? searchModel.posStart.Value : 0;
            int count = searchModel.count.HasValue ? searchModel.count.Value : 30;

            PagingOptions <SysLog> pagingOption = new PagingOptions <SysLog>(pos, count, u => new { u.LogTime }, true);
            var logs = rep.GetByConditonPage(predicate, pagingOption);

            DhtmlxGrid grid = new DhtmlxGrid();

            grid.AddPaging(pagingOption.TotalItems, pos);
            for (int i = 0; i < logs.Count; i++)
            {
                var           log = logs[i];
                DhtmlxGridRow row = new DhtmlxGridRow(log.Id.ToString());
                row.AddCell((pos + i + 1).ToString());
                row.AddCell(log.UerName);
                row.AddCell(log.IpAddress);
                row.AddCell(log.LogEvent);
                row.AddCell(log.LogType);
                row.AddCell(log.LogTime.ToString("yyyy-MM-dd HH:mm:ss"));
                grid.AddGridRow(row);
            }
            string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting);

            return(Content(str, "text/xml"));
        }
Ejemplo n.º 11
0
        public ActionResult Search(SysSearchModel model)
        {
            model.modelType = SysSearchModelModelType.CheckStatis;
            var response = GetSearchResponse(model);

            int pos   = model.posStart.HasValue ? model.posStart.Value : 0;
            int index = pos + 1;

            DhtmlxGrid grid = new DhtmlxGrid();

            var allInsts = checkUnitService.GetAllCheckUnit();
            var allItems = itemNameService.GetAllItemName();

            if (response.IsValid)
            {
                int totalCount = (int)response.Total;
                grid.AddPaging(totalCount, pos);

                var pkrReports = reportService.GetPkrReportNums(response.Documents);

                foreach (var item in response.Documents)
                {
                    DhtmlxGridRow row = new DhtmlxGridRow(item.SYSPRIMARYKEY);
                    row.AddCell(index++);
                    row.AddCell(item.ENTRUSTUNIT);
                    row.AddCell(item.CONSTRACTUNIT);
                    row.AddCell(checkUnitService.GetCheckUnitByIdFromAll(allInsts, item.CUSTOMID));
                    row.AddCell(item.PROJECTNAME);
                    row.AddCell(item.STRUCTPART);
                    row.AddCell(itemNameService.GetItemCNNameFromAll(allItems, item.REPORTJXLB, item.ITEMNAME));
                    row.AddCell(item.CHECKTYPE);
                    row.AddCell(GetUIDtString(item.ENTRUSTDATE, "yyyy-MM-dd"));
                    row.AddCell(GetUIDtString(item.CHECKDATE, "yyyy-MM-dd"));
                    row.AddCell(GetUIDtString(item.PRINTDATE, "yyyy-MM-dd"));
                    BuildReportNumRow(reportService, pkrReports, item, row);
                    row.AddCell(item.CHECKCONCLUSION);
                    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"));
        }
Ejemplo n.º 12
0
        public ActionResult SearchImport(ApplyQualifyFiveSearchModel model)
        {
            DhtmlxGrid grid      = new DhtmlxGrid();
            var        precadite = PredicateBuilder.True <t_bp_People>();

            if (!model.CustomId.IsNullOrEmpty())
            {
                precadite = precadite.And(tt => tt.Customid == model.CustomId.Trim());
            }
            int pos             = model.posStart.HasValue ? model.posStart.Value : 0;
            int count           = model.count.HasValue ? model.count.Value : 30;
            var paging          = new PagingOptions <t_bp_People>(pos, count, t => t.id);
            var datas           = peopleRep.GetByConditonPage(precadite, paging);
            var totalCount      = (int)paging.TotalItems;
            var PersonnelTitles = sysDictServcie.GetDictsByKey("personnelTitles");

            grid.AddPaging(totalCount, pos);
            var index = 1;

            foreach (var item in datas)
            {
                DhtmlxGridRow row = new DhtmlxGridRow(item.id);
                row.AddCell(string.Empty);
                row.AddCell(index++);
                row.AddCell(item.Name);
                row.AddCell(string.Empty);
                row.AddCell(string.Empty);
                row.AddCell(string.Empty);
                row.AddCell(SysDictUtility.GetKeyFromDic(PersonnelTitles, item.Title));
                row.AddCell(item.Professional);
                row.AddCell(item.Education);
                row.AddCell(string.Empty);
                row.AddCell(new DhtmlxGridCell("查看", false).AddCellAttribute("title", "查看"));
                row.AddCell(string.Empty);
                row.AddCell(string.Empty);
                row.AddCell(item.titlepath);
                row.AddCell(item.educationpath);

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

            return(Content(str, "text/xml"));
        }
        public ActionResult SearchGrid(SysSearchModel model)
        {
            int        pos      = model.posStart.HasValue ? model.posStart.Value : 0;
            DhtmlxGrid grid     = new DhtmlxGrid();
            var        response = GetStatisDetailData(model);

            if (response.IsValid)
            {
                int totalCount = (int)response.Total;

                grid.AddPaging(totalCount, pos);

                int index      = pos;
                var allInst    = checkUnitService.GetAllCheckUnit();
                var allItems   = itemNameService.GetAllItemName();
                var pkrReports = reportService.GetPkrReportNums(response.Documents);
                foreach (var item in response.Documents)
                {
                    DhtmlxGridRow row = new DhtmlxGridRow(item.SYSPRIMARYKEY);
                    row.AddCell((index + 1).ToString());
                    row.AddCell(checkUnitService.GetCheckUnitByIdFromAll(allInst, item.CUSTOMID));
                    row.AddCell(item.PROJECTNAME);
                    if (item.ITEMCHNAME.IsNullOrEmpty())
                    {
                        row.AddCell(itemNameService.GetItemCNNameFromAll(allItems, item.REPORTJXLB, item.ITEMNAME));
                    }
                    else
                    {
                        row.AddCell(item.ITEMCHNAME);
                    }

                    row.AddCell(GetUIDtString(item.PRINTDATE));
                    BuildReportNumRow(reportService, pkrReports, item, row);
                    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"));
        }
        public ActionResult Search(CheckStatisHNKYSearchModel model)
        {
            var        response   = GetResult(model);
            var        totalCount = response.Total;
            int        pos        = model.posStart ?? 0;
            DhtmlxGrid grid       = new DhtmlxGrid();

            grid.AddPaging((int)totalCount, pos);

            var allCustoms = checkUnitService.GetAllCheckUnit();
            var index      = 1;

            foreach (var item in response.Documents)
            {
                var customName = string.Empty;
                allCustoms.TryGetValue(item.CUSTOMID, out customName);
                DhtmlxGridRow row = new DhtmlxGridRow(item.SYSPRIMARYKEY);
                row.AddCell(index++);
                row.AddCell(item.PROJECTNAME);
                row.AddCell(item.STRUCTPART);
                row.AddCell(checkUnitService.GetCheckUnitByIdFromAll(allCustoms, item.CUSTOMID));
                row.AddCell(GetUIDtString(item.CHECKDATE, "yyyy-MM-dd"));
                row.AddLinkJsCell(item.REPORTNUM, "detailsReport(\"{0}\")".Fmt(item.SYSPRIMARYKEY));
                row.AddCell(item.LINQI);
                row.AddCell(item.SHEJIDENGJI);
                row.AddCell(item.QIANGDUDAIBIAOZHI);
                if (model.qiangduwuxiao.HasValue && model.qiangduwuxiao == 1)
                {
                    row.AddCell(string.Empty);
                }
                else
                {
                    row.AddCell(item.BAIFENGBI.ToString());
                }
                grid.AddGridRow(row);
            }

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

            return(Content(str, "text/xml"));
        }
Ejemplo n.º 15
0
        public ActionResult Search(GetXCProjectInfos model)
        {
            var        client = new JsonServiceClient(GetSceneDataUrl);
            var        data   = client.Get(model);
            DhtmlxGrid grid   = new DhtmlxGrid();
            int        pos    = model.posStart.HasValue ? model.posStart.Value : 0;
            int        index  = pos;

            grid.AddPaging(data.totalCount, pos);
            foreach (var item in data.datas)
            {
                //循环内处理单位名称、见证人员处理
                DhtmlxGridRow row = new DhtmlxGridRow(item.Id.ToString());
                row.AddCell((++index).ToString());
                row.AddCell(item.customname);
                row.AddCell(item.projectname);
                if (!item.witnesspeople.IsNullOrEmpty())
                {
                    var           witnesspeople = JsonConvert.DeserializeObject <List <witnesspeopleModels> >(item.witnesspeople);
                    List <string> names         = new List <string>();
                    foreach (var name in witnesspeople)
                    {
                        names.Add(name.name);
                    }
                    row.AddCell(names.Join(","));
                }
                else
                {
                    row.AddCell(string.Empty);
                }

                row.AddCell(item.areainfo);
                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"));
        }
Ejemplo n.º 16
0
        public ActionResult Search(SysInfoSearchModel model)
        {
            var        data    = GetSearchResult(model);
            DhtmlxGrid grid    = new DhtmlxGrid();
            var        buttons = GetCurrentUserPathActions();
            int        pos     = model.posStart.HasValue ? model.posStart.Value : 0;

            grid.AddPaging(data.TotalCount, pos);
            for (int i = 0; i < data.Results.Count; i++)
            {
                var           information = data.Results[i];
                DhtmlxGridRow row         = new DhtmlxGridRow(information.Id.ToString());
                row.AddCell(pos + i + 1);
                row.AddCell(information.Name);
                row.AddCell(information.Content);
                row.AddCell(GetUIDtString(information.Time));
                if (HaveButtonFromAll(buttons, "Edit"))
                {
                    row.AddCell(new DhtmlxGridCell("编辑", false).AddCellAttribute("title", "编辑"));
                }
                else
                {
                    row.AddCell(string.Empty);
                }
                if (HaveButtonFromAll(buttons, "Delete"))
                {
                    row.AddCell(new DhtmlxGridCell("删除", false).AddCellAttribute("title", "删除"));
                }
                else
                {
                    row.AddCell(string.Empty);
                }
                grid.AddGridRow(row);
            }
            string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting);

            return(Content(str, "text/xml"));
        }
Ejemplo n.º 17
0
        public ActionResult Search(STSysSearchModel model)
        {
            int pos = model.posStart.HasValue ? model.posStart.Value : 0;
            ISearchResponse <es_t_bp_item> response = GetSearchResult(model);

            int        totalCount = (int)response.Total;
            DhtmlxGrid grid       = new DhtmlxGrid();

            grid.AddPaging(totalCount, pos);
            int index             = pos;
            var allCheckItems     = sHItemNameService.GetAllSHItemName();
            var reportConclusions = sysDictService.GetDictsByKey("ReportConclusionCode");

            foreach (var item in response.Documents)
            {
                DhtmlxGridRow row = new DhtmlxGridRow(item.SYSPRIMARYKEY);
                row.AddCell(index + 1);
                row.AddCell(item.PROJECTNAME);
                row.AddCell(SysDictUtility.GetKeyFromDic(reportConclusions, item.CONCLUSIONCODE, "/"));
                row.AddCell(checkUnitService.GetSTCheckUnitById(item.CUSTOMID));
                row.AddCell(item.STRUCTPART);
                row.AddCell(sHItemNameService.GetItemSHNameFromAll(allCheckItems, item.ITEMNAME));

                row.AddCell(item.REPORTNUM);
                row.AddCell(item.QRCODEBAR);
                row.AddCell(GetUIDtString(item.CHECKDATE, "yyyy-MM-dd"));
                row.AddCell(GetUIDtString(item.APPROVEDATE, "yyyy-MM-dd"));
                row.AddCell(reportService.GetReportDataStatus(item.SAMPLEDISPOSEPHASEORIGIN));
                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"));
        }
        public ActionResult SearchEdit(ApplyQualifySevenSearchModel model)
        {
            DhtmlxGrid grid      = new DhtmlxGrid();
            var        precadite = PredicateBuilder.True <t_D_UserTableSeven>();

            if (!model.PId.IsNullOrEmpty())
            {
                precadite = precadite.And(tt => tt.pid == model.PId.Trim());
            }
            if (!model.CustomId.IsNullOrEmpty())
            {
                precadite = precadite.And(tt => tt.unitcode == model.CustomId.Trim());
            }

            int pos    = model.posStart.HasValue ? model.posStart.Value : 0;
            int count  = model.count.HasValue ? model.count.Value : 30;
            var pagine = new PagingOptions <t_D_UserTableSeven>(pos, count, tt => tt.id);

            var datas      = repSeven.GetByConditonPage(precadite, pagine);
            var totalCount = (int)pagine.TotalItems;

            grid.AddPaging(totalCount, pos);
            int index = 1;

            List <int?> equipIds = new List <int?>();

            foreach (var item in datas)
            {
                equipIds.Add(item.EquipId);
            }

            Dictionary <int, string> fileUrls = new Dictionary <int, string>();

            using (var db = dbFactory.Open())
            {
                fileUrls = db.Dictionary <int, string>(db.From <t_bp_Equipment>().Where(t => equipIds.Contains(t.id)).Select(t => new { t.id, t.repaircerfnumpath }));
            }
            var currentUserRole = GetCurrentUserRole();

            foreach (var item in datas)
            {
                var equip = JsonConvert.DeserializeObject <ApplyQualifySevenEquipModel>(item.gzjl);
                if (equip != null)
                {
                    DhtmlxGridRow row     = new DhtmlxGridRow(item.EquipId.HasValue ? item.EquipId.Value : item.id);
                    var           fileUrl = string.Empty;
                    if (item.EquipId.HasValue)
                    {
                        fileUrls.TryGetValue(item.EquipId.Value, out fileUrl);
                    }
                    row.AddCell(index++);
                    row.AddCell(equip.jcxm);
                    row.AddCell(equip.zyyqsb);
                    row.AddCell(equip.clfw);
                    row.AddCell(equip.zqddj);
                    row.AddCell(equip.jdxzjg);
                    row.AddCell(GetUIDtString(equip.yxrq));
                    row.AddCell(equip.zjxxm);
                    row.AddCell(equip.zjxgfmcjbh);
                    row.AddCell(equip.bz);
                    row.AddLinkJsCell("检定/校准文件查看", "uploadFile(\"{0}\")".Fmt(fileUrl));

                    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"));
        }
        public ActionResult Search(QualifysixSearchModel model)
        {
            int pos   = model.posStart.HasValue ? model.posStart.Value : 0;
            int count = model.count.HasValue ? model.count.Value : 30;
            PagingOptions <t_D_UserTableSix> pagingOption = new PagingOptions <t_D_UserTableSix>(pos, count, t => new { t.id });
            DhtmlxGrid grid         = new DhtmlxGrid();
            var        userTableSix = repSix.GetByCondition(r => r.pid == model.pid);

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

            List <int?> Ids = new List <int?>();

            foreach (var item in userTableSix)
            {
                if (item.PeopleId.HasValue)
                {
                    Ids.Add(item.PeopleId.Value);
                }
            }

            var fileUrls = peopleRep.GetByConditon <PeopleSearchModel>(t => Ids.Contains(t.id), t => new { t.id, t.educationpath, t.selfnumPath, t.titlepath, t.PostPath });


            foreach (var item in userTableSix)
            {
                var           data  = JsonConvert.DeserializeObject <ApplyQualifSixData>(item.gzjl);
                var           rowId = item.PeopleId.HasValue ? item.PeopleId.Value : item.id;
                DhtmlxGridRow row   = new DhtmlxGridRow(rowId);
                //row.AddCell(index);
                row.AddCell(data.xm);
                row.AddCell(data.xb);
                row.AddCell(data.nl);
                row.AddCell(data.zw);
                row.AddCell(data.xl);
                row.AddCell(data.zy);
                row.AddCell(data.zc);
                row.AddCell(data.sfzhm);
                row.AddCell(data.sgzsh);
                row.AddCell(data.csjflb);
                row.AddCell(data.csjfnx);
                row.AddCell(data.shbxzh);
                row.AddCell(data.xlpath);
                row.AddCell(data.zcpath);
                row.AddCell(data.sfzhmpath);
                row.AddCell(data.sgzshpath);
                if (Ids.Contains(item.PeopleId))
                {
                    var fileUrl = fileUrls.Where(t => t.id == item.PeopleId);
                    if (fileUrl != null && fileUrl.Count() > 0)
                    {
                        var filePath = fileUrl.First();
                        Dictionary <string, string> dict = new Dictionary <string, string>();
                        if (!filePath.educationpath.IsNullOrEmpty())
                        {
                            dict.Add("学历证书", "uploadFile(\"{0}\")".Fmt(filePath.educationpath));
                        }
                        if (!filePath.titlepath.IsNullOrEmpty())
                        {
                            dict.Add("职称证书", "uploadFile(\"{0}\")".Fmt(filePath.titlepath));
                        }
                        if (!filePath.PostPath.IsNullOrEmpty())
                        {
                            dict.Add("上岗证书", "uploadFile(\"{0}\")".Fmt(filePath.PostPath));
                        }
                        if (!filePath.selfnumPath.IsNullOrEmpty())
                        {
                            dict.Add("身份证扫描", "uploadFile(\"{0}\")".Fmt(filePath.selfnumPath));
                        }
                        row.AddLinkJsCells(dict);
                    }
                    else
                    {
                        row.AddCell(string.Empty);
                    }
                }
                else
                {
                    row.AddCell(string.Empty);
                }
                row.AddCell(string.Empty);
                row.AddCell(string.Empty);
                if (currentUserRole.Code == "JCZXYH")
                {
                    row.AddCell(new DhtmlxGridCell("删除", false).AddCellAttribute("title", "删除"));
                }
                else
                {
                    row.AddCell(string.Empty);
                }
                index++;
                grid.AddGridRow(row);
            }
            string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting);

            return(Content(str, "text/xml"));
        }
Ejemplo n.º 20
0
        public ActionResult Search(SysViewSearchModels searchModel)
        {
            var predicate     = PredicateBuilder.True <UserAsRole>();
            var predicateRole = PredicateBuilder.True <UserInRole>();

            if (!string.IsNullOrWhiteSpace(searchModel.CheckUnitName))
            {
                predicate = predicate.And(t => t.CustomId == searchModel.CheckUnitName);
            }
            if (!string.IsNullOrWhiteSpace(searchModel.UserDisplayName))
            {
                predicate = predicate.And(t => t.UserDisplayName.Contains(searchModel.UserDisplayName));
            }
            if (!string.IsNullOrWhiteSpace(searchModel.UserName))
            {
                predicate = predicate.And(t => t.UserName == searchModel.UserName);
            }
            if (!string.IsNullOrWhiteSpace(searchModel.CheckStatus))
            {
                predicate = predicate.And(t => t.CheckStatus == searchModel.CheckStatus);
            }
            if (!string.IsNullOrEmpty(searchModel.RoleNames))
            {
                var allRoles = roleRep.GetByCondition(r => searchModel.RoleNames.Split(',').ToList().Contains(r.Name)).Select(s => s.Id).ToList();
                predicate = predicate.And(t => allRoles.Contains(t.RoleId));
            }
            else
            {
                var allRoles = roleRep.GetByCondition(t => t.Code != "QYY" && t.Code != "JYY").Select(s => s.Id).ToList();
                predicate = predicate.And(t => allRoles.Contains(t.RoleId));
            }
            //if(string.IsNullOrWhiteSpace(searchModel.Valie))
            //{
            //    predicate = predicate.And(t => t.Valie == searchModel.Valie);
            //}
            int pos   = searchModel.posStart.HasValue ? searchModel.posStart.Value : 0;
            int count = searchModel.count.HasValue ? searchModel.count.Value : 30;


            PagingOptions <UserAsRole> pagingOption = new PagingOptions <UserAsRole>(pos, count, u => new { u.Id });
            var users      = userAsRoleRep.GetByConditonPage(predicate, pagingOption);
            var userTypes  = sysDictService.GetDictsByKey("UserType");
            var userStatus = sysDictService.GetDictsByKey("UserStatus");
            var allInsts   = checkUnitService.GetAllCheckUnit();
            var userValie  = sysDictService.GetDictsByKey("Valid");
            var allRole    = roleRep.GetByCondition(u => true);

            DhtmlxGrid grid = new DhtmlxGrid();

            grid.AddPaging(pagingOption.TotalItems, pos);
            for (int i = 0; i < users.Count; i++)
            {
                var           oneUser = users[i];
                DhtmlxGridRow row     = new DhtmlxGridRow(oneUser.Id);
                row.AddCell((pos + i + 1).ToString());
                row.AddCell(oneUser.UserDisplayName);
                if (oneUser.RoleId == 3 || oneUser.RoleId == 5)
                {
                    row.AddCell(oneUser.UnitName);
                }
                else if (string.IsNullOrWhiteSpace(oneUser.CustomId) || !allInsts.ContainsKey(oneUser.CustomId.ToUpper()))
                {
                    row.AddCell("系统用户");
                }
                else
                {
                    row.AddCell(allInsts[oneUser.CustomId]);
                }

                row.AddCell(oneUser.UserName);
                row.AddCell(SysDictUtility.GetKeyFromDic(userValie, oneUser.Valie));
                row.AddCell(SysDictUtility.GetKeyFromDic(userStatus, oneUser.Status, "禁止"));
                var a = allRole.Where(u => u.Id == oneUser.RoleId);
                row.AddCell(allRole.Where(u => u.Id == oneUser.RoleId).Select(u => u.Name).FirstOrDefault().ToString());
                //row.AddCell(oneUser.CheckStatus == "1" ? "已审核" : "未审核");

                row.AddLinkJsCell("自定义模块", "personModule({0})".Fmt(oneUser.Id));
                row.AddLinkJsCell("自定义按钮", "personAction({0})".Fmt(oneUser.Id));
                if (superVisorRoleCode.Contains(userService.GetUserRole(oneUser.Id).Code))
                {
                    row.AddLinkJsCell("自定义机构", "personInst({0},\"{1}\")".Fmt(oneUser.Id, oneUser.UserDisplayName));
                }
                else
                {
                    row.AddCell(string.Empty);
                }
                row.AddLinkJsCell("密码重置", "PaswordRest({0})".Fmt(oneUser.Id));
                row.AddLinkJsCells(GetOpDicts(oneUser));
                grid.AddGridRow(row);
            }
            string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting);

            return(Content(str, "text/xml"));
        }
Ejemplo n.º 21
0
        public ActionResult Search(LiftingEquipmentSearchModel model)
        {
            DhtmlxGrid grid = new DhtmlxGrid();


            var client = new JsonServiceClient(GetSceneDataUrl);

            GetListProgramme request = new GetListProgramme()
            {
                customId    = model.customId,
                projectname = model.projectname,
                areainfo    = model.areainfo,
                testpeople  = model.testpeople,
                posStart    = model.posStart,
                count       = model.count,
                StartDate   = model.StartDate,
                EndDate     = model.EndDate
            };

            if (model.IsReport.HasValue)
            {
                request.IsReport = model.IsReport.Value;
            }
            if (model.IsPhoto.HasValue)
            {
                request.IsPhoto = model.IsPhoto.Value;
            }

            var responses = client.Get(request);

            int pos = model.posStart.HasValue ? model.posStart.Value : 0;

            if (responses.IsSucc)
            {
                grid.AddPaging(responses.totalCount, pos);
                int index = 1 + pos;
                foreach (var item in responses.programes)
                {
                    List <string> peopleName = new List <string>();
                    if (!item.testingpeople.IsNullOrEmpty())
                    {
                        var Peoples = JsonConvert.DeserializeObject <List <LiftingEquipmentPeopleModel> >(item.testingpeople);
                        foreach (var people in Peoples)
                        {
                            peopleName.Add(people.name);
                        }
                    }
                    DhtmlxGridRow row = new DhtmlxGridRow(item.id);
                    row.AddCell(index++);
                    row.AddCell(item.customname);
                    row.AddCell(item.projectname);
                    row.AddCell(item.areainfo);
                    row.AddCell(item.checktype);
                    row.AddCell(peopleName.Join(","));
                    row.AddCell(GetUIDtString(item.addtime, "yyyy-MM-dd"));
                    row.AddCell(item.checknum);
                    if (item.reportcount > 0)
                    {
                        row.AddLinkJsCell(item.reportcount, "detailsReport(\"{0}\",\"{1}\")".Fmt(item.checknum, item.projectnum));
                    }
                    else
                    {
                        row.AddCell(item.reportcount);
                    }
                    row.AddCell(item.photoid.HasValue ? "有拍照" : "无拍照");
                    row.AddCell(item.longitude.HasValue && item.latitude.HasValue ?"有":"无");
                    //row.AddCell(new DhtmlxGridCell("查看",false).AddCellAttribute("title","查看"));
                    if (item.qrinfo.IsNullOrEmpty())
                    {
                        row.AddCell(string.Empty);
                    }
                    else
                    {
                        row.AddLinkJsCell("查看", "DetailsQrInfo(\"{0}\")".Fmt(item.qrinfo));
                    }
                    grid.AddGridRow(row);
                }
            }

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

            return(Content(str, "text/xml"));
        }
Ejemplo n.º 22
0
        public ActionResult Search(HTYSerchViewModel searchModel)
        {
            var predicate = PredicateBuilder.True <tab_hty_programme>();

            if (!string.IsNullOrEmpty(searchModel.CheckUnitName))
            {
                predicate = predicate.And(t => t.unitcode == searchModel.CheckUnitName);
            }
            if (!string.IsNullOrEmpty(searchModel.CheckProject))
            {
                predicate = predicate.And(t => t.projectname.Contains(searchModel.CheckProject));
            }


            int pos   = searchModel.posStart.HasValue ? searchModel.posStart.Value : 0;
            int count = searchModel.count.HasValue ? searchModel.count.Value : 30;
            PagingOptions <tab_hty_programme> pagingOption = new PagingOptions <tab_hty_programme>(pos, count, u => new { u.id });
            var piles = HTYRep.GetByConditonPage(predicate, pagingOption);

            DhtmlxGrid grid       = new DhtmlxGrid();
            string     customname = string.Empty;

            grid.AddPaging(pagingOption.TotalItems, pos);
            var allCustoms = checkUnitServce.GetAllCheckUnit();

            // var allunit=
            for (int i = 0; i < piles.Count; i++)
            {
                var pile = piles[i];

                DhtmlxGridRow row = new DhtmlxGridRow(pile.id.ToString());
                row.AddCell((pos + i + 1).ToString());
                string customName = checkUnitServce.GetCheckUnitByIdFromAll(allCustoms, pile.unitcode);// string.Empty;
                row.AddCell(customName);
                row.AddCell(pile.projectname);
                var peopleNames = string.Empty;
                var peopleIds   = pile.testingpeople;
                if (!peopleIds.IsNullOrEmpty())
                {
                    var peoIds  = peopleIds.Split(',').ToList();
                    var peoples = peopleRep.GetByCondition(w => peoIds.Contains(w.id.ToString()));
                    peopleNames = peoples.Select(s => s.Name).Join("、");
                }
                row.AddCell(peopleNames);
                var equipNames = string.Empty;
                var equipIds   = pile.testingequipment;
                if (!equipIds.IsNullOrEmpty())
                {
                    var equIds = equipIds.Split(',').ToList();
                    var equips = equipRep.GetByCondition(w => equIds.Contains(w.id.ToString()));
                    equipNames = equips.Select(s => s.EquName).Join("、");
                }
                row.AddCell(equipNames);
                row.AddCell(pile.checknum);
                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"));
        }
Ejemplo n.º 23
0
        public ActionResult Search(ZJHistoryCheckSearchModel model)
        {
            DhtmlxGrid grid = new DhtmlxGrid();

            var client = new JsonServiceClient(GetSceneDataUrl);

            bool?hasReport = null;

            if (!model.hasReport.IsNullOrEmpty())
            {
                hasReport = model.hasReport == "1" ? true : false;
            }


            var response = client.Get(new HistorySite()
            {
                customId      = model.customId,
                projectName   = model.projectname,
                testingpeople = model.testpeople,
                testtype      = model.testtype,
                testingequip  = model.testpeople,
                areainfo      = model.areainfo,
                piletype      = model.piletype,
                hasReport     = hasReport,

                posStart = model.posStart,
                count    = model.count
            });

            if (response.IsSucc)
            {
                var index = 1;
                int pos   = model.posStart.HasValue ? model.posStart.Value : 0;
                grid.AddPaging((int)response.totalCount, pos);
                var allCustom = checkUnitService.GetAllCheckUnit();
                foreach (var item in response.datas)
                {
                    List <string> peopleName = new List <string>();
                    if (!item.testingpeople.IsNullOrEmpty())
                    {
                        var Peoples = JsonConvert.DeserializeObject <List <LiftingEquipmentPeopleModel> >(item.testingpeople);
                        foreach (var people in Peoples)
                        {
                            peopleName.Add(people.name);
                        }
                    }

                    DhtmlxGridRow row = new DhtmlxGridRow(item.pid.ToString());
                    row.AddCell(index++);
                    row.AddCell(checkUnitService.GetCheckUnitByIdFromAll(allCustom, item.customid));
                    row.AddCell(item.projectname);
                    row.AddCell(item.areainfo);
                    row.AddCell(item.projectaddress);
                    row.AddCell(peopleName.Join(","));
                    row.AddCell(item.testtype);
                    row.AddCell(item.piletype);
                    if (item.num > 0)
                    {
                        row.AddLinkJsCell(item.num.ToString(), "details(\"{0}\",\"{1}\")".Fmt(item.SerialNo, item.customid));
                    }
                    else
                    {
                        row.AddLinkJsCell(string.Empty, string.Empty);
                    }
                    grid.AddGridRow(row);
                }
            }


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

            return(Content(str, "text/xml"));
        }
Ejemplo n.º 24
0
        public ActionResult Search(DistributeExpertSearchModel searchModel)
        {
            var data = GetSearchResult(searchModel);

            DhtmlxGrid grid = new DhtmlxGrid();
            int        pos  = searchModel.posStart.HasValue ? searchModel.posStart.Value : 0;

            grid.AddPaging(data.TotalCount, pos);
            var buttons         = GetCurrentUserPathActions();
            var currentUserRole = GetCurrentUserRole();

            for (int i = 0; i < data.Results.Count; i++)
            {
                var           rowData = data.Results[i];
                DhtmlxGridRow row     = new DhtmlxGridRow(rowData.id);
                row.AddCell(string.Empty);
                row.AddCell((pos + i + 1).ToString());//序号

                var tbOne = repOne.GetById(rowData.pid);
                if (tbOne != null)
                {
                    row.AddCell(tbOne.unitname);
                }
                else
                {
                    row.AddCell("");
                }

                var zj = string.Empty;
                if (!string.IsNullOrEmpty(rowData.zjsp1))
                {
                    zj += rowData.zjsp1;
                }
                if (!string.IsNullOrEmpty(rowData.zjsp2))
                {
                    zj += "," + rowData.zjsp2;
                }
                if (!string.IsNullOrEmpty(zj))
                {
                    var userDic = userService.ApiGetUserNameByUserIds(zj.Split(',').ToList());
                    row.AddCell(userDic.Values.Join(","));
                }
                else
                {
                    row.AddCell("");
                }

                if (HaveButtonFromAll(buttons, "Distribute") && (rowData.@static == 1 || rowData.@static == 2))
                {
                    row.AddLinkJsCell("分配专家", "DistributeExpert(\"{0}\",\"{1}\")".Fmt(rowData.id, rowData.pid));
                }
                else
                {
                    row.AddCell(string.Empty);
                }

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

            return(Content(str, "text/xml"));
        }
Ejemplo n.º 25
0
        public ActionResult Search(CBRUnitSearchModel searchModel)
        {
            var data = GetSearchResult(searchModel);

            DhtmlxGrid grid = new DhtmlxGrid();
            int        pos  = searchModel.posStart.HasValue ? searchModel.posStart.Value : 0;

            grid.AddPaging(data.TotalCount, pos);
            var buttons         = GetCurrentUserPathActions();
            var currentUserRole = GetCurrentUserRole();

            for (int i = 0; i < data.Results.Count; i++)
            {
                var           rowData = data.Results[i];
                DhtmlxGridRow row     = new DhtmlxGridRow(rowData.id.ToString());
                row.AddCell(string.Empty);
                row.AddCell((pos + i + 1).ToString());//序号

                var tbOne = repOne.GetById(rowData.pid);
                if (tbOne != null)
                {
                    row.AddCell(tbOne.unitname);
                }
                else
                {
                    row.AddCell("");
                }

                if (rowData.zjsp1.HasValue)
                {
                    var user = repUser.GetById(rowData.zjsp1);
                    var ueu  = repEU.GetByCondition(r => r.userid == user.Id && r.pid == rowData.pid).FirstOrDefault();
                    if (ueu != null)
                    {
                        if (ueu.qualifystatus == 1)
                        {
                            row.AddLinkJsCell(user.UserDisplayName + "/[建设工程质量检测资质机构审核表]", "DetailUnitBuildingQualify(\"{0}\",\"{1}\")".Fmt(ueu.shid, ueu.pid));
                        }
                        else
                        {
                            row.AddCell("");
                        }

                        if (ueu.speicalstatus == 1)
                        {
                            row.AddLinkJsCell(user.UserDisplayName + "/[专项检测备案审核表]", "DetailSpecialQualify(\"{0}\",\"{1}\")".Fmt(ueu.scid, ueu.pid));
                        }
                        else
                        {
                            row.AddCell("");
                        }
                    }
                    else
                    {
                        row.AddCell("");
                        row.AddCell("");
                    }
                }
                else
                {
                    row.AddCell("");
                    row.AddCell("");
                }

                if (rowData.zjsp2.HasValue)
                {
                    var user = repUser.GetById(rowData.zjsp2);
                    var ueu  = repEU.GetByCondition(r => r.userid == user.Id && r.pid == rowData.pid).FirstOrDefault();
                    if (ueu != null)
                    {
                        if (ueu.qualifystatus == 1)
                        {
                            row.AddLinkJsCell(user.UserDisplayName + "/[建设工程质量检测资质机构审核表]", "DetailUnitBuildingQualify(\"{0}\",\"{1}\")".Fmt(ueu.shid, ueu.pid));
                        }
                        else
                        {
                            row.AddCell("");
                        }

                        if (ueu.speicalstatus == 1)
                        {
                            row.AddLinkJsCell(user.UserDisplayName + "/[专项检测备案审核表]", "DetailSpecialQualify(\"{0}\",\"{1}\")".Fmt(ueu.scid, ueu.pid));
                        }
                        else
                        {
                            row.AddCell("");
                        }
                    }
                    else
                    {
                        row.AddCell("");
                        row.AddCell("");
                    }
                }
                else
                {
                    row.AddCell("");
                    row.AddCell("");
                }

                row.AddCell(rowData.slr);
                row.AddCell(rowData.cbr);

                if (rowData.@static == 1)
                {
                    row.AddCell("受理人受理");
                }
                else if (rowData.@static == 2)
                {
                    row.AddCell("已分配专家");
                }
                else if (rowData.@static == 3)
                {
                    row.AddCell("专家审批完成");
                }
                else if (rowData.@static == 4)
                {
                    row.AddCell("承办人审批通过");
                }
                else if (rowData.@static == 5)
                {
                    row.AddCell("承办人审批不通过");
                }
                else if (rowData.@static == 6)
                {
                    row.AddCell("申诉复核通过");
                }
                else if (rowData.@static == 7)
                {
                    row.AddCell("申诉复核不通过");
                }
                else
                {
                    row.AddCell("");
                }

                var tbCS = repCS.GetByCondition(r => r.pid == rowData.pid).FirstOrDefault();
                if (rowData.@static >= 3)
                {
                    if (tbCS != null)
                    {
                        row.AddLinkJsCell("查看初审表", "Detail(\"{0}\")".Fmt(tbCS.id));
                    }
                    else
                    {
                        row.AddLinkJsCell("填写初审表", "FillIn(\"{0}\")".Fmt(rowData.pid));
                    }
                }
                else
                {
                    row.AddCell(string.Empty);
                }

                if (rowData.@static == 3)
                {
                    if (HaveButtonFromAll(buttons, "Approval") && tbCS != null)
                    {
                        row.AddLinkJsCell("审批", "Approval(\"{0}\",\"{1}\")".Fmt(rowData.id, rowData.pid));
                    }
                    else
                    {
                        row.AddCell(string.Empty);
                    }
                }
                else if (rowData.@static == 5)
                {
                    row.AddLinkJsCell("查看原因", "Reason(\"{0}\")".Fmt(rowData.outstaticinfo));
                }


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

            return(Content(str, "text/xml"));
        }
        public ActionResult SearchImport(ApplyQualifySevenSearchModel model)
        {
            DhtmlxGrid grid      = new DhtmlxGrid();
            var        precadite = PredicateBuilder.True <t_bp_Equipment>();

            precadite = precadite.And(r => r.approvalstatus == "3");
            if (!model.CustomId.IsNullOrEmpty())
            {
                precadite = precadite.And(tt => tt.customid == model.CustomId.Trim());
            }
            int pos   = model.posStart.HasValue ? model.posStart.Value : 0;
            int count = model.count.HasValue ? model.count.Value : 30;

            var paging = new PagingOptions <t_bp_Equipment>(pos, count, t => t.id);

            var datas = equipRep.GetByConditonPage(precadite, paging);

            var totalCount = (int)paging.TotalItems;

            grid.AddPaging(totalCount, pos);

            var index     = 1;
            var allcustom = checkUnitService.GetAllCheckUnit();


            foreach (var item in datas)
            {
                string dateStr = string.Empty;
                if (item.checkenddate.HasValue && item.checkstartdate.HasValue)
                {
                    dateStr = GetUIDtString(item.checkstartdate, "yyyy-MM-dd") + "~" + GetUIDtString(item.checkenddate, "yyyy-MM-dd");
                }
                if (item.repairstartdate.HasValue && item.repairenddate.HasValue)
                {
                    dateStr = GetUIDtString(item.repairstartdate, "yyyy-MM-dd") + "~" + GetUIDtString(item.repairenddate, "yyyy-MM-dd");
                }

                DhtmlxGridRow row = new DhtmlxGridRow(item.id);
                row.AddCell(string.Empty);
                row.AddCell(index++);
                row.AddCell(item.equnum);
                row.AddCell(item.EquName + "/" + item.equtype + "/" + item.equspec);
                row.AddCell(item.testrange);
                row.AddCell(item.degree + "/" + item.uncertainty);
                row.AddCell(checkUnitService.GetCheckUnitByIdFromAll(allcustom, item.customid));
                row.AddCell(item.checkunit.IsNullOrEmpty() ? item.repairunit : item.checkunit);
                row.AddCell(dateStr);
                if (item.repairenddate.HasValue || item.checkenddate.HasValue)
                {
                    var datee    = item.repairenddate.HasValue ? item.repairenddate : item.checkenddate;
                    var dateDiff = datee.Value - DateTime.Now;
                    var totalDay = (int)dateDiff.TotalDays;
                    if (totalDay < 0)
                    {
                        row.AddCell(new DhtmlxGridCell("已经超期{0}天".Fmt(0 - totalDay), false).AddCellAttribute("style", "color:red"));
                    }
                    else
                    {
                        row.AddCell("{0}天".Fmt(totalDay));
                    }
                }
                else
                {
                    row.AddCell(string.Empty);
                }
                row.AddCell(item.checkcerfnumpath.IsNullOrEmpty()?item.repaircerfnumpath:item.checkcerfnumpath);

                row.AddCell(string.Empty);



                grid.AddGridRow(row);
            }

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

            return(Content(str, "text/xml"));
        }
Ejemplo n.º 27
0
        public ActionResult Search(ApplyQualifySearchModel searchModel)
        {
            var data = GetSearchResult(searchModel);

            DhtmlxGrid grid = new DhtmlxGrid();
            int        pos  = searchModel.posStart.HasValue ? searchModel.posStart.Value : 0;

            grid.AddPaging(data.TotalCount, pos);
            var buttons         = GetCurrentUserPathActions();
            var currentUserRole = GetCurrentUserRole();

            for (int i = 0; i < data.Results.Count; i++)
            {
                var           custom = data.Results[i];
                DhtmlxGridRow row    = new DhtmlxGridRow(custom.ID.ToString());
                row.AddCell(string.Empty);
                row.AddCell((pos + i + 1).ToString());//序号

                row.AddLinkJsCell(custom.UNITNAME + "/" + custom.NAME, "DetailQualifyOne(\"{0}\")".Fmt(custom.ID));
                row.AddLinkJsCell("[查看]", "DetailQualifyTwo(\"{0}\",\"{1}\")".Fmt(custom.ID, custom.UNITCODE));   //机构基本情况表
                row.AddLinkJsCell("[查看]", "DetailQualifyThree(\"{0}\",\"{1}\")".Fmt(custom.ID, custom.UNITCODE)); //法定代表人基本情况
                row.AddLinkJsCell("[查看]", "DetailQualifyFour(\"{0}\",\"{1}\")".Fmt(custom.ID, custom.UNITCODE));  //技术负责人基本情况
                row.AddLinkJsCell("[查看]", "DetailQualifyFive(\"{0}\")".Fmt(custom.ID));                           //检测类别、内容、具备相应注册工程师资格人员情况
                row.AddLinkJsCell("[查看]", "DetailQualifySix(\"{0}\")".Fmt(custom.ID));                            //专业技术人员情况总表
                row.AddLinkJsCell("[查看]", "DetailQualifySeven(\"{0}\",\"{1}\")".Fmt(custom.ID, custom.UNITCODE)); //主要仪器设备(检测项目)及其检定/校准一览表

                row.AddCell(custom.Type == "0" ? "新申请" : (custom.Type == "1" ? "资质增项" : "资质延续"));                 //申请类型

                //对机构进行修改后,进行审核操作
                if (HaveButtonFromAll(buttons, "Approval"))
                {
                    var ueu = repExp.GetByCondition(r => r.pid == Convert.ToInt32(custom.ID) && r.userid == GetCurrentUserId()).FirstOrDefault();
                    if (ueu != null && ueu.needUnitBuildingQualify == 1)
                    {
                        if (ueu.qualifystatus != 1)
                        {
                            row.AddLinkJsCell("[建设工程质量检测机构资质审核表]", "ApprovalUnitBuildingQualify(\"{0}\")".Fmt(custom.ID));
                        }
                        else
                        {
                            row.AddLinkJsCell("[建设工程质量检测机构资质审核表-已提交]", "DetailUnitBuildingQualify(\"{0}\",\"{1}\")".Fmt(ueu.shid, custom.ID));
                        }
                    }
                    else
                    {
                        row.AddCell(string.Empty);
                    }

                    if (ueu != null && ueu.needSpecialQualify == 1)
                    {
                        if (ueu.speicalstatus != 1)
                        {
                            row.AddLinkJsCell("[专项检测备案审核表]", "ApprovalSpecialQualify(\"{0}\")".Fmt(custom.ID));
                        }
                        else
                        {
                            row.AddLinkJsCell("[专项检测备案审核表-已提交]", "DetailSpecialQualify(\"{0}\",\"{1}\")".Fmt(ueu.scid, custom.ID));
                        }
                    }
                    else
                    {
                        row.AddCell(string.Empty);
                    }
                }
                else
                {
                    row.AddCell(string.Empty);
                }

                grid.AddGridRow(row);
            }

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

            return(Content(str, "text/xml"));
        }
Ejemplo n.º 28
0
        public ActionResult ProgrammeSecneListSearch(GetprogrammeSecneLists model)
        {
            var        client = new JsonServiceClient(GetSceneDataUrl);
            var        data   = client.Get(model);
            DhtmlxGrid grid   = new DhtmlxGrid();
            int        pos    = model.posStart.HasValue ? model.posStart.Value : 0;
            int        index  = pos;

            grid.AddPaging(data.totalCount, pos);
            foreach (var item in data.datas)
            {
                DhtmlxGridRow row = new DhtmlxGridRow(item.Id.ToString());
                row.AddCell((++index).ToString());
                row.AddCell(item.customname);
                row.AddCell(item.projectname);
                row.AddCell(item.areainfo);
                row.AddCell(item.checktype);
                if (!item.testingpeople.IsNullOrEmpty())
                {
                    var           witnesspeople = JsonConvert.DeserializeObject <List <witnesspeopleModels> >(item.testingpeople);
                    List <string> names         = new List <string>();
                    foreach (var name in witnesspeople)
                    {
                        names.Add(name.name);
                    }
                    row.AddCell(names.Join("、"));
                }
                else
                {
                    row.AddCell(string.Empty);
                }
                row.AddCell(item.structpart);
                row.AddCell(item.checknum);
                if (item.reportcount > 0)
                {
                    row.AddLinkJsCell(item.reportcount, "DetailsReport(\"{0}\",\"{1}\")".Fmt(item.checknum, item.projectnum));
                }
                else
                {
                    row.AddCell(item.reportcount);
                }
                if (item.photoid.HasValue && item.photoid != 0)
                {
                    row.AddCell("已拍照");
                }
                else
                {
                    row.AddCell("无拍照");
                }
                if (item.latitude.HasValue && item.longitude.HasValue)
                {
                    row.AddCell("有");
                }
                else
                {
                    row.AddCell("无");
                }
                if (!item.filename.IsNullOrEmpty())
                {
                    row.AddCell("是");
                }
                else
                {
                    row.AddCell("否");
                }
                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"));
        }