Ejemplo n.º 1
0
        public void AddServiceType(string description)
        {
            var existing = AccountTypeRepository.GetServiceTypes();

            if (null != existing.Where(e => e.Description == description).FirstOrDefault())
            {
                throw new InvalidOperationException(string.Format("{0} already exists as a service type", description));
            }
            AccountTypeRepository.SaveServiceType(new ServiceType()
            {
                Description = description
            });
        }
Ejemplo n.º 2
0
        public SelectList GetServiceTypes()
        {
            var serviceTypes = AccountTypeRepository.GetServiceTypes().OrderBy(o => o.Description);

            return(new SelectList(serviceTypes, "Id", "Description"));
        }