public ActionResult Index(string search = "") { List <Owner> owners = string.IsNullOrWhiteSpace(search) ? ownersRepository.GetAll() : ownersRepository.FindOwners(search); ViewBag.SearchString = search; return(View(owners)); }
private void SetListData(SipAccountFormViewModel model) { model.Owners = _ownersRepository.GetAll(); model.Owners.Insert(0, new Owner { Id = Guid.Empty, Name = string.Empty }); model.CodecTypes = _codecTypeRepository.GetAll(false); model.CodecTypes.Insert(0, new CodecType { Id = Guid.Empty, Name = string.Empty }); model.AccountTypes = EnumHelpers.EnumSelectList <SipAccountType>().OrderBy(e => e.Text).ToList(); }
private void SetListData(UserFormViewModel model) { model.Owners = _ownersRepository.GetAll(); model.Owners.Insert(0, new Owner { Id = Guid.Empty, Name = string.Empty }); model.CodecTypes = _codecTypeRepository.GetAll(); model.CodecTypes.Insert(0, new CodecType() { Id = Guid.Empty, Name = string.Empty }); model.CurrentUserIsLocalAdmin = _userManager.UserIsLocalAdmin(User.Identity.Name); model.Roles = _userManager.GetRoles(); model.Roles.Insert(0, new CcmRole() { Name = string.Empty, Id = string.Empty }); }
public List <Owner> GetOwners() { return(_ownersRepository.GetAll()); }