示例#1
0
        public ActionResult Index(string search = "")
        {
            var codecTypes = string.IsNullOrWhiteSpace(search) ? _codecTypeRepository.GetAll(true) : _codecTypeRepository.Find(search, true);

            ViewBag.SearchString = search;
            return(View(codecTypes));
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }
示例#4
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();
        }
示例#5
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
            });
        }
示例#6
0
 public List <CodecType> GetCodecTypes()
 {
     return(_codecTypeRepository.GetAll());
 }