protected override void OnSaving() { if (string.IsNullOrEmpty(this.届别)) { throw new Exception("届别不能为空."); } if (string.IsNullOrEmpty(this.岗位级别)) { throw new Exception("岗位级别不能为空."); } if (string.IsNullOrEmpty(this.学历)) { throw new Exception("学历不能为空."); } if (string.IsNullOrEmpty(this.专业名称)) { throw new Exception("专业名称不能为空."); } if (!ManagementTraineeInfo.CheckSpecialtyValid(Convert.ToInt32(届别), 岗位级别, 学历, 专业名称)) { throw new Exception("专业名称无效."); } ManagementSpecialtyPropertyInput found = GetManagementSpecialtyPropertyInput(this.届别, this.岗位级别, this.学历, this.专业名称, this.是验证录入); if (found != null && found.标识 != this.标识) { throw new Exception("已经存在该专业的属性信息,不能重复创建"); } else { base.OnSaving(); } contentDifferentFields = null; MANAGEMENT_SPECIALTY_PROPERTY_INPUT_CACHE.Set(CacheKey, this, TimeSpan.FromHours(1)); }
public static ManagementSpecialtyPropertyInput GetManagementSpecialtyPropertyInput(Guid id) { ManagementSpecialtyPropertyInput obj = (ManagementSpecialtyPropertyInput)Session.DefaultSession.GetObjectByKey(typeof(ManagementSpecialtyPropertyInput), id); return(obj); }