protected override void OnSaving()
        {
            if (string.IsNullOrEmpty(this.届别))
            {
                throw new Exception("届别不能为空");
            }
            if (string.IsNullOrEmpty(this.岗位级别))
            {
                throw new Exception("岗位级别不能为空.");
            }

            ManagementTraineePayRiseStandardInput found = GetManagementTraineePayRiseStandardInput(届别, 岗位级别, 类别, 是验证录入);

            if (found != null && found.标识 != this.标识)
            {
                throw new Exception("已经存在记录,不能重复创建");
            }
            else
            {
                base.OnSaving();
            }

            contentDifferentFields = null;
            MANAGEMENT_TRAINEE_PAY_RISE_INPUT_CACHE.Set(CacheKey, this, TimeSpan.FromHours(1));
        }
        //更新到正式表
        public void UpdateToFormalTable()
        {
            if (this.内容不同的字段.Count > 0)
            {
                return;
            }
            //清除旧记录
            ManagementTraineePayRiseStandard.Clear(届别, 岗位级别, 类别);
            //创建和更新提资标准
            CreateOrUpdatePayStandard();
            //更新生效标记
            if (!this.已生效)
            {
                this.生效时间 = DateTime.Now;
                this.Save();

                ManagementTraineePayRiseStandardInput opposite = 另一人录入的记录;
                opposite.生效时间 = DateTime.Now;
                opposite.Save();
            }
        }
        public static ManagementTraineePayRiseStandardInput AddManagementTraineePayRiseStandardInput(int order, string year, string grade, string type, int rise_type_final, bool isVerify)
        {
            ManagementTraineePayRiseStandardInput item = GetManagementTraineePayRiseStandardInput(year, grade, type, isVerify);

            if (item == null)
            {
                item        = new ManagementTraineePayRiseStandardInput();
                item.标识     = Guid.NewGuid();
                item.届别     = year;
                item.岗位级别   = grade;
                item.满阶起薪方式 = rise_type_final;
                item.类别     = type;
                item.序号     = order;
                item.是验证录入  = isVerify;
                item.录入人    = "";
                item.录入时间   = DateTime.Now;

                item.Save();
            }
            return(item);
        }
        public static ManagementTraineePayRiseStandardInput GetManagementTraineePayRiseStandardInput(Guid id)
        {
            ManagementTraineePayRiseStandardInput obj = (ManagementTraineePayRiseStandardInput)Session.DefaultSession.GetObjectByKey(typeof(ManagementTraineePayRiseStandardInput), id);

            return(obj);
        }