public List <ColItem> GetColItemList(string name) { RoadFlow.Data.Model.QueryDesign Display = new RoadFlow.Platform.QueryDesign().Get(name, RoadFlow.Platform.UsersBLL.CurrentUserID); List <ColItem> lst = Display.DisplayItem.IsNullOrEmpty() == true ? null : Display.DisplayItem.JsonConvertModel <List <ColItem> >(); if (!lst.IsNullObj()) { //删除没有标题的字段项目 lst.RemoveAll(x => x.value.IsNullOrEmpty()); lst.OrderBy(p => p.sortid); } return(lst); }
/// <summary> /// 获取配置信息 /// </summary> /// <returns></returns> public List <ColItem> GetColItemList() { QueryDesign Display = new RoadFlow.Platform.QueryDesign().Get("楼栋综合查询", RoadFlow.Platform.UsersBLL.CurrentUserID); List <ColItem> lst = Display.DisplayItem.IsNullOrEmpty() == true ? null : Display.DisplayItem.JsonConvertModel <List <ColItem> >(); if (!lst.IsNullObj()) { //删除没有标题的字段项目 lst.RemoveAll(x => x.value.IsNullOrEmpty()); //显示排序 lst.Sort(new myComparer()); } return(lst); }
/// <summary> /// 导出前的预处理 /// </summary> /// <param name="dt"></param> /// <param name="name">查询配置列表显示名称</param> /// <returns></returns> public static DataTable ExportExcelPreByName(this DataTable dt, string name) { #region 导出列 Dictionary <string, string> fields = new Dictionary <string, string>(); List <ColItem> colItemList = new RoadFlow.Platform.QueryDesign().GetColItemList(name); foreach (var item in colItemList) { if (item.chk == true) { fields.Add(item.id, item.value); } } #endregion return(dt.ToNewDataTable(fields)); }
public ActionResult Index(FormCollection collection) { string name = string.Empty; ViewBag.Query1 = string.Format("&appid={0}&tabid={1}", Request.QueryString["appid"], Request.QueryString["tabid"]); RoadFlow.Platform.QueryDesign queryDesign = new RoadFlow.Platform.QueryDesign(); IEnumerable <RoadFlow.Data.Model.QueryDesign> queryDesignList; if (collection != null) { if (!Request.Form["DeleteBut"].IsNullOrEmpty()) { string ids = Request.Form["checkbox_app"]; foreach (string id in ids.Split(',')) { Guid bid; if (!id.IsGuid(out bid)) { continue; } queryDesign.Delete(bid); } } queryDesignList = queryDesign.GetAll(); if (!Request.Form["Search"].IsNullOrEmpty()) { name = Request.Form["Name"]; if (!name.IsNullOrEmpty()) { queryDesignList = queryDesignList.Where(p => p.Name.IndexOf(name) >= 0); } } } else { queryDesignList = queryDesign.GetAll(); } ViewBag.Name = name; return(View(queryDesignList)); }