//更新到正式表
        public void UpdateToFormalTable()
        {
            if (this.内容不同的字段.Count > 0)
            {
                return;
            }

            ManagementSpecialtyProperty m = ManagementSpecialtyProperty.GetManagementSpecialtyProperty(届别, 岗位级别, 学历, 专业名称);

            if (m == null)
            {
                m    = new ManagementSpecialtyProperty();
                m.标识 = Guid.NewGuid();
            }
            this.CopyWatchMember(m);
            m.序号   = this.序号;
            m.更新时间 = DateTime.Now;
            m.Save();

            //更新生效标记
            if (!this.已生效)
            {
                this.生效时间 = DateTime.Now;
                this.Save();

                ManagementSpecialtyPropertyInput opposite = 另一人录入的记录;
                opposite.生效时间 = DateTime.Now;
                opposite.Save();
            }
        }
        public static ManagementSpecialtyPropertyInput AddManagementSpecialtyPropertyInput(string year, string grade, string xueli, string specialty, bool isVerify, bool copyEffective)
        {
            ManagementSpecialtyPropertyInput item = GetManagementSpecialtyPropertyInput(year, grade, xueli, specialty, isVerify);

            if (item == null)
            {
                item = new ManagementSpecialtyPropertyInput();

                if (copyEffective)
                {
                    //将当前的管培生信息带进来
                    ManagementSpecialtyProperty effectiveManagementSpecialtyProperty = ManagementSpecialtyProperty.GetManagementSpecialtyProperty(year, grade, xueli, specialty);
                    if (effectiveManagementSpecialtyProperty != null)
                    {
                        item.CopyEffective = copyEffective;
                        effectiveManagementSpecialtyProperty.CopyWatchMember(item);
                    }
                }

                item.标识   = Guid.NewGuid();
                item.届别   = year;
                item.岗位级别 = grade;
                item.学历   = xueli;
                item.专业名称 = specialty;

                item.是验证录入 = isVerify;
                item.录入人   = "   ";
                item.录入时间  = DateTime.Now;

                item.Save();
            }
            return(item);
        }
Пример #3
0
        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("专业名称不能为空.");
            }

            ManagementSpecialtyProperty found = GetManagementSpecialtyProperty(this.届别, this.岗位级别, this.学历, this.专业名称);

            if (found != null && found.标识 != this.标识)
            {
                throw new Exception("已经存在该专业的属性信息,不能重复创建");
            }
            else
            {
                base.OnSaving();
            }
        }
Пример #4
0
        public static ManagementSpecialtyProperty AddManagementSpecialtyProperty(string year, string grade, string xueli, string specialty, string property)
        {
            ManagementSpecialtyProperty item = GetManagementSpecialtyProperty(year, grade, xueli, specialty);

            if (item == null)
            {
                item = new ManagementSpecialtyProperty();

                item.标识 = Guid.NewGuid();

                item.届别   = year;
                item.岗位级别 = grade;
                item.学历   = xueli;
                item.专业名称 = specialty;
                item.属性   = property;

                item.更新时间 = DateTime.Now;
                item.Save();
            }
            return(item);
        }
Пример #5
0
        public static ManagementSpecialtyProperty GetManagementSpecialtyProperty(Guid id)
        {
            ManagementSpecialtyProperty obj = (ManagementSpecialtyProperty)Session.DefaultSession.GetObjectByKey(typeof(ManagementSpecialtyProperty), id);

            return(obj);
        }