public void UpdateRole(Role role) { using (var session = NHibernateHelper.Instance.OpenSession()) { using (var transcation = session.BeginTransaction()) { session.Update(role); transcation.Commit(); } } }
public IList<TaskDb> GeTaskDbs(Role role) { using (var session = NHibernateHelper.Instance.OpenSession()) { using (var transcation = session.BeginTransaction()) { var taskDbs = session.QueryOver<TaskDb>().Where(x => x.Role.Id == role.Id); transcation.Commit(); return taskDbs.List<TaskDb>(); } } }
public bool AddRole(Role role) { using (var session = NHibernateHelper.Instance.OpenSession()) { using (var transcation = session.BeginTransaction()) { session.Save(role); transcation.Commit(); return true; } } }
public void SetLoginRole(Role role) { LoginRole = role; }