public static bool UpdateIsBrowse(decimal id)
{
bool IsSuccess = false;
ITransaction trans = session.BeginTransaction();
try
{
//2 修改记录
string sql = " update jkpt_oaxt_weatherforecast set Isbrowse=1 where Weatherforecastid=" + id;
ISQLQuery Query = session.CreateSQLQuery(sql).AddEntity(typeof(JkptOaxtWeatherforecast));
Query.ExecuteUpdate();
session.Flush();
trans.Commit();
//写日志
Helpers.SaveInfo("Update weatherforecast 's isbrowse Success!");
IsSuccess = true;
}
catch (Exception ex)
{
IsSuccess = false;
trans.Rollback();
//写日志
Helpers.SaveInfo("更新是否浏览失败!错误提示如下:" + ex.Message);
}
finally
{
if (session != null)
{
session.Clear();
}
}
return IsSuccess;
}
{
bool IsSuccess = false;
ITransaction trans = session.BeginTransaction();
try
{
//2 修改记录
string sql = " update jkpt_oaxt_weatherforecast set Isbrowse=1 where Weatherforecastid=" + id;
ISQLQuery Query = session.CreateSQLQuery(sql).AddEntity(typeof(JkptOaxtWeatherforecast));
Query.ExecuteUpdate();
session.Flush();
trans.Commit();
//写日志
Helpers.SaveInfo("Update weatherforecast 's isbrowse Success!");
IsSuccess = true;
}
catch (Exception ex)
{
IsSuccess = false;
trans.Rollback();
//写日志
Helpers.SaveInfo("更新是否浏览失败!错误提示如下:" + ex.Message);
}
finally
{
if (session != null)
{
session.Clear();
}
}
return IsSuccess;
}