public ActionResult Index(string search = "") { var codecTypes = string.IsNullOrWhiteSpace(search) ? _codecTypeRepository.GetAll(true) : _codecTypeRepository.Find(search, true); ViewBag.SearchString = search; return(View(codecTypes)); }
public ActionResult Index() { var vm = new HomeViewModel { CodecTypes = _codecTypeRepository.GetAll(false).Select(ct => new CodecTypeViewModel { Name = ct.Name, Color = ct.Color }), Regions = _regionRepository.GetAllRegionNames() }; return(View(vm)); }
public ActionResult Index() { var vm = new HomeViewModel { CodecTypes = _codecTypeRepository.GetAll().Select(codecType1 => new CodecTypeViewModel() { Name = codecType1.Name, Color = codecType1.Color }), Regions = _regionRepository.GetAll().Select(r => r.Name), }; return(View(vm)); }
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 <CodecType> GetCodecTypes() { return(_codecTypeRepository.GetAll()); }