static
public
int
Delete( Type type,
string
where
)
... {
ISession s = Sessions.GetSession();
ITransaction tran = null;
int rowNum = 0;
try
...{
tran = s.BeginTransaction();
rowNum = s.Delete(" from " + type.ToString() + " where " + where);
tran.Commit();
}
catch (Exception ex)
...{
tran.Rollback();
throw ex;
}
finally
...{
s.Close();
}
return rowNum;
}
... {
ISession s = Sessions.GetSession();
ITransaction tran = null;
int rowNum = 0;
try
...{
tran = s.BeginTransaction();
rowNum = s.Delete(" from " + type.ToString() + " where " + where);
tran.Commit();
}
catch (Exception ex)
...{
tran.Rollback();
throw ex;
}
finally
...{
s.Close();
}
return rowNum;
}