显示数据时状态相同的情况下为什么只能显示一条数据?
什么意思?能否详细说明下?
数据库中有两条数据而显示只有一条
@小菜鸟5: 能否把代码贴一下?
@田园里的蟋蟀:
try
{
object[] os = type.GetCustomAttributes(typeof(EnumAttribute), true);
if (os!=null && os.Length > 0)
{
for (int i = 0; i < os.Length; i++)
{
EnumAttribute att = os[i] as EnumAttribute;
if (att.Mode == 1)//按需加载
_enumDatas = EnumsList.Where(item =>
{
try
{
if (att.EnumTypes.Contains(item.Type))
return true;
else
return false;
}
catch { return false; }
}).OrderBy(item => item.Type).ThenBy(item => item.Value).ToList<Dictionary_EnumsManage>();
else if (att.Mode == 2)//全部加载
_enumDatas = EnumsList.OrderBy(item=>item.Type).ThenBy(item=>item.Value).ToList<Dictionary_EnumsManage>();
}
}
}
catch (Exception e)
{
LogHelper.Log_File(string.Format("Messgae:{0} | StackTrace:{1}", e.Message, e.StackTrace),LogLevel.ERROR);
}
string guid = !String.IsNullOrWhiteSpace(context.Request["id"]) ? context.Request["id"] : String.Empty;
DataResult result = new DataResult();
result.DataEntitys = InternalDataSource;
if (!guid.Equals(String.Empty))
{
result.Success = true;
CommunityD_BasicThingsCofig data = CommunityD_BasicThingsCofig.First("select * from CommunityD_BasicThingsCofigs where id=@0", guid);
result.DataEntitys.Add("data", data);
}
else
{
result.Success = false;
result.Message = "错误的信息";
}
return result;
<tr>
<td width="80px" height="20" class="field" >行政区ID</td>
<td height="20" >{$bind name='DivisionId'$}</td>
<td width="80px" height="20" class="field" >年份</td>
<td height="20" >{$bind name='Year'$}</td>
</tr>
<tr>
<td width="80px" height="20" class="field" >总面积
平方公里</td>
<td height="20" >{$bind name='SumArea'$}</td>
<td width="80px" height="20" class="field" >人口密度
人/平方公里</td>
<td height="20" >{$bind name='PopulationDensity'$}</td>
</tr>
<tr>
<td width="80px" height="20" class="field" >总户数</td>
<td height="20" >{$bind name='SumHourseNum'$}</td>
<td width="80px" height="20" class="field" >包括街道数</td>
<td height="20" >{$bind name='StreetNum'$}</td>
</tr>
<tr>
<td width="80px" height="20" class="field" >包括乡镇数</td>
<td height="20" >{$bind name='TownNum'$}</td>
<td width="80px" height="20" class="field" >管理单位ID</td>
<td height="20" >{$bind name='ManageAgencyId'$}</td>
</tr>
<tr>
<td width="80px" height="20" class="field" >管理单位
[:Selector agency,ManageAgencyId]</td>
<td height="20" >{$bind name='ManageAgencyName'$}</td>
<td width="80px" height="20" class="field" >操作员ID</td>
<td height="20" >{$bind name='OperatorId'$}</td>
</tr>
<tr>
<td width="80px" height="20" class="field" >操作员姓名
[:Selector operator,OperatorId]</td>
<td height="20" >{$bind name='OperatorName'$}</td>
<td width="80px" height="20" class="field" >创建时间</td>
<td height="20" >{$bind name='CreateTime' format='{0:yyyy年MM月dd日}'$}</td>
</tr>
<tr>
<td width="80px" height="20" class="field" >最后更新日期</td>
<td height="20" >{$bind name='LastChangedTime' format='{0:yyyy年MM月dd日}'$}</td>
<td width="80px" height="20" class="field" >备注
[:T T]</td>
<td height="20" >{$bind name='Remark'$}</td>
</tr>
@小菜鸟5: CommunityD_BasicThingsCofig data = CommunityD_BasicThingsCofig.First("select * from CommunityD_BasicThingsCofigs where id=@0", guid);
@田园里的蟋蟀: 不明白
@小菜鸟5: 他的意思是你这个方法是 取第一条记录, First