/// <summary> /// 根据ID获取区域 /// </summary> /// <returns>区域</returns> public Area getArea_by_id(short id) { try { Area result = da.SELECT_BY_ID(id); return(result); } catch { return(null); } }
/// <summary> /// 获取区域信息 /// </summary> /// <param name="id">区域ID</param> /// <returns></returns> public Area GetArea(short id) { try { DArea da = new DArea(); return(da.SELECT_BY_ID(id)); } catch { return(null); } }
/// <summary> /// 导出报表 /// </summary> /// <param name="list">list数据</param> /// <returns>报表</returns> public DataTable Show_Report(IList <LanData> list) { try { string s0 = "区域"; string s1 = "小区名称"; string s2 = "住户量"; string s3 = "入住数量"; string s4 = "选择项1(演示)"; string s5 = "选择项2(演示)"; string s6 = "选择项3(演示)"; string s7 = "数据项1(演示)"; string s8 = "数据项2(演示)"; string s9 = "选择项3(演示)"; string s10 = "选择项4(演示)"; DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn(s0, typeof(string))); dt.Columns.Add(new DataColumn(s2, typeof(string))); dt.Columns.Add(new DataColumn(s1, typeof(string))); dt.Columns.Add(new DataColumn(s3, typeof(string))); dt.Columns.Add(new DataColumn(s4, typeof(string))); dt.Columns.Add(new DataColumn(s5, typeof(string))); dt.Columns.Add(new DataColumn(s6, typeof(string))); dt.Columns.Add(new DataColumn(s7, typeof(string))); dt.Columns.Add(new DataColumn(s8, typeof(string))); dt.Columns.Add(new DataColumn(s9, typeof(string))); dt.Columns.Add(new DataColumn(s10, typeof(string))); for (int k = 0; k < list.Count; k++) { DataRow row = dt.NewRow(); row[s0] = da.SELECT_BY_ID(list[k].AreaData).Name; row[s1] = list[k].Building; row[s2] = list[k].Building; row[s3] = list[k].Building + "%"; //row[4] = list[k].JX_DianXin; if (list[k].Isused == true) { row[s4] = "已完成(演示)"; } else { row[s4] = "未完成(演示)"; } //row[s5] = list[k].JX_LianTong; if (list[k].Isused == true) { row[s5] = "已勾选(演示)"; } else { row[s5] = "未勾选(演示)"; } //row[s6] = list[k].JX_YiDong; if (list[k].Isused == true) { row[s6] = "成功(演示)"; } else { row[s6] = "失败(演示)"; } row[s7] = list[k].Isused; row[s8] = list[k].Isused; row[s9] = list[k].Isused; if (list[k].Isused == true) { row[10] = "较差"; } else if (list[k].Isused == false) { row[s10] = "合格"; } else { row[s10] = "优秀"; } row[s10] = list[k].Building; dt.Rows.Add(row); } return(dt); } catch { return(null); } }