Exemplo n.º 1
0
        /// <summary>
        /// 提交报名资料。
        /// </summary>
        /// <returns></returns>
        public async Task CommitAsync(ApplicationForm form)
        {
            if (form == null)
            {
                throw new ArgumentNullException();
            }

            if (form.Id == 0)
            {
                await this.EnrollAsync(form);
            }

            if (form.WhenCommited.HasValue)
            {
                return;
            }

            if (form.Job.Plan.WhenAuditCommited.HasValue)
            {
                throw new InvalidOperationException("关联的招聘计划已完成资格审核,不再接受提交任何报名表。");
            }

            //如果没有FileReview标记,则不允许在超过报名时间提交。
            if (!form.FileReviewAccepted.HasValue && form.Job.Plan.EnrollExpirationDate < DateTime.Now)
            {
                throw new InvalidOperationException("报名截止时间已过。");
            }

            //检查传送资料是否齐全并满足规则。
            if (string.IsNullOrEmpty(form.HeadImageFile))
            {
                throw new InvalidOperationException("需要证件照。");
            }

            if (!form.AcademicCertFileList.Any())
            {
                throw new InvalidOperationException("至少需要上传一份学历证明文件。");
            }

            //设置提交时间。
            form.WhenCommited = DateTime.Now;
            form.CommitCount += 1;
            form.Log("提交报名表。");

            //清除资料审查标记,以便将此报名表自再次加入资料审查列表中。
            form.WhenFileReviewed   = null;
            form.FileReviewAccepted = null;
            form.FileReviewedBy     = null;
            form.FileReviewMessage  = null;

            //清除审核标记
            form.AuditFlag         = false;
            form.AuditMessage      = null;
            form.AuditBy           = null;
            form.WhenAudit         = null;
            form.WhenAuditComplete = null;

            await this.formStore.UpdateAsync(form);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 将报名表退回给求职者。
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        public async Task ReturnBackAsync(ApplicationForm form)
        {
            if (form == null)
            {
                throw new ArgumentNullException();
            }

            if (!form.WhenCommited.HasValue)
            {
                return;
            }

            form.WhenCommited = null;
            form.Log("退回报名表。");

            await this.formStore.UpdateAsync(form);
        }