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"));
        }
Beispiel #2
0
        public ActionResult Search(GetZjCheckGPSByArea model)
        {
            DhtmlxGrid grid = new DhtmlxGrid();

            if (model.Area.IsNullOrEmpty())
            {
                model.Area = "南宁市";
            }
            var client   = new JsonServiceClient(GetSceneDataUrl);
            var response = client.Get(model);
            int index    = 1;

            if (response.IsSucc)
            {
                foreach (var item in response.gpsPileInfo)
                {
                    DhtmlxGridRow row = new DhtmlxGridRow(index + "," + item.GpsLongitude + "," + item.GpsLatitude);
                    row.AddCell(index);
                    row.AddCell(item.projectname);
                    row.AddCell(item.SerialNo);
                    row.AddCell(item.PileNo);
                    row.AddCell(item.areaname);
                    grid.AddGridRow(row);
                    index++;
                }
            }
            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"));
        }
Beispiel #4
0
        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"));
        }
Beispiel #5
0
        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"));
        }
Beispiel #6
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"));
        }
        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"));
        }
        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(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"));
        }
Beispiel #11
0
        private static string GetGridXmlString(List <SysDict> sysDicts)
        {
            DhtmlxGrid grid = new DhtmlxGrid();

            foreach (var item in sysDicts.Where(p => p.CategoryId < 0))
            {
                DhtmlxGridRow row = new DhtmlxGridRow(item.Id);
                row.AddCell(item.Name);
                row.AddCell(item.KeyValue);
                row.AddCell("");
                row.AddCell(item.Status);
                row.AddCell(new DhtmlxGridCell("编辑", false).AddCellAttribute("title", "编辑"));
                row.AddCell(new DhtmlxGridCell("删除", false).AddCellAttribute("title", "删除"));

                foreach (var subItem in sysDicts.Where(p => p.CategoryId == item.Id))
                {
                    DhtmlxGridRow subRow = new DhtmlxGridRow(subItem.Id.ToString());
                    subRow.AddCell(subItem.Name);
                    subRow.AddCell(subItem.KeyValue);
                    subRow.AddCell(subItem.OrderNo);
                    subRow.AddCell(subItem.Status);
                    subRow.AddCell(new DhtmlxGridCell("编辑", false).AddCellAttribute("title", "编辑"));
                    subRow.AddCell(new DhtmlxGridCell("删除", false).AddCellAttribute("title", "删除"));

                    row.AddRow(subRow);
                }

                grid.AddGridRow(row);
            }

            return(grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting));
        }
Beispiel #12
0
        public ActionResult StatisUserCustomGrid(int id)
        {
            DhtmlxGrid grid        = new DhtmlxGrid();
            var        userCustoms = userCustomrep.GetByCondition(r => r.UserId == id && r.UserCustomType == UserCustomType.UserLogCustom);
            var        allInsts    = checkUnitService.GetAllCheckUnit();

            foreach (var userCustom in userCustoms)
            {
                DhtmlxGridRow row = new DhtmlxGridRow(userCustom.CustomId);
                row.AddCell(checkUnitService.GetCheckUnitByIdFromAll(allInsts, userCustom.CustomId));
                grid.AddGridRow(row);
            }

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

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

            if (response.IsValid)
            {
                int totalCount = (int)response.Total;
                grid.AddPaging(totalCount, pos);
                int index    = pos;
                var allInst  = checkUnitService.GetAllCheckUnit();
                var allItems = itemNameService.GetAllItemName();
                foreach (var item in response.Documents)
                {
                    DhtmlxGridRow row = new DhtmlxGridRow(item.SYSPRIMARYKEY);
                    row.AddCell(index + 1);
                    row.AddCell(checkUnitService.GetCheckUnitByIdFromAll(allInst, item.CUSTOMID));
                    row.AddCell(item.PROJECTNAME);

                    if (itemNameService.IsCReport(item.REPORTJXLB, item.ITEMNAME))
                    {
                        row.AddCell(item.ITEMCHNAME.IsNullOrEmpty() ?itemNameService.GetItemCNNameFromAll(allItems, item.REPORTJXLB, item.ITEMNAME) : item.ITEMCHNAME);
                    }
                    else
                    {
                        row.AddCell(item.ITEMCHNAME.IsNullOrEmpty() ?itemNameService.GetItemCNNameFromAll(allItems, item.REPORTJXLB, item.ITEMNAME) : item.ITEMCHNAME);
                    }
                    row.AddCell(GetUIDtString(item.PRINTDATE));

                    row.AddCell(item.REPORTNUM);
                    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"));
        }
Beispiel #14
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"));
        }
        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"));
        }
        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"));
        }
Beispiel #17
0
        public ActionResult ParmDetails(string id)
        {
            var        parms = rep.GetByCondition(t => t.typecode == id);
            DhtmlxGrid grid  = new DhtmlxGrid();

            for (int i = 0; i < parms.Count; i++)
            {
                var           parm = parms[i];
                DhtmlxGridRow row  = new DhtmlxGridRow(parm.Id.ToString());
                row.AddCell((i + 1).ToString());
                row.AddCell(parm.typecode);
                row.AddCell(parm.itemcode);
                row.AddCell(parm.ItemName);
                row.AddCell(parm.itemtype);

                row.AddCell(new DhtmlxGridCell("编辑", false).AddCellAttribute("title", "编辑"));
                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"));
        }
        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));
        }
Beispiel #19
0
        private string GetGridXmlString(List <Role> roles)
        {
            DhtmlxGrid grid = new DhtmlxGrid();

            int index = 1;

            foreach (var item in roles)
            {
                DhtmlxGridRow row = new DhtmlxGridRow(item.Id.ToString());
                row.AddCell(index.ToString());
                row.AddCell(item.Name);
                row.AddCell(item.Description);
                row.AddCell(item.Code);
                row.AddLinkJsCells(GetOpDicts(item.Id.ToString()));
                row.AddCell(new DhtmlxGridCell("编辑", false).AddCellAttribute("title", "编辑"));
                row.AddCell(new DhtmlxGridCell("删除", false).AddCellAttribute("title", "删除"));
                grid.AddGridRow(row);

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

            return(str);
        }
Beispiel #20
0
        public ActionResult Search()
        {
            var reportUploadResult = GetReportUploadStatis();

            DhtmlxGrid grid = new DhtmlxGrid();

            if (reportUploadResult.IsValid)
            {
                var bucks    = reportUploadResult.Aggs.Terms(aggeKey).Buckets;
                var allInsts = GetCurrentEliminateIsUerInsts();

                int index = 1;
                Dictionary <string, DateTime> dicExist = new Dictionary <string, DateTime>();
                foreach (var item in bucks)
                {
                    var tbuck = item.TopHits(tBuckKey);
                    if (tbuck != null && tbuck.Total > 0)
                    {
                        var lastItem = tbuck.Documents <es_t_bp_item>().First();
                        if (lastItem != null && lastItem.UPLOADTIME.HasValue)
                        {
                            dicExist[item.Key] = lastItem.UPLOADTIME.Value;
                        }
                    }
                }

                foreach (var custom in allInsts)
                {
                    //if (!checkUnitService.IsCanUploadUnit(custom.Key))
                    //{
                    //    continue;
                    //}

                    var currentDt = DateTime.Now;
                    if (dicExist.ContainsKey(custom.Key))
                    {
                        DhtmlxGridRow row = new DhtmlxGridRow(Guid.NewGuid().ToString());
                        row.AddCell(index.ToString());
                        row.AddCell(custom.Value);

                        var      lastDt = dicExist[custom.Key];
                        TimeSpan dtSpan = currentDt - lastDt;
                        row.AddCell(lastDt.ToString("yyyy-MM-dd HH:mm"));
                        row.AddCell("{0}天{1}小时{2}分".Fmt(dtSpan.Days, dtSpan.Hours, dtSpan.Minutes));


                        grid.AddGridRow(row);
                        index++;
                    }
                    else
                    {
                        DhtmlxGridRow row = new DhtmlxGridRow(Guid.NewGuid().ToString());
                        row.AddCell(index.ToString());
                        row.AddCell(custom.Value);

                        var lastDt = DateTime.Now.AddYears(-1);
                        var dtSpan = currentDt - lastDt;
                        row.AddCell(lastDt.ToString("yyyy-MM-dd HH:mm"));
                        row.AddCell("{0}天{1}小时{2}分".Fmt(dtSpan.Days, dtSpan.Hours, dtSpan.Minutes));


                        grid.AddGridRow(row);
                        index++;
                    }
                }
            }
            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"));
        }
        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"));
        }
Beispiel #23
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"));
        }
        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"));
        }
        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"));
        }
Beispiel #26
0
        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"));
        }
Beispiel #27
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"));
        }
Beispiel #28
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"));
        }
Beispiel #29
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 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"));
        }