• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can you explain

 
spars anu
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public NoteEntity CreatePlayerNote(NoteEntity note)
{
IsolationLevel isolationLevel = IsolationLevel.ReadCommitted;
if (note.NoteType == NoteType.ALERT)
{
isolationLevel = IsolationLevel.Serializable;
}

Execute(delegate(ISession session, ITransaction transaction)
{
if (note.NoteType == NoteType.ALERT)
{
ICriteria select = session.CreateCriteria(typeof(NoteEntity)).Add(Expression.Eq("PlayerIx", note.PlayerIx))
.Add(Expression.Eq("NoteType", (Int32)note.NoteType));

var oldNote = select.UniqueResult<NoteEntity>();

if (oldNote != null)
{
oldNote.ActionDescription = "Alert changed from [" + oldNote.Text + "] to [" + note.Text + "] by AdminIx [" + note.AdminIx + "]";
oldNote.NoteType = NoteType.PLAYER_NOTE;
session.Update(oldNote);
}
}

session.Save(note);

}, isolationLevel);

return note;
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic