public async void GetAllUsers() { try { gridUser.DataBindings.Clear(); SYS_tblUserDRO users = new SYS_tblUserDRO(); users = await SYS_tblUserBUS.GetAllUsers(CommonEngine.userInfo.UserID, CommonEngine.userInfo.LanguageID, new SYS_tblActionLogDTO { Activity = BaseConstant.COMMAND_INSERT_EN, UserID = CommonEngine.userInfo.UserID, LanguageID = ConfigEngine.Language, ActionEN = BaseConstant.COMMAND_LOAD_ALL_DATA_EN, ActionVN = BaseConstant.COMMAND_LOAD_ALL_DATA_VI, FunctionID = "10", DescriptionVN = string.Format("Tài khoản '{0}' vừa tải thành công dữ liệu người dùng.", CommonEngine.userInfo.UserID), DescriptionEN = string.Format("Account '{0}' downloaded successfully data of users.", CommonEngine.userInfo.UserID) }); if (!CommonEngine.CheckValidResponseItem(users.ResponseItem)) { return; } gridUser.DataSource = users.UserList; barBottom.Visible = (users != null && users.UserList.Count > 0) ? true : false; CommonEngine.LoadUserPermission("10", btnDelete, btnPrint, btnImport, btnExport); } catch (Exception ex) { CommonEngine.ShowExceptionMessage(ex); } }
private async void LoadAllGroupUser() { trlUser.ClearNodes(); try { this.Cursor = Cursors.WaitCursor; trlUser.BeginUnboundLoad(); SYS_tblGroupUserDRO groupUser = await SYS_tblGroupUserBUS.GetAllGroupUsers(CommonEngine.userInfo.UserID, ConfigEngine.Language, false, null); if (!CommonEngine.CheckValidResponseItem(groupUser.ResponseItem)) { return; } groupList = groupUser.GroupUserList; SYS_tblUserDRO users = await SYS_tblUserBUS.GetAllUsers(CommonEngine.userInfo.UserID, ConfigEngine.Language, null); if (!CommonEngine.CheckValidResponseItem(users.ResponseItem)) { return; } userList = users.UserList; foreach (var item in groupUser.GroupUserList) { groupNode = trlUser.AppendNode(new object[] { string.Format(@"{0} - {1}", item.GroupCode, item.GroupName), item.GroupID }, -1); groupNode.ImageIndex = 0; groupNode.SelectImageIndex = 0; LoadAllUser(groupNode, item.GroupID, users.UserList); } trlUser.EndUnboundLoad(); trlUser.ExpandAll(); } catch (Exception ex) { CommonEngine.ShowExceptionMessage(ex); } finally { this.Cursor = Cursors.Default; } }