请教一个基础的问题,下面声明了一个bool型的方法Update,代码中红色部分作用是什么?为什么Cols.Count<=0返回true,它的作用?
public bool Update(String TableName,Hashtable Cols,String Where)
{
int Count = 0;
if (Cols.Count<=0)
{
return true;
} String Fields = " ";
foreach(DictionaryEntry item in Cols)
{
if (Count!=0)
{
Fields += ",";
}
Fields += item.Key.ToString();
Fields += "=";
Fields += item.Value.ToString();
Count ++;
}
Fields += " "; String SqlString = "Update "+TableName+" Set "+Fields+Where; return Convert.ToBoolean(ExecuteSQL(SqlString));
}
public bool Update(String TableName,Hashtable Cols,String Where)
{
int Count = 0;
if (Cols.Count<=0)
{
return true;
} String Fields = " ";
foreach(DictionaryEntry item in Cols)
{
if (Count!=0)
{
Fields += ",";
}
Fields += item.Key.ToString();
Fields += "=";
Fields += item.Value.ToString();
Count ++;
}
Fields += " "; String SqlString = "Update "+TableName+" Set "+Fields+Where; return Convert.ToBoolean(ExecuteSQL(SqlString));
}
这个方法的意思应该是如果Cols 为空 ,说明没有地方可以更新,就是已经多是最新的了
所有返回true;
E8.HelpDesk服务管理系统是专门为服务管理领域设计的一套软件,适用于地产物业、保险服务、家电售后服 务、机械制造售后维修、IT运维和外包等各种需要提供服务运营管理的行业。本软件以客户(用户)为中心 ,以工作流为导向,以服务运营为核心,帮助您提高服务质量和服务效率,提高用户满意度。使用本软件, 您可以:轻松管理日益增多的用户资料;自定义服务流程,从用户来电请求开始,全程跟踪管理本次服务; 方便的查询功能,随时得知服务进展情况;越用越好用的知识库,提高服务台首次解决率;人性化事件提醒 ,服务提早准备;服务督办与回访,用户倍感关怀;各种分析和报表;建立现代科技呼叫中心,提升企业自 身形象…… 欢迎来电咨询:0755-82717801-2 ;0755-82717701 网址:http://www.feifanit.com.cn