From 3706d8eb1e83c98d042a7e8fb450085a37a0f035 Mon Sep 17 00:00:00 2001 From: tanshu Date: Mon, 10 Nov 2014 12:54:48 +0530 Subject: [PATCH] Feature: User List Sorted. Fix: Checkes were not being removed from Listbox --- .../User Management/AssignRoleGroups.cs | 5 ++++- .../User Management/AssignUserGroups.cs | 5 ++++- Tanshu.Accounts.Repository/UserBI.cs | 7 +++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Tanshu.Accounts.PointOfSale/User Management/AssignRoleGroups.cs b/Tanshu.Accounts.PointOfSale/User Management/AssignRoleGroups.cs index 553a8b4..c7bbf11 100644 --- a/Tanshu.Accounts.PointOfSale/User Management/AssignRoleGroups.cs +++ b/Tanshu.Accounts.PointOfSale/User Management/AssignRoleGroups.cs @@ -41,7 +41,10 @@ namespace Tanshu.Accounts.PointOfSale { var roles = bi.RoleList(); clbRoles.DataSource = roles; - + for (int i = 0; i < clbRoles.Items.Count; i++) + { + clbRoles.SetItemChecked(i, false); + } if (groupID.HasValue) { var group = bi.Get(x => x.GroupID == groupID.Value); diff --git a/Tanshu.Accounts.PointOfSale/User Management/AssignUserGroups.cs b/Tanshu.Accounts.PointOfSale/User Management/AssignUserGroups.cs index c14ff2b..f99325b 100644 --- a/Tanshu.Accounts.PointOfSale/User Management/AssignUserGroups.cs +++ b/Tanshu.Accounts.PointOfSale/User Management/AssignUserGroups.cs @@ -47,7 +47,10 @@ namespace Tanshu.Accounts.PointOfSale { var groups = bi.GroupList(); clbGroups.DataSource = groups; - + for (int i = 0; i < clbGroups.Items.Count; i++) + { + clbGroups.SetItemChecked(i, false); + } if (userID.HasValue) { var user = bi.Get(x => x.UserID == userID.Value); diff --git a/Tanshu.Accounts.Repository/UserBI.cs b/Tanshu.Accounts.Repository/UserBI.cs index d688612..dbf981b 100644 --- a/Tanshu.Accounts.Repository/UserBI.cs +++ b/Tanshu.Accounts.Repository/UserBI.cs @@ -9,6 +9,13 @@ namespace Tanshu.Accounts.Repository { public class UserBI : UnitOfWork { + public new IList List() + { + return _session.QueryOver() + .OrderBy(x => x.Name).Asc + .List(); + } + public IList GroupList() { return _session.QueryOver()