//更新到正式表 public void UpdateToFormalTable() { if (this.内容不同的字段.Count > 0) { return; } ManagementTraineeInfo m = ManagementTraineeInfo.GetManagementTraineeInfo(this.员工编号); if (m == null) { m = new ManagementTraineeInfo(); m.标识 = Guid.NewGuid(); } this.CopyWatchMember(m); m.更新时间 = DateTime.Now; m.Save(); //更新生效标记 if (!this.已生效) { this.生效时间 = DateTime.Now; this.Save(); ManagementTraineeInfoInput opposite = 另一人录入的记录; opposite.生效时间 = DateTime.Now; opposite.Save(); } }
public static ManagementTraineeInfoInput AddManagementTraineeInfoInput(string emplid, bool isVerify, bool copyEffective) { ManagementTraineeInfoInput item = GetManagementTraineeInfoInput(emplid, isVerify); if (item == null) { item = new ManagementTraineeInfoInput(); if (copyEffective) { //将当前的管培生信息带进来 ManagementTraineeInfo effectiveManagementTraineeInfo = ManagementTraineeInfo.GetManagementTraineeInfo(emplid); if (effectiveManagementTraineeInfo != null) { item.CopyEffective = copyEffective; effectiveManagementTraineeInfo.CopyWatchMember(item); } } item.标识 = Guid.NewGuid(); item.员工编号 = emplid; item.是验证录入 = isVerify; item.录入人 = " "; item.录入时间 = DateTime.Now; item.Save(); } return(item); }
protected override void OnSaving() { if (string.IsNullOrEmpty(this.员工编号)) { throw new Exception("员工编号不能为空."); } if (this.员工信息 == null) { throw new Exception("指定的员工编号不存在."); } this.姓名 = this.员工信息.姓名; ManagementTraineeInfoInput found = GetManagementTraineeInfoInput(this.员工编号, this.是验证录入); if (found != null && found.标识 != this.标识) { throw new Exception("已经存在该员工的管培生基本信息,不能重复创建"); } else { base.OnSaving(); } contentDifferentFields = null; MANAGEMENT_TRAINEE_INFO_INPUT_CACHE.Set(CacheKey, this, TimeSpan.FromHours(1)); }
public static ManagementTraineeInfoInput GetManagementTraineeInfoInput(Guid id) { ManagementTraineeInfoInput obj = (ManagementTraineeInfoInput)Session.DefaultSession.GetObjectByKey(typeof(ManagementTraineeInfoInput), id); return(obj); }