Пример #1
0
        public ActionResult gjcqDetails(int gjid)
        {
            HTYGjSearchModel model = new HTYGjSearchModel {
                gjid = gjid
            };
            var Datas    = zjSvc.GetHTYGjData(model);
            var SubDatas = gjcqRep.GetByCondition(w => w.gjid == gjid);
            HTYGjcqDetailViewModel viewModel = new HTYGjcqDetailViewModel();

            if (Datas != null && Datas.Count > 0)
            {
                var Data              = Datas.First();
                var tjjdSysDict       = sysDictService.GetDictsByKey("TJJD");
                var jzmSysDict        = sysDictService.GetDictsByKey("JZM");
                var bsfsSysDict       = sysDictService.GetDictsByKey("BSFS");
                HTYGjDTOViewModel Dto = Data.ConvertTo <HTYGjDTOViewModel>();
                if (Data.tjjd.HasValue)
                {
                    Dto.tjjd = SysDictUtility.GetKeyFromDic(tjjdSysDict, Data.tjjd.ToString());
                }
                if (Data.jzm.HasValue)
                {
                    Dto.jzm = SysDictUtility.GetKeyFromDic(jzmSysDict, Data.jzm.ToString());
                }
                if (Data.bsfs.HasValue)
                {
                    Dto.bsfs = SysDictUtility.GetKeyFromDic(bsfsSysDict, Data.bsfs.ToString());
                }
                viewModel.Data     = Dto;
                viewModel.SubDatas = SubDatas;
            }

            return(View(viewModel));
        }
Пример #2
0
        public ActionResult ModifyRecordDetails(string key)
        {
            ModifyRecordDetailsModel viewModel = new ModifyRecordDetailsModel()
            {
                ModifyDetailsModel = new List <Models.TotalSearchQuestionModel>()
            };
            var questionResponse = questionESRep.Search(s => s.Index("sh-t-bp-subitem").From(0).Size(50).Query(q => q.
                                                                                                               Bool(b => b.Filter(f => f.Term(ft => ft.Field(ftf => ftf.QUESTIONPRIMARYKEY).Value(key))))));

            List <TotalSearchQuestionModel> model = new List <TotalSearchQuestionModel>();

            if (questionResponse.IsValid)
            {
                var questionTypes = sysDictService.GetDictsByKey("questionTypes");

                int index = 1;
                foreach (var item in questionResponse.Documents)
                {
                    TotalSearchQuestionModel oneModel = new TotalSearchQuestionModel();
                    oneModel.index          = index.ToString();
                    oneModel.RecordTime     = GetUIDtString(item.RECORDTIME, "yyyy-MM-dd HH:mm:ss");
                    oneModel.RecordingPhase = RenderSampleDisposePhase(item.RECORDINGPHASE);
                    oneModel.QuestionType   = SysDictUtility.GetKeyFromDic(questionTypes, item.QUESTIONTYPES);
                    oneModel.Context        = item.CONTEXT;
                    oneModel.RecordMan      = item.RECORDMAN;
                    model.Add(oneModel);
                    index++;
                }
            }
            viewModel.ModifyDetailsModel = model;
            return(View(viewModel));
        }
Пример #3
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"));
        }
Пример #4
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"));
        }
        public ActionResult CreateQualifySixSearch(DetailQualifyFiveSearchModel model)
        {
            var instDicts       = checkUnitService.GetAllCheckUnit();
            var workStatus      = sysDictServcie.GetDictsByKey("workStatus");
            var personnelTitles = sysDictServcie.GetDictsByKey("personnelTitles");
            var personnelStatus = sysDictServcie.GetDictsByKey("personnelStatus");
            var unitcode        = repOne.GetById(model.pid);
            var peoples         = peopleRep.GetByCondition(r => r.Customid == unitcode.unitCode && r.Approvalstatus == "3");
            //var peoples = peopleRep.GetByCondition(r => r.Customid == "1900021");
            DhtmlxGrid grid       = new DhtmlxGrid();
            string     customname = string.Empty;
            int        pos        = model.posStart.HasValue ? model.posStart.Value : 0;
            int        index      = pos;

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

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

            return(Content(str, "text/xml"));
        }
Пример #7
0
        public ActionResult Details(string id)
        {
            STReportDetailViewModel model = new Models.STReportDetailViewModel()
            {
                acsTimeModel     = new List <TotalSearchAcsTimeModel>(),
                commonReprtModel = new List <TotalSearchCommonReportModel>(),
                modifyModel      = new List <TotalSearchModifyModel>(),
                RawMaterialModel = new List <Models.TotalSearchRawMaterialModel>()
            };
            var reportConclusion = sysDictService.GetDictsByKey("ReportConclusionCode");
            var getResponse      = rep.Get(new DocumentPath <es_t_bp_item>(id).Index("sh-tbpitem"));

            if (getResponse.IsValid && getResponse.Source != null)
            {
                model.MainItem = getResponse.Source;
                var CustomId      = model.MainItem.CUSTOMID;
                var SysPrimaryKey = model.MainItem.SYSPRIMARYKEY;
                var ItemName      = model.MainItem.ITEMNAME;
                var ReportNum     = model.MainItem.REPORTNUM;

                model.CutomName = checkUnitService.GetSTCheckUnitById(CustomId);
                model.MainItem.CONCLUSIONCODE = SysDictUtility.GetKeyFromDic(reportConclusion, model.MainItem.CONCLUSIONCODE, "/");

                es_t_bp_item item = getResponse.Source;

                if (model.MainItem.HAVEACS.HasValue && model.MainItem.HAVEACS.Value > 0)
                {
                    model.acsTimeModel = GetAcsTimeDetails(SysPrimaryKey, model.MainItem.SAMPLENUM);
                }

                model.commonReprtModel = GetCommonReportDetails(CustomId, ReportNum, ItemName, SysPrimaryKey);

                if (model.MainItem.HAVELOG.HasValue && model.MainItem.HAVELOG.Value > 0)
                {
                    model.modifyModel = GetModifyDetails(SysPrimaryKey);
                }
                model.RawMaterialModel = GetRawMaterials(SysPrimaryKey, ReportNum, ItemName, CustomId);
            }
            if (model.MainItem == null)
            {
                return(Redirect("/TBpItemCheck/NoReport"));
            }
            return(View(model));
        }
Пример #8
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"));
        }
Пример #9
0
        public ActionResult Export(SysSearchModel model, int?fileFormat)
        {
            ISearchResponse <es_t_bp_item> response = GetSearchResult(model);
            var           allItems          = itemNameService.GetAllItemName();
            var           allInsts          = checkUnitService.GetAllCheckUnit();
            var           reportConclusions = sysDictService.GetDictsByKey("ReportConclusionCode");
            bool          xlsx = (fileFormat ?? 2007) == 2007;
            ExcelExporter ee   = new ExcelExporter("监督抽检", xlsx);

            ee.SetColumnTitles("序号, 工程名称, 合格, 机构名称, 检测项目, 报告编号, 样品编号, 委托日期, 检测日期, 数据状态");
            int pos   = model.posStart.HasValue ? model.posStart.Value : 0;
            int index = pos;

            foreach (var item in response.Documents)
            {
                ExcelRow row = ee.AddRow();

                row.AddCell(index + 1);
                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.AddCell(item.REPORTNUM);
                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++;
            }
            return(File(ee.GetAsBytes(), ee.MIME, ee.FileName));
        }
Пример #10
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"));
        }
Пример #11
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"));
        }
Пример #12
0
        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"));
        }