private void tsmiEmcee_Click(object sender, EventArgs e) { if (sender is Button) { Button tsmi = (Button)sender; UserListType ut = UserListType.findMember; UserListForm ul = new UserListForm(ut, addUser); ul.ShowDialog(); } else { ToolStripMenuItem tsmi = (ToolStripMenuItem)sender; UserListType ut = UserListType.findEmcee; if (tsmi != null && tsmi.Tag != null) { switch (Convert.ToInt32(tsmi.Tag)) { case 1: ut = UserListType.findEmcee; break; case 2: ut = UserListType.findMember; break; } } UserListForm ul = new UserListForm(ut, addUser); ul.ShowDialog(); } }
/// <summary> /// Constructor for inserting a UserList with Products into the database /// </summary> /// <param name="name"></param> /// <param name="type"></param> /// <param name="user"></param> /// <param name="products"></param> public UserList(string name, UserListType type, User user, List <Product> products) { Name = name; Type = type; User = user; Products = products; }
private UserListViewBuilder(IGetSocialNativeBridge getSocialImpl, UserListType userListType, Action <User> onUserSelected, Action onCancel) : base(getSocialImpl) { this.onUserSelected = onUserSelected; this.onCancel = onCancel; this.userListType = userListType; }
/// <summary> /// Constructor for getting a UserList out of the database. /// This cannot yet be tested due to complications with getting all the Product Data. /// </summary> /// <param name="id"></param> /// <param name="name"></param> /// <param name="type"></param> /// <param name="user"></param> // public UserList(int id, string name, UserListType type, User user, List<Product> products) // { // ID = id; // Name = name; // Type = type; // User = user; // Products = products; // } /// <summary> /// Constructor for getting a UserList out of the database for Product /// </summary> /// <param name="id"></param> /// <param name="name"></param> /// <param name="type"></param> /// <param name="user"></param> public UserList(int id, string name, UserListType type, User user) { ID = id; Name = name; Type = type; User = user; }
public UserListForm(UserListType ulistType, addUser au) { this.ulistType = ulistType; this.audelegate = au; InitializeComponent(); dt = retDataTableTest(); InitDataTable(); SetScroll(); this.FormModel = 1; }
public UserListType GetUsers(ResolveFieldContext context, int?id, int size, int offSet) { var users = _userResolvers.ResolveUsers(context, id, size, offSet, out var count); var userListType = new UserListType { Users = users, Count = count }; return(userListType); }
public void ChangeUserList(UserListType type) { _curUserlistType = type; if (_gridBankers != null) { _gridBankers.gameObject.SetActive(type == UserListType.Banker); } if (_gridusers != null) { _gridusers.gameObject.SetActive(type == UserListType.User); } }
protected virtual void RefreahAll(UserListType ult, int front = 0) { switch (ult) { case UserListType.User: { if (Players == null || Players.Length <= 0) { if (_gridusers != null) { Destroy(_gridusers.gameObject); } return; } YxWindowUtils.CreateMonoParent(GridUsersPrefab, ref _gridusers); var len = front > 0 && front < Players.Length ? front : Players.Length; for (var i = 0; i < len; i++) { var userItem = YxWindowUtils.CreateItem(UserItemPrefab, _gridusers.transform); userItem.SetInfo(Players[i]); } _gridusers.gameObject.SetActive(_curUserlistType == ult); _gridusers.Reposition(); } break; case UserListType.Banker: { if (BankersInfo == null || BankersInfo.Length <= 0) { if (_gridBankers != null) { Destroy(_gridBankers.gameObject); } return; } YxWindowUtils.CreateMonoParent(GridBankersPrefab, ref _gridBankers); var bseat = App.GetGameData <BjlGameData>().BankSeat; var len = front > 0 && front < BankersInfo.Length ? front : BankersInfo.Length; for (var i = 0; i < len; i++) { var banker = BankersInfo[i]; var userItem = YxWindowUtils.CreateItem(BankerItemPrefab, _gridBankers.transform); userItem.SetInfo(banker, banker.Seat == bseat); } _gridBankers.gameObject.SetActive(_curUserlistType == ult); _gridBankers.Reposition(); } break; } }
public ActionResult AddListType([FromBody] ListType listType) { try { var token = new ClaimPrincipal(HttpContext.User); BaseResponse response = new BaseResponse(); User user = db.User.FirstOrDefault(u => u.UserName == token.NameIdentifier); if (user == null) { response.Message = "The user not found!"; return(NotFound(response)); } //Create list type var newListType = new ListType() { CreatedDate = Utils.GetUnixTimeNow(), Description = listType.Description, ModifierBy = user.UserName, OwnerBy = user.UserName, Status = (byte)StatusType.Active, UpdatedDate = Utils.GetUnixTimeNow(), Name = listType.Name }; db.ListType.Add(newListType); db.SaveChanges(); //Create user list type var userListType = new UserListType() { ListTypeId = newListType.Id, ModifierBy = user.UserName, OwnerBy = user.OwnerBy, Status = (byte)StatusType.Active, UpdatedDate = Utils.GetUnixTimeNow(), CreatedDate = Utils.GetUnixTimeNow(), UserId = user.Id }; db.UserListType.Add(userListType); db.SaveChanges(); response.Message = "The list type added successfully"; return(Ok(response)); } catch (Exception ex) { return(StatusCode(500, ex.Message)); } }
public void ChangeUserList(UserListType type) { _curUserlistType = type; if (GridBankersPrefab != null) { GridBankersPrefab.gameObject.SetActive(type == UserListType.Banker); if (type == UserListType.Banker) { GridBankersPrefab.Reposition(); } } if (GridUsersPrefab != null) { GridUsersPrefab.gameObject.SetActive(type == UserListType.User); if (type == UserListType.User) { GridUsersPrefab.Reposition(); } } }
/// <summary> /// 添加 参与人员 /// </summary> /// <param name="uid">用户ID</param> /// <param name="nickName"></param> /// <param name="displayName">展示名称</param> /// <param name="personMsg">单位</param> /// <param name="uStatus">用户状态</param> /// <param name="pt">用户设备</param> /// <param name="headImage">用户头像</param> /// <param name="u">添加方式</param> /// <param name="personLimit">人数限制</param> public void addUser(string uid, string nickName, string displayName, string personMsg, ChatListSubItem.UserStatus uStatus, PlatformType pt, Image headImage, UserListType u,string userJid) { #region 人数限制控制 int emceeCount = meetGrouplist.ChatListBox_group.Items[0].SubItems.Count; int memberCount = meetGrouplist.ChatListBox_group.Items[1].SubItems.Count; int limit = 0; if (!string.IsNullOrEmpty(cbxPerson.Text) && cbxPerson.Text != "无限制") { limit = int.Parse(cbxPerson.Text); } if (limit!=0 && limit <= (emceeCount + memberCount)) { MessageBox.Show("参加人员已达到上线,无法继续添加。", "提示"); return; } #endregion; if (headImage != SysParams.defaultHead) { headImage = (Image)headImage.Clone(); } ChatListSubItem clsl = new ChatListSubItem(uid, nickName, displayName, personMsg, uStatus, headImage); if (u == UserListType.findEmcee) { this.meeting.EmceeJid = userJid; //主持人限定一个 if (meetGrouplist.ChatListBox_group.Items[0].SubItems.Count == 0) { meetGrouplist.ChatListBox_group.Items[0].SubItems.Add(clsl); } else { ChatListSubItem clsl_tmp = meetGrouplist.ChatListBox_group.Items[0].SubItems[0]; meetGrouplist.ChatListBox_group.Items[0].SubItems[0] = clsl; if (clsl_tmp.HeadImage != SysParams.defaultHead) { clsl_tmp.HeadImage.Dispose(); } clsl_tmp = null; } meetGrouplist.ChatListBox_group.Items[0].IsOpen = true; } else if (u == UserListType.findMember) { bool isExist = false; foreach (ChatListSubItem item in meetGrouplist.ChatListBox_group.Items[1].SubItems)//去重 { if (item.ID == uid) { isExist = true; break; } } if ((meetGrouplist.ChatListBox_group.Items[0].SubItems.Count > 0 //不等于主持人 && meetGrouplist.ChatListBox_group.Items[0].SubItems[0].ID == uid)) { isExist = true; } if (!isExist) { meetGrouplist.ChatListBox_group.Items[1].SubItems.Add(clsl); } } }
/// <summary> /// Собирает пользователей из всех соответствующих подсписков коллекции BaseUserTaskReference и добавляет их к /// соответствующему списку пользователей задачи /// Сбор пользвателей из ролей и групп пока не реализован! /// </summary> /// <param name="Butrs"></param> /// <param name="ual"></param> public static void FillUsersFromAdminTaskCollection(XPCollection <BaseUserTaskReference> Butrs, ref DealWithoutStageTaskInstanceDefinition task, UserListType userListType) { foreach (BaseUserTaskReference butr in Butrs) { UserTaskReference userbutr = butr as UserTaskReference; if (userbutr != null) { AppUser AppUserbutr = userbutr.AppUser; switch (userListType) { case UserListType.BusinessAdministrators: if (AppUserbutr != null & task.BusinessAdministrators.IndexOf(AppUserbutr) == -1) { AppUserbutr.BaseUserTaskBusinessAdministrators.Add(task); } break; case UserListType.ExcludedOwners: if (AppUserbutr != null & task.ExcludedOwners.IndexOf(AppUserbutr) == -1) { AppUserbutr.BaseUserTaskExcludedOwners.Add(task); } break; case UserListType.NotificationRecipients: if (AppUserbutr != null & task.NotificationRecipients.IndexOf(AppUserbutr) == -1) { AppUserbutr.BaseUserTaskNotificationRecipients.Add(task); } break; case UserListType.PossibleDelegates: if (AppUserbutr != null & task.PossibleDelegates.IndexOf(AppUserbutr) == -1) { AppUserbutr.BaseUserTaskPossibleDelegates.Add(task); } break; case UserListType.PotentialOwners: if (AppUserbutr != null & task.PotentialOwners.IndexOf(AppUserbutr) == -1) { AppUserbutr.BaseUserTaskPotentialOwners.Add(task); } break; case UserListType.TaskStakeholders: if (AppUserbutr != null & task.TaskStakeholders.IndexOf(AppUserbutr) == -1) { AppUserbutr.BaseUserTaskTaskStakeholders.Add(task); } break; } } if (butr.GetType() == typeof(RoleTaskReference)) { RoleTaskReference rolebutr = (RoleTaskReference)butr; //AppUser AppUserbutr = rolebutr.AppUser; //if (ual.IndexOf(AppUserbutr) == -1) ual.Add(AppUserbutr); } if (butr.GetType() == typeof(GroupTaskReference)) { GroupTaskReference groupbutr = (GroupTaskReference)butr; //AppUser AppUserbutr = userbutr.AppUser; //if (ual.IndexOf(AppUserbutr) == -1) ual.Add(AppUserbutr); } } }
/// <summary> /// Must not be invoked directly. Invoke <c><see cref="GetSocial.CreateUserListView"/></c> instead. /// </summary> public static UserListViewBuilder Construct(IGetSocialNativeBridge getSocialImpl, UserListType type, Action <User> onUserSelected, Action onCancel) { return(new UserListViewBuilder(getSocialImpl, type, onUserSelected, onCancel)); }
/// <summary> /// Constructor for inserting a UserList into the database /// </summary> /// <param name="name"></param> /// <param name="type"></param> /// <param name="user"></param> public UserList(string name, UserListType type, User user) { Name = name; Type = type; User = user; }