Exemplo n.º 1
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(ResumeVsJobTypeModel model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into ResumeVsJobType(");
            strSql.Append("ResumeId,JobTypeId,VsType,Memo");
            strSql.Append(") values (");
            strSql.Append("@ResumeId,@JobTypeId,@VsType,@Memo");
            strSql.Append(") ");

            SqlParameter[] parameters =
            {
                new SqlParameter("@ResumeId",  SqlDbType.VarChar, 50),
                new SqlParameter("@JobTypeId", SqlDbType.Decimal,  9),
                new SqlParameter("@VsType",    SqlDbType.VarChar, 10),
                new SqlParameter("@Memo",      SqlDbType.VarChar, 200)
            };

            parameters[0].Value = model.ResumeId;
            parameters[1].Value = model.JobTypeId;
            parameters[2].Value = model.VsType;
            parameters[3].Value = model.Memo;

            bool result = false;

            try
            {
                helper.ExecSqlReInt(strSql.ToString(), parameters);
                result = true;
            }
            catch (Exception ex)
            {
                this.helper.Close();
                throw ex;
            }
            finally
            {
            }
            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(ResumeVsJobTypeModel model)
        {
            bool          reValue = true;
            int           reCount = 0;
            StringBuilder strSql  = new StringBuilder();

            strSql.Append("update ResumeVsJobType set ");

            strSql.Append(" ResumeId = @ResumeId , ");
            strSql.Append(" JobTypeId = @JobTypeId , ");
            strSql.Append(" VsType = @VsType , ");
            strSql.Append(" Memo = @Memo  ");
            strSql.Append(" where ResumeId=@ResumeId and JobTypeId=@JobTypeId  ");

            SqlParameter[] parameters =
            {
                new SqlParameter("@ResumeId",  SqlDbType.VarChar, 50),
                new SqlParameter("@JobTypeId", SqlDbType.Decimal,  9),
                new SqlParameter("@VsType",    SqlDbType.VarChar, 10),
                new SqlParameter("@Memo",      SqlDbType.VarChar, 200)
            };

            parameters[0].Value = model.ResumeId;
            parameters[1].Value = model.JobTypeId;
            parameters[2].Value = model.VsType;
            parameters[3].Value = model.Memo; try
            {//异常处理
                reCount = this.helper.ExecSqlReInt(strSql.ToString(), parameters);
            }
            catch (Exception ex)
            {
                this.helper.Close();
                throw ex;
            }
            if (reCount <= 0)
            {
                reValue = false;
            }
            return(reValue);
        }
Exemplo n.º 3
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();
    }