public async Task GetAllGroupUsers() { try { gridGroupUser.DataBindings.Clear(); SYS_tblGroupUserDRO list = await SYS_tblGroupUserBUS.GetAllGroupUsers(CommonEngine.userInfo.UserID, CommonEngine.userInfo.LanguageID, false, 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 = "9", DescriptionVN = string.Format("Tài khoản '{0}' vừa tải thành công dữ liệu nhóm người dùng.", CommonEngine.userInfo.UserID), DescriptionEN = string.Format("Account '{0}' downloaded successfully data of group users.", CommonEngine.userInfo.UserID) }); if (!CommonEngine.CheckValidResponseItem(list.ResponseItem)) { return; } gridGroupUser.DataSource = list.GroupUserList; barBottom.Visible = (list != null && list.GroupUserList.Count > 0) ? true : false; CommonEngine.LoadUserPermission("9", 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; } }