判断是“Hour”否为空
public DataSet ActualHours(Guid OverTimeHeadId)
{
string sql = "SELECT OverTimeList.ActualWorkingHours, OverTimeHead.ApplyNo FROM OverTimeHead INNER JOIN OverTimeList ON OverTimeHead.OverTimeHeadId = OverTimeList.OverTimeHead " +
"where (OverTimeHead.OverTimeHeadId= '{0} ') ";
sql = string.Format(sql, OverTimeHeadId);
return new CommonData().ExeQuery(sql);
}
if (Hour != " ")
{
new OverTimeData().UpdateAndInsert(guidHeadId, StatusId, guidUserId);
GridView2Bind();
}
好像if这个语句写的不对
------解决方案--------------------Hour != " "
Hour != null
------解决方案--------------------if (Hour != " ")
====================
if (Hour != null)
------解决方案--------------------老实说,基本上没明白你的程序正确功能要实现什么。
------解决方案--------------------if (!Hour.Equals( " "))