コード例 #1
0
        public override AnalysisResult SearchResults(string Search)
        {
            List <PersonaResult> result = null;

            if (Search.Empty())
            {
                result = EncompassApplication.Session.Users.Personas.Cast <EllieMae.Encompass.BusinessObjects.Users.Persona>().Select(x => new PersonaResult()
                {
                    Name = x.Name
                }).ToList();
            }
            else
            {
                EllieMae.Encompass.BusinessObjects.Users.Persona p = EncompassApplication.Session.Users.Personas.GetPersonaByName(Search);
                if (p != null)
                {
                    result = EncompassApplication.Session.Users.GetUsersWithPersona(p, false).Cast <User>().Select(x => new PersonaResult()
                    {
                        Name = x.FullName, UserID = x.ID, Personas = x.Personas.ToString()
                    }).ToList();
                }
            }

            return(new AnalysisResult(nameof(SearchPersonas))
            {
                Result = result
            });
        }
コード例 #2
0
        private void CmbPersonas_TextChanged(object sender, EventArgs e)
        {
            ComboBox combo           = sender as ComboBox;
            Persona  selectedPersona = EncompassApplication.Session.Users.Personas.GetPersonaByName(combo.Text);

            dgvUsers.DataSource = EncompassApplication.Session.Users.GetUsersWithPersona(selectedPersona, true).Cast <User>().Select(x => new EncompassUser()
            {
                UserName = x.ID, FullName = x.FullName
            }).ToList();
            dgvUsers.AutoGenerateColumns = true;
            dgvUsers.SelectionMode       = DataGridViewSelectionMode.FullRowSelect;
        }
コード例 #3
0
        private void btnReassign_Click(object sender, EventArgs e)
        {
            string   user            = dgvUsers.SelectedRows[0].Cells[0].Value.ToString();
            string   name            = dgvUsers.SelectedRows[0].Cells[1].Value.ToString();
            Persona  selectedPersona = EncompassApplication.Session.Users.Personas.GetPersonaByName(cmbPersonas.Text);
            RoleInfo selectedRole    = Roles.Where(x => x.Name.Equals(cmbRole.Text)).FirstOrDefault();

            if (MessageBox.Show($"Are you sure want to reassign {this.Info.Count} Loans to {name}", "Confirm", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK)
            {
                using (ProgressReportDialog progressReportDialog = new ProgressReportDialog("Batch Loan Reassignment Process", null, (object)Info, new string[] { }))
                {
                    for (int i = 0; i < Info.Count; i++)
                    {
                        EncompassHelper.SessionObjects.LoanManager.LoanReassign(i, Info[i], user, selectedRole.RoleID, progressReportDialog);
                    }
                }
            }

            if (MessageBox.Show($"Loans have been reassigned", "Reassign", MessageBoxButtons.OK, MessageBoxIcon.Information) == DialogResult.OK)
            {
                this.Close();
            }
        }