public GetAccountsOutputDto GetAccounts(GetAccountsInputDto input) { //Called specific GetAllWithPeople method of task repository. var accounts = _accountRepository.GetAllWithUser(input.AssignedUserId); //Used AutoMapper to automatically convert List<Task> to List<TaskDto>. return new GetAccountsOutputDto { Accounts = Mapper.Map<List<AccountDto>>(accounts) }; }
//Lookup Account public ActionResult GetAccountListForAutocomplete(string term) { GetAccountsInputDto getaccountsinput = new GetAccountsInputDto(); var accountList = _svcAccount.GetAccounts(getaccountsinput).Accounts.Where(a => a.Name.ToUpper().Contains(term.ToUpper())) .Take(5) .Select(a => new { id = a.Id, label = a.Name }); return Json(accountList, JsonRequestBehavior.AllowGet); }
// GET: Job public ActionResult Index() { GetAccountsInputDto getAccountsInput = new GetAccountsInputDto(); bool hasAuth = Thread.CurrentPrincipal.Identity.IsAuthenticated; //if (AbpSession.UserId.HasValue) { getAccountsInput.AssignedUserId = (int)AbpSession.UserId; } return View(_svcAccount.GetAccounts(getAccountsInput)); }