Example #1
0
    /// <summary>
    /// 投递简历
    /// </summary>
    private void SubResume()
    {
        BLL.JobBLL  bll  = new BLL.JobBLL();
        BLL.UserBLL ubll = new BLL.UserBLL();
        DataTable   dt   = bll.GetResumeList(" CreateUser='******' ");

        if (dt.Rows.Count == 0)
        {
            throw new Exception("您还没有简历请先创建一份简历!");
        }
        else
        {
            DataRow dr = dt.Rows[0];
            Model.ResumeVsJobModel model = new ResumeVsJobModel();
            model.JobId    = ReStr("JobId");
            model.Memo     = "";
            model.ResumeId = dr["ResumeId"].ToString();
            model.VsType   = "正常投递";
            try
            {
                bll.SubResume(model);
            }
            catch
            {
                throw new Exception("投递错误! 您是否已经投递了此职位?!");
            }
            ReTrue();
        }
    }
Example #2
0
    private void SaveResume()
    {
        BLL.UserBLL uBll  = new BLL.UserBLL();
        ResumeModel model = new ResumeModel();

        BLL.JobBLL bll = new BLL.JobBLL();

        model.CreateUser = uBll.CurrentUserId();
        DataTable dtResumeByUser = bll.GetResumeList(" CreateUser='******' ");

        if (dtResumeByUser.Rows.Count > 0)
        {    //这个用户已经有简历了
            DataRow dr = dtResumeByUser.Rows[0];
            model.ResumeId = dr["ResumeId"].ToString();
        }
        else
        {
            //还没有创建简历
            model.ResumeId = ReStr("ResumeId").Trim();     //传过来一般也是空的
        }
        model.IsTop       = false;
        model.JobPayId    = ReInt("JobPayId");
        model.ResumeAge   = ReInt("ResumeAge");
        model.ResumeEmail = ReStr("ResumeEmail");
        model.JobTarget   = ReStr("JobTarget");
        model.ResumeMemo  = ReStr("ResumeMemo");
        model.ResumeName  = ReStr("ResumeName");
        model.ResumeQQ    = ReStr("ResumeQQ");
        model.ResumeSex   = ReStr("ResumeSex");
        model.ResumeTell  = ReStr("ResumeTell");
        model.SchoolExp   = ReInt("SchoolExp");
        model.TopLv       = ReInt("TopLv", 0);
        model.TownId      = ReInt("TownId");
        model.WorkYear    = ReInt("WorkYear");
        model.PicImgId    = ReStr("PicImgId");

        #region 事务开启
        TransactionOptions transactionOption = new TransactionOptions();
        transactionOption.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
        using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOption))
        {
            #endregion
            bll.SaveResume(model);
            //string EduArrayStr = ReStr("EduArrayStr").Trim();

            //string[] EduArray = EduArrayStr.Split('|');
            //int i = EduArray.Length;



            bll.DeleteEdu(" ResumeId='" + model.ResumeId + "' ");
            DataTable dtEduArray = ReTable("EduArrayStr");

            if (dtEduArray != null)
            {
                foreach (DataRow dr in dtEduArray.Rows)
                {
                    EducationModel eduModel = new EducationModel();
                    eduModel.EducationSchool = dr["EducationSchool"].ToString();
                    eduModel.SubName         = dr["SubName"].ToString();
                    eduModel.BeginDate       = DateTime.Parse(dr["BeginDate"].ToString());
                    eduModel.EndDate         = DateTime.Parse(dr["EndDate"].ToString());
                    eduModel.EducationMemo   = "";
                    eduModel.ResumeId        = model.ResumeId;
                    eduModel.OrderNo         = 1;
                    bll.SaveEduCation(eduModel);
                }
            }



            //开始添加求职意向的职位
            DataTable dtJobType = ReTable("JobTypeArrayStr");

            if (dtJobType != null)
            {
                bll.DeleteResumeVsJobType(" ResumeId='" + model.ResumeId + "' ");

                foreach (DataRow dr in dtJobType.Rows)
                {
                    ResumeVsJobTypeModel vsmodel = new ResumeVsJobTypeModel();
                    vsmodel.JobTypeId = decimal.Parse(dr["JobTypeId"].ToString());
                    vsmodel.ResumeId  = model.ResumeId;

                    bll.SaveResumeVsJobType(vsmodel);
                }
            }
            else
            {
            }



            ReDict2.Add("ResumeId", model.ResumeId);

            #region 事务关闭
            transactionScope.Complete();
        }
        #endregion

        ReTrue();
    }