private void butPickPresenter_Click(object sender, EventArgs e) { FormUserPick FormUP = new FormUserPick(); List <Userod> listUsers = Userods.GetWhere(x => x.ClinicIsRestricted == false || x.ClinicNum == Clinics.ClinicNum, true); FormUP.ListUserodsFiltered = listUsers; if (_presenterCur != null) { FormUP.SuggestedUserNum = _presenterCur.UserNum; } FormUP.IsPickNoneAllowed = true; FormUP.ShowDialog(); if (FormUP.DialogResult != DialogResult.OK) { return; } _presenterCur = Userods.GetUser(FormUP.SelectedUserNum); //can be null if (_presenterCur != null) { textPresenter.Text = _presenterCur.UserName; } else { textPresenter.Text = ""; } }
private void butUserPicker_Click(object sender, EventArgs e) { FormUserPick FormUP = new FormUserPick(); FormUP.ListUserodsFiltered = Userods.GetDeepCopy(); if (FormUP.ShowDialog() == DialogResult.OK) { comboUsers.SelectedIndex = _listUsers.FindIndex(x => x.UserNum == FormUP.SelectedUserNum) + 2; } }
private void butUserPick_Click(object sender, EventArgs e) { FormUserPick formUP = new FormUserPick(); formUP.IsSelectionmode = true; formUP.ListUserodsFiltered = _listUsersInComboBox; formUP.IsPickAllAllowed = false; formUP.ShowDialog(); if (formUP.DialogResult != DialogResult.OK) { return; } _selectedUserNum = formUP.SelectedUserNum; FillComboBox(); }
private void butPickUserod_Click(object sender, EventArgs e) { FormUserPick formUserPick = new FormUserPick(); formUserPick.SuggestedUserNum = ((Userod)textUserod.Tag)?.UserNum ?? 0; //Preselect current selection. if (formUserPick.ShowDialog() == DialogResult.OK) { Userod user = Userods.GetUser(formUserPick.SelectedUserNum); if (user.UserNum == (((Userod)textUserod.Tag)?.UserNum ?? 0)) { return; //No change. } EmailAddress emailUserExisting = EmailAddresses.GetForUser(user.UserNum); if (emailUserExisting != null) { MsgBox.Show(this, "User email already exists for " + user.UserName); return; } textUserod.Tag = user; textUserod.Text = user.UserName; } }
private void gridSubscribers_TitleAddClick(object sender, EventArgs e) { FormUserPick FormUP = new FormUserPick(); //Suggest current user if not already watching. if (_listJobLinks.FindAll(x => x.LinkType == JobLinkType.Subscriber).All(x => x.FKey != Security.CurUser.UserNum)) { FormUP.SuggestedUserNum = Security.CurUser.UserNum; } FormUP.IsSelectionmode = true; FormUP.ShowDialog(); if (FormUP.DialogResult != DialogResult.OK) { return; } JobLink jobLink = new JobLink() { FKey = FormUP.SelectedUserNum, LinkType = JobLinkType.Subscriber }; _listJobLinks.Add(jobLink); FillGridSubscribers(); }
private void butChangeUser_Click(object sender,EventArgs e) { FormUserPick FormP=new FormUserPick(); FormP.ShowDialog(); if(FormP.DialogResult==DialogResult.OK) { TaskCur.UserNum=FormP.SelectedUserNum; textUser.Text=Userods.GetName(TaskCur.UserNum); } }