示例#1
0
        public ActionResult Index(string search = "")
        {
            List <Owner> owners = string.IsNullOrWhiteSpace(search) ? ownersRepository.GetAll() : ownersRepository.FindOwners(search);

            ViewBag.SearchString = search;
            return(View(owners));
        }
示例#2
0
        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();
        }
示例#3
0
        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
            });
        }
示例#4
0
 public List <Owner> GetOwners()
 {
     return(_ownersRepository.GetAll());
 }