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")); }
public ActionResult Search() { DhtmlxGrid grid = new DhtmlxGrid(); Dictionary <int, string> dicts = new Dictionary <int, string>(); dicts.Add(1, "机构名称缓存"); dicts.Add(2, "检测项目名称缓存"); dicts.Add(3, "模块缓存"); dicts.Add(4, "按钮缓存"); dicts.Add(5, "角色缓存"); dicts.Add(6, "用户地区缓存"); dicts.Add(7, "字典缓存"); dicts.Add(8, "地区缓存"); //dicts.Add(9, "修改列缓存"); dicts.Add(9, "监督编号缓存"); dicts.Add(10, "二维码缓存"); foreach (var item in dicts) { DhtmlxGridRow row = new DhtmlxGridRow(item.Key.ToString()); row.AddCell(item.Key.ToString()); row.AddCell(item.Value); row.AddLinkJsCell("清除缓存", " ClearCache({0})".Fmt(item.Key)); grid.AddGridRow(row); } string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting); return(Content(str, "text/xml")); }
public ActionResult SearchGjcq(int gjId) { var gjcqDatas = gjcqRep.GetByCondition(w => w.gjid == gjId); DhtmlxGrid grid = new DhtmlxGrid(); if (gjcqDatas.Count > 0) { int index = 0; foreach (var item in gjcqDatas) { DhtmlxGridRow row = new DhtmlxGridRow(Guid.NewGuid().ToString()); row.AddCell((++index).ToString()); row.AddCell(item.cqno); row.AddLinkJsCell("详情", "gjcqView(\"{0}\",\"{1}\")".Fmt(item.gjid, item.id)); grid.AddGridRow(row); } grid.Header = new DhtmlxGridHeader(); grid.Header.AddColumn(new DhtmlxGridColumn("测区") { ColumnType = "ro", Width = "*", ColumnSort = "str" }); grid.Header.AddColumn(new DhtmlxGridColumn("") { ColumnType = "jslink", Width = "150", ColumnSort = "str" }); } string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting); return(Content(str, "text/xml")); }
public ActionResult DetailsReport(string checknum, string projectnum) { GetReports model = new GetReports() { checknum = checknum, projectnum = projectnum, }; var client = new JsonServiceClient(GetSceneDataUrl); var data = client.Get(model); DhtmlxGrid grid = new DhtmlxGrid(); int index = 1; foreach (var item in data.Reports) { DhtmlxGridRow row = new DhtmlxGridRow(item.Id.ToString()); row.AddCell(index++); row.AddCell(item.checknum); row.AddCell(item.reportnum); row.AddLinkJsCell("查看", "Details(\"{0}\",\"{1}\")".Fmt(item.customid, item.reportnum)); grid.AddGridRow(row); } string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting); return(Content(str, "text/xml")); }
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 GetProgrammeReports(string checknum, string projectnum) { DhtmlxGrid grid = new DhtmlxGrid(); GetProgrammeReports request = new GetProgrammeReports() { checknum = checknum, projectnum = projectnum }; var client = new JsonServiceClient(GetSceneDataUrl); var response = client.Get(request); var index = 1; if (response.IsSucc) { foreach (var item in response.reports) { DhtmlxGridRow row = new DhtmlxGridRow(item.Id); row.AddCell(index++); row.AddCell(item.checknum); row.AddCell(item.reportnum); row.AddLinkJsCell("查看", "Details(\"{0}\",\"{1}\")".Fmt(item.customid, item.reportnum)); 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")); }
public ActionResult GetPileDataList(string checknum, string customid) { DhtmlxGrid grid = new DhtmlxGrid(); var client = new JsonServiceClient(GetSceneDataUrl); var response = client.Get(new TestSiteDetails() { CheckNum = checknum, CustomId = customid, IsTesting = 0 }); if (response.IsSucc) { foreach (var item in response.datas) { DhtmlxGridRow row = new DhtmlxGridRow(item.Id); row.AddCell(item.projectname); row.AddCell(item.TestType); row.AddCell(item.PileNo); row.AddCell(GetUIDtString(item.StartTime)); row.AddCell(GetUIDtString(item.CreateTime)); row.AddCell(string.Empty); row.AddCell(item.MachineId); row.AddCell(item.GpsIsValid == 1 ? new DhtmlxGridCell("已定位", false).AddCellAttribute("style", "color:green") : new DhtmlxGridCell("未定位", false).AddCellAttribute("style", "color:red")); row.AddCell(string.Empty);//修改记录找不到字段和判断方法,先设置为空 if (item.nn > 0) { if (item.nn >= 6) { row.AddCell(new DhtmlxGridCell("有照片", false).AddCellAttribute("style", "color:green")); } else { row.AddCell(new DhtmlxGridCell("不完整({0})".Fmt(item.nn), false).AddCellAttribute("style", "color:red")); } } else { row.AddCell(new DhtmlxGridCell("无照片", false).AddCellAttribute("style", "color:red")); } row.AddLinkJsCell("查看", "detailsUpload(\"{0}\",\"{1}\",\"{2}\")".Fmt(item.Id, item.checknum, item.PileNo)); grid.AddGridRow(row); } } string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting); return(Content(str, "text/xml")); }
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(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")); }
private static string GetGridXmlString(List <Path> paths, List <Pkpm.Entity.Action> actions) { DhtmlxGrid grid = new DhtmlxGrid(); foreach (var item in paths.OrderBy(p => p.OrderNo)) { DhtmlxGridRow row = new DhtmlxGridRow(item.Id.ToString()); row.AddCell(item.Name); row.AddCell(item.Url); row.AddCell(item.OrderNo.ToString()); row.AddCell(item.Status.ToString()); row.AddLinkJsCell("按钮", "actionInPath({0})".Fmt(item.Id.ToString())); row.AddCell(new DhtmlxGridCell("编辑", false).AddCellAttribute("title", "编辑")); row.AddCell(new DhtmlxGridCell("删除", false).AddCellAttribute("title", "删除")); var pathActions = actions.Where(a => a.PathId == item.Id).ToList(); foreach (var pathAction in pathActions) { DhtmlxGridRow actionRow = new DhtmlxGridRow(string.Format("Action,{0}", pathAction.Id)); actionRow.AddCell(pathAction.Name); actionRow.AddCell(pathAction.Url); actionRow.AddCell(string.Empty); actionRow.AddCell(pathAction.Status.ToString()); actionRow.AddCell(string.Empty); actionRow.AddCell(new DhtmlxGridCell("编辑", false).AddCellAttribute("title", "编辑")); actionRow.AddCell(new DhtmlxGridCell("删除", false).AddCellAttribute("title", "删除")); row.AddRow(actionRow); } grid.AddGridRow(row); } return(grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting)); }
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")); }
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")); }
public ActionResult Searchgj(HTYGjSearchModel model) { int pos = model.posStart.HasValue ? model.posStart.Value : 0; int count = model.count.HasValue ? model.count.Value : 30; int pageSize = pos * count; DhtmlxGrid grid = new DhtmlxGrid(); var Datas = zjSvc.GetHTYGjData(model); if (Datas.Count > 0) { var tjjdSysDict = sysDictService.GetDictsByKey("TJJD"); var jzmSysDict = sysDictService.GetDictsByKey("JZM"); var bsfsSysDict = sysDictService.GetDictsByKey("BSFS"); var allInsts = checkUnitServce.GetAllCheckUnit(); int index = 0; foreach (var item in Datas) { DhtmlxGridRow row = new DhtmlxGridRow(item.id.ToString()); //row.AddCell("/ZNHTY/SearchGjcq?gjId={0}".Fmt(item.id)); row.AddCell((pageSize + (++index)).ToString()); row.AddCell(checkUnitServce.GetCheckUnitByIdFromAll(allInsts, item.unitcode)); row.AddCell(item.PROJECTNAME); row.AddCell(item.checknum); row.AddCell(item.gjNo); row.AddCell(item.gjName); row.AddCell(item.gjcqNum); if (item.tjjd.HasValue) { row.AddCell(SysDictUtility.GetKeyFromDic(tjjdSysDict, item.tjjd.ToString())); } else { row.AddCell(""); } if (item.jzm.HasValue) { row.AddCell(SysDictUtility.GetKeyFromDic(jzmSysDict, item.jzm.ToString())); } else { row.AddCell(""); } if (item.bsfs.HasValue) { row.AddCell(SysDictUtility.GetKeyFromDic(bsfsSysDict, item.bsfs.ToString())); } else { row.AddCell(""); } row.AddCell(item.cqqxNo); row.AddCell(item.thms.HasValue ? item.thms.Value.ToString() : ""); row.AddCell(GetUIDtString(item.checkTime)); row.AddCell(item.htyNo); var imgcount = item.imgcount.HasValue ? item.imgcount.Value : 0; if (imgcount > 0) { row.AddLinkJsCell(imgcount.ToString(), "showimg(\"{0}\",\"{1}\")".Fmt(item.checknum, item.gjNo)); } else { row.AddCell("0"); } 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(TotalStatisSearchModel model) { var response = GetResult(model); DhtmlxGrid grid = new DhtmlxGrid(); if (response.IsValid) { var buckets = response.Aggs.Terms("CUSTOMID").Buckets; var allInsts = checkUnitService.GetAllCheckUnit(); int i = 1; foreach (var bucket in buckets) { DhtmlxGridRow row = new DhtmlxGridRow(bucket.Key); string unqualiCount = string.Empty; string modifyCount = string.Empty; string AcsCount = string.Empty; var unqualiBucket = bucket.Terms(UnQualiKey); var modifyBucket = bucket.Terms <int>(ModifyKey); var AcsBucket = bucket.Terms <int>(AcsKey); var customId = bucket.Key; var totalCount = bucket.DocCount; foreach (var item in unqualiBucket.Buckets) { if (item.Key.ToString() == "N") { unqualiCount = item.DocCount.ToString(); } } foreach (var item in modifyBucket.Buckets) { if (item.Key.ToString() == "1") { modifyCount = item.DocCount.ToString(); } } foreach (var item in AcsBucket.Buckets) { if (item.Key.ToString() == "1") { AcsCount = item.DocCount.ToString(); } } row.AddCell(i.ToString()); var customName = checkUnitService.GetCheckUnitByIdFromAll(allInsts, customId); row.AddCell(customName); row.AddCell(totalCount.ToString()); if (unqualiCount.IsNullOrEmpty()) { row.AddCell("0"); } else { row.AddLinkJsCell(unqualiCount, "unqualiKeyGrid(\"{0}\",\"{1}\")".Fmt(customId, customName)); } if (modifyCount.IsNullOrEmpty()) { row.AddCell("0"); } else { row.AddLinkJsCell(modifyCount, "modifyKeyGrid(\"{0}\",\"{1}\")".Fmt(customId, customName)); } if (AcsCount.IsNullOrEmpty()) { row.AddCell("0"); } else { row.AddLinkJsCell(AcsCount, "AcsKeyGrid(\"{0}\",\"{1}\")".Fmt(customId, customName)); } grid.AddGridRow(row); i++; } } string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting); return(Content(str, "text/xml")); }
public ActionResult Search(CheckStatisDataSearchModel model) { List <CheckStatisDataSearchResultModel> resultmodel = GetSearchData(model); DhtmlxGrid grid = new DhtmlxGrid(); var allInsts = checkUnitService.GetAllCheckUnit(); int index = 1; string customName = string.Empty; foreach (var item in resultmodel) { if (item.CustomId.IsNullOrEmpty()) { continue; } DhtmlxGridRow row = new DhtmlxGridRow(item.CustomId); row.AddCell(index++); row.AddCell(checkUnitService.GetCheckUnitByIdFromAll(allInsts, item.CustomId)); if (item.DayCount > 0) { row.AddLinkJsCell(item.DayCount, "Details(\"{0}\",\"{1}\")".Fmt(item.CustomId, 0)); } else { row.AddCell(item.DayCount); } if (item.WeekCount > 0) { row.AddLinkJsCell(item.WeekCount, "Details(\"{0}\",\"{1}\")".Fmt(item.CustomId, 1)); } else { row.AddCell(item.WeekCount); } if (item.MonthCount > 0) { row.AddLinkJsCell(item.MonthCount, "Details(\"{0}\",\"{1}\")".Fmt(item.CustomId, 2)); } else { row.AddCell(item.MonthCount); } if (item.QuarterCount > 0) { row.AddLinkJsCell(item.QuarterCount, "Details(\"{0}\",\"{1}\")".Fmt(item.CustomId, 3)); } else { row.AddCell(item.QuarterCount); } if (item.YearCount > 0) { row.AddLinkJsCell(item.YearCount, "Details(\"{0}\",\"{1}\")".Fmt(item.CustomId, 4)); } else { row.AddCell(item.YearCount); } if (item.TotalCount > 0) { row.AddLinkJsCell(item.TotalCount, "Details(\"{0}\",\"{1}\")".Fmt(item.CustomId, 5)); } else { row.AddCell(item.TotalCount); } //row.AddCell(item.YearCount); //row.AddCell(item.TotalCount); grid.AddGridRow(row); } string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting); return(Content(str, "text/xml")); }
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")); }
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")); }
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 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")); }
/// <summary> /// 根据机构分组统计之后,塞到对应的地区中 /// </summary> /// <param name="model"></param> /// <returns></returns> public ActionResult Search(SysSearchModel model) { model.GroupType = "Custom"; var response = GetStatisData(model); DhtmlxGrid grid = new DhtmlxGrid(); /* * 1.查出所有报告数量以及分组统计不合格报告数量 * 2.countByArea 存储该地区报告总数 * 3.需要一个存储该地区所有不合格报告数量 * 4.存储改地区所有有不合格报告数量的厂家 厂家总数 * */ if (response.IsValid) { var bucks = response.Aggs.Terms("Custom").Buckets; Dictionary <string, int> countByArea, unQualifyCount, countUnitByArea, unQualifyUnitCountByArea; GetSearchResult(bucks, out countByArea, out unQualifyCount, out countUnitByArea, out unQualifyUnitCountByArea); var allAreas = AreaService.GetAllArea(); /* * 1.从所有的地区中选择名字相对应的地区,判断是否为市级节点,是直接加入,不是的话需要判断本节点所属的市级节点是否存在,如果存在直接加上,不存在则增加一条数值为0的记录 */ var index = 1; var rootAreas = new List <AreaResultModel>(); var childAreas = new List <AreaResultModel>(); foreach (var item in countByArea) { if (item.Key.IsNullOrEmpty()) { continue; } var unQualifyCountRow = 0; var unitCountByArea = 0; var unqualifyUnitCount = 0; var isUnqualify = unQualifyCount.TryGetValue(item.Key, out unQualifyCountRow); //isUnqualify 标识是否有不合格报告 var isUnitCount = countUnitByArea.TryGetValue(item.Key, out unitCountByArea); var isUnqualifyUnitCount = unQualifyUnitCountByArea.TryGetValue(item.Key, out unqualifyUnitCount); List <t_bp_area> areas = new List <t_bp_area>(); var areass = allAreas.Where(t => t.AREANAME == item.Key); if (areass != null) { areas = areass.ToList(); } if (areas != null && areas.Count > 0) { var area = areas.First(); logger.Debug("areasfirst"); AreaResultModel areaResult = new AreaResultModel() { AreaCode = area.AREACODE, ParentCode = area.PAREACODE, Name = area.AREANAME, TotalCount = (int)item.Value, UnqualifuCount = unQualifyCountRow, FactoryCount = unitCountByArea, UnqualifyFactoryCount = unqualifyUnitCount }; if (area.PAREACODE == "45")//市 { GetRootAreaResult(rootAreas, area, areaResult, areaResult); } else //市辖区,县等 { childAreas.Add(areaResult); var parentCode = area.PAREACODE; if (parentCode != null) { List <t_bp_area> parentAreas = new List <t_bp_area>(); var parentAreass = allAreas.Where(t => t.AREACODE == parentCode); if (parentAreass != null) { parentAreas = parentAreass.ToList(); } if (parentAreas != null && parentAreas.Count > 0) { var parentArea = parentAreas.First(); //获得所属市地区信息 AreaResultModel parentareaResult = new AreaResultModel() { AreaCode = parentArea.AREACODE, Name = parentArea.AREANAME, TotalCount = 0, UnqualifuCount = 0, FactoryCount = 0, UnqualifyFactoryCount = 0 }; GetRootAreaResult(rootAreas, parentArea, areaResult, parentareaResult); } } } } } foreach (var item in rootAreas) { DhtmlxGridRow row = new DhtmlxGridRow(item.AreaCode); row.AddCell(index++); row.AddCell(item.Name); row.AddCell(item.TotalCount); row.AddCell(item.UnqualifuCount); row.AddCell(item.TotalCount == 0 ? "0" : Math.Round(((item.UnqualifuCount * 1.00 / item.TotalCount) * 100), 2).ToString() + "%"); row.AddCell(item.FactoryCount); row.AddCell(item.UnqualifyFactoryCount); row.AddCell(item.FactoryCount == 0 ? "0" : Math.Round(((item.UnqualifyFactoryCount * 1.00 / item.FactoryCount) * 100), 2).ToString() + "%"); row.AddCell(string.Empty); //同比 row.AddCell(string.Empty); //环比 if (item.TotalCount > 0) { row.AddLinkJsCell("详情查看", "showItemKeyGrid(\"{0}\")".Fmt(item.Name)); } List <AreaResultModel> thisChildAreas = new List <AreaResultModel>(); var thisChildAreass = childAreas.Where(t => t.ParentCode == item.AreaCode); if (thisChildAreass != null) { thisChildAreas = thisChildAreass.ToList(); } if (thisChildAreas != null && thisChildAreas.Count > 0) { var childIndex = 1; foreach (var childItem in thisChildAreas) { DhtmlxGridRow childRow = new DhtmlxGridRow(childItem.AreaCode); childRow.AddCell(childIndex++); childRow.AddCell(childItem.Name); childRow.AddCell(childItem.TotalCount); childRow.AddCell(childItem.UnqualifuCount); childRow.AddCell(childItem.TotalCount == 0 ? "0" : Math.Round(((childItem.UnqualifuCount * 1.00 / childItem.TotalCount) * 100), 2).ToString() + "%"); childRow.AddCell(childItem.FactoryCount); childRow.AddCell(childItem.UnqualifyFactoryCount); childRow.AddCell(childItem.FactoryCount == 0 ? "0" : Math.Round(((childItem.UnqualifyFactoryCount * 1.00 / childItem.FactoryCount) * 100), 2).ToString() + "%"); childRow.AddCell(string.Empty); //同比 childRow.AddCell(string.Empty); //环比 if (childItem.UnqualifuCount > 0) //有不合格报告才显示详情查看 { //TODO 由于改了实现方式,将市辖区,县的信息塞到了市中,在不合格详情查看时需要增加如果是市,则需要查本市所有的不合格数据 childRow.AddLinkJsCell("详情查看", "showItemKeyGrid(\"{0}\")".Fmt(childItem.Name)); } row.AddRow(childRow); } } grid.AddGridRow(row); } //foreach (var item in countByArea) //{ // var unQualifyCountRow = 0; // var unitCountByArea = 0; // var unqualifyUnitCount = 0; // var isUnqualify = unQualifyCount.TryGetValue(item.Key, out unQualifyCountRow); //isUnqualify 标识是否有不合格报告 // var isUnitCount = countUnitByArea.TryGetValue(item.Key, out unitCountByArea); // var isUnqualifyUnitCount = unQualifyUnitCountByArea.TryGetValue(item.Key, out unqualifyUnitCount); // DhtmlxGridRow row = new DhtmlxGridRow(item.Key); // row.AddCell(index++); // row.AddCell(item.Key); // row.AddCell(item.Value); // row.AddCell(isUnqualify ? unQualifyCountRow : 0); // row.AddCell(item.Value == 0 ? "0" : Math.Round(((unQualifyCountRow * 1.00 / item.Value) * 100), 2).ToString() + "%"); // row.AddCell(unitCountByArea.ToString()); // row.AddCell(unqualifyUnitCount.ToString()); // row.AddCell(unitCountByArea == 0 ? "0" : Math.Round(((unqualifyUnitCount * 1.00 / unitCountByArea) * 100), 2).ToString() + "%"); // row.AddCell(string.Empty);//同比 // row.AddCell(string.Empty);//环比 // if (isUnqualify)//有不合格报告才显示详情查看 // { // row.AddLinkJsCell("详情查看", "showItemKeyGrid(\"{0}\")".Fmt(item.Key)); // } // grid.AddGridRow(row); //} } string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting); return(Content(str, "text/xml")); }
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")); }
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")); }