Exemplo n.º 1
0
 public ActionResult SearchProgrammeSecneList(GetprogrammeSecneLists model)
 {
     return(View());
 }
Exemplo n.º 2
0
        public ActionResult ProgrammeSecneListSearch(GetprogrammeSecneLists model)
        {
            var        client = new JsonServiceClient(GetSceneDataUrl);
            var        data   = client.Get(model);
            DhtmlxGrid grid   = new DhtmlxGrid();
            int        pos    = model.posStart.HasValue ? model.posStart.Value : 0;
            int        index  = pos;

            grid.AddPaging(data.totalCount, pos);
            foreach (var item in data.datas)
            {
                DhtmlxGridRow row = new DhtmlxGridRow(item.Id.ToString());
                row.AddCell((++index).ToString());
                row.AddCell(item.customname);
                row.AddCell(item.projectname);
                row.AddCell(item.areainfo);
                row.AddCell(item.checktype);
                if (!item.testingpeople.IsNullOrEmpty())
                {
                    var           witnesspeople = JsonConvert.DeserializeObject <List <witnesspeopleModels> >(item.testingpeople);
                    List <string> names         = new List <string>();
                    foreach (var name in witnesspeople)
                    {
                        names.Add(name.name);
                    }
                    row.AddCell(names.Join("、"));
                }
                else
                {
                    row.AddCell(string.Empty);
                }
                row.AddCell(item.structpart);
                row.AddCell(item.checknum);
                if (item.reportcount > 0)
                {
                    row.AddLinkJsCell(item.reportcount, "DetailsReport(\"{0}\",\"{1}\")".Fmt(item.checknum, item.projectnum));
                }
                else
                {
                    row.AddCell(item.reportcount);
                }
                if (item.photoid.HasValue && item.photoid != 0)
                {
                    row.AddCell("已拍照");
                }
                else
                {
                    row.AddCell("无拍照");
                }
                if (item.latitude.HasValue && item.longitude.HasValue)
                {
                    row.AddCell("有");
                }
                else
                {
                    row.AddCell("无");
                }
                if (!item.filename.IsNullOrEmpty())
                {
                    row.AddCell("是");
                }
                else
                {
                    row.AddCell("否");
                }
                row.AddCell(new DhtmlxGridCell("[查看]", false).AddCellAttribute("title", "查看"));
                grid.AddGridRow(row);
            }
            string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting);

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