示例#1
0
        /// <summary>
        /// Delete Job Type by id
        /// </summary>
        public void DeleteJobType(long jobTypeId)
        {
            JobType dbversion = jobTypeRepository.Find((int)jobTypeId);

            ValidateBeforeDeletion(jobTypeId);
            if (dbversion == null)
            {
                throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
                                                                  "Job Type with Id {0} not found!", jobTypeId));
            }
            jobTypeRepository.Delete(dbversion);
            jobTypeRepository.SaveChanges();
        }