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

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

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