//更新到正式表 public void UpdateToFormalTable() { if (this.内容不同的字段.Count > 0) { return; } ManagementTraineeAbility m = ManagementTraineeAbility.GetManagementTraineeAbility(员工编号, 年度); if (m == null) { m = new ManagementTraineeAbility(); m.标识 = Guid.NewGuid(); m.创建时间 = DateTime.Now; } this.CopyWatchMember(m); m.序号 = this.序号; m.更新时间 = DateTime.Now; m.Save(); //更新生效标记 if (!this.已生效) { this.生效时间 = DateTime.Now; this.Save(); ManagementTraineeAbilityInput opposite = 另一人录入的记录; opposite.生效时间 = DateTime.Now; opposite.Save(); } }
protected override void OnSaving() { if (string.IsNullOrEmpty(this.届别)) { throw new Exception("届别不能为空."); } if (string.IsNullOrEmpty(this.岗位级别)) { throw new Exception("岗位级别不能为空."); } if (this.年度 <= 0) { throw new Exception("年度不能为空."); } ManagementTraineeAbilityInput found = GetManagementTraineeAbilityInput(this.员工编号, this.年度, this.是验证录入); if (found != null && found.标识 != this.标识) { throw new Exception("已经存在该员工的能力评定记录,不能重复创建"); } else { base.OnSaving(); } contentDifferentFields = null; MANAGEMENT_TRAINEE_ABILITY_INPUT_CACHE.Set(CacheKey, this, TimeSpan.FromHours(1)); }
public static ManagementTraineeAbilityInput AddManagementTraineeAbilityInput(string division, string grade, string emplid, string name, int year, int order, bool isVerify) { ManagementTraineeAbilityInput item = GetManagementTraineeAbilityInput(emplid, year, isVerify); if (item == null) { item = new ManagementTraineeAbilityInput(); item.标识 = Guid.NewGuid(); item.届别 = division; item.岗位级别 = grade; item.员工编号 = emplid; item.姓名 = name; item.年度 = year; item.序号 = order; item.是验证录入 = isVerify; item.录入人 = " "; item.录入时间 = DateTime.Now; item.Save(); } return(item); }
public static ManagementTraineeAbilityInput GetManagementTraineeAbilityInput(Guid id) { ManagementTraineeAbilityInput obj = (ManagementTraineeAbilityInput)Session.DefaultSession.GetObjectByKey(typeof(ManagementTraineeAbilityInput), id); return(obj); }