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 }); }
public SelectList GetLaborTypes() { var laborTypes = AccountTypeRepository.GetLaborTypes().OrderBy(o => o.Description); return(new SelectList(laborTypes, "Id", "Description")); }