/// <summary>
        /// 插入一条专业人才数据
        /// </summary>
        /// <returns></returns>
        public bool InsertProFessionlView(ProfessionalinfoTab mainInfo, Professionaltalents viewInfo, ProfessionalLink link)
        {
            int result = 0;

            SqlParameter[] parameters =
            {
                new SqlParameter("@Title",          SqlDbType.VarChar,    200),
                new SqlParameter("@LoginName",      SqlDbType.VarChar,     50),
                new SqlParameter("@typeID",         SqlDbType.Int,          4),
                new SqlParameter("@htmlUrl",        SqlDbType.VarChar,    200),
                new SqlParameter("@formID",         SqlDbType.Int,          4),
                new SqlParameter("@recommendID",    SqlDbType.Int,          4), //6


                new SqlParameter("@CountryCode",    SqlDbType.VarChar,     10),
                new SqlParameter("@ProvinceID",     SqlDbType.VarChar,     10),
                new SqlParameter("@CityID",         SqlDbType.VarChar,     10),
                new SqlParameter("@CountyID",       SqlDbType.VarChar,     10),

                new SqlParameter("@position",       SqlDbType.VarChar,     20),
                new SqlParameter("@servicetypeID",  SqlDbType.Int,          4),
                new SqlParameter("@talentsTypeID",  SqlDbType.Int,          4),
                new SqlParameter("@resume",         SqlDbType.NVarChar,  2000),
                new SqlParameter("@specialty",      SqlDbType.NVarChar,  2000),
                new SqlParameter("@ScuccCase",      SqlDbType.NVarChar,  2000),
                new SqlParameter("@companydate",    SqlDbType.DateTime),


                new SqlParameter("@validityID",     SqlDbType.Int,          4),
                new SqlParameter("@Webtitle",       SqlDbType.VarChar,     50),
                new SqlParameter("@keywords",       SqlDbType.VarChar,     50),
                new SqlParameter("@Webdescription", SqlDbType.VarChar,     50), //21

                new SqlParameter("@UserName",       SqlDbType.VarChar,    100),
                new SqlParameter("@CompanyName",    SqlDbType.VarChar,    100),
                new SqlParameter("@Address",        SqlDbType.VarChar,    100),
                new SqlParameter("@Tel",            SqlDbType.VarChar,     50),
                new SqlParameter("@phone",          SqlDbType.VarChar,     50),
                new SqlParameter("@Fax",            SqlDbType.VarChar,     50),
                new SqlParameter("@Email",          SqlDbType.VarChar,     50),
                new SqlParameter("@Site",           SqlDbType.VarChar,     50),
                new SqlParameter("@price",          SqlDbType.Decimal,     18), //9
                new SqlParameter("@images",         SqlDbType.VarChar, 100)     //9
            };
            parameters[0].Value  = mainInfo.Titel;
            parameters[1].Value  = mainInfo.LoginName;
            parameters[2].Value  = mainInfo.typeID;
            parameters[3].Value  = mainInfo.htmlUrl;
            parameters[4].Value  = mainInfo.FromId;
            parameters[5].Value  = mainInfo.recommendId;
            parameters[6].Value  = viewInfo.CountryCode;
            parameters[7].Value  = viewInfo.ProvinceID;
            parameters[8].Value  = viewInfo.CityID;
            parameters[9].Value  = viewInfo.CountyID;
            parameters[10].Value = viewInfo.position;
            parameters[11].Value = viewInfo.servicetypeID;
            parameters[12].Value = viewInfo.talentsTypeID;
            parameters[13].Value = viewInfo.resume;
            parameters[14].Value = viewInfo.specialty;
            parameters[15].Value = viewInfo.ScuccCase;
            parameters[16].Value = viewInfo.companydate;


            parameters[17].Value = viewInfo.validityID;
            parameters[18].Value = viewInfo.title;
            parameters[19].Value = viewInfo.keywords;
            parameters[20].Value = viewInfo.Webdescription;
            parameters[21].Value = link.UserName;
            parameters[22].Value = link.CompanyName;
            parameters[23].Value = link.Address;
            parameters[24].Value = link.Tel;
            parameters[25].Value = link.phone;
            parameters[26].Value = link.Fax;
            parameters[27].Value = link.Email;
            parameters[28].Value = link.Site;
            parameters[29].Value = mainInfo.price;
            parameters[30].Value = viewInfo.Images;
            return(DbHelperSQL.RunProcLob("Professionaltalentstab_insert", parameters));
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Professionaltalents GetModel(int ProfessionalID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 talentsID,ProfessionalID,CountryCode,images,ProvinceID,CityID,CountyID,position,servicetypeID,talentsTypeID,resume,specialty,ScuccCase,companydate,validityID,title,keywords,Webdescription from Professionaltalents ");
            strSql.Append(" where ProfessionalID=@talentsID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@talentsID", SqlDbType.Int, 4)
            };
            parameters[0].Value = ProfessionalID;

            Professionaltalents model = new Professionaltalents();
            DataSet             ds    = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["talentsID"].ToString() != "")
                {
                    model.talentsID = int.Parse(ds.Tables[0].Rows[0]["talentsID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ProfessionalID"].ToString() != "")
                {
                    model.ProfessionalID = int.Parse(ds.Tables[0].Rows[0]["ProfessionalID"].ToString());
                }
                model.CountryCode = ds.Tables[0].Rows[0]["CountryCode"].ToString();
                model.ProvinceID  = ds.Tables[0].Rows[0]["ProvinceID"].ToString();
                model.CityID      = ds.Tables[0].Rows[0]["CityID"].ToString();
                model.CountyID    = ds.Tables[0].Rows[0]["CountyID"].ToString();
                model.position    = ds.Tables[0].Rows[0]["position"].ToString();
                if (ds.Tables[0].Rows[0]["servicetypeID"].ToString() != "")
                {
                    model.servicetypeID = int.Parse(ds.Tables[0].Rows[0]["servicetypeID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["talentsTypeID"].ToString() != "")
                {
                    model.talentsTypeID = int.Parse(ds.Tables[0].Rows[0]["talentsTypeID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["images"].ToString() != "")
                {
                    model.Images = ds.Tables[0].Rows[0]["images"].ToString();
                }
                model.resume    = ds.Tables[0].Rows[0]["resume"].ToString();
                model.specialty = ds.Tables[0].Rows[0]["specialty"].ToString();
                model.ScuccCase = ds.Tables[0].Rows[0]["ScuccCase"].ToString();
                if (ds.Tables[0].Rows[0]["companydate"].ToString() != "")
                {
                    model.companydate = DateTime.Parse(ds.Tables[0].Rows[0]["companydate"].ToString());
                }
                if (ds.Tables[0].Rows[0]["validityID"].ToString() != "")
                {
                    model.validityID = int.Parse(ds.Tables[0].Rows[0]["validityID"].ToString());
                }
                model.title          = ds.Tables[0].Rows[0]["title"].ToString();
                model.keywords       = ds.Tables[0].Rows[0]["keywords"].ToString();
                model.Webdescription = ds.Tables[0].Rows[0]["Webdescription"].ToString();
                return(model);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 3
0
    protected void btnOk_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(this.txtTitle.Text))
        {
            Tz888.Common.MessageBox.Show(this.Page, "请填写标题!");
            return;
        }

        if (this.DropIndustry.SelectedValue == "" || this.DropIndustry.SelectedValue == "0")
        {
            Tz888.Common.MessageBox.Show(this.Page, "请选择人才类别!");
            return;
        }
        if (this.ddlServiceType.SelectedValue == "")
        {
            Tz888.Common.MessageBox.Show(this.Page, "服务类型不能为空!");
            return;
        }
        //if (!string.IsNullOrEmpty(uploadPic.FileName))
        //{
        //    string fileName1 = uploadPic.FileName;
        //    string extendName = fileName1.ToLower().Substring(fileName1.LastIndexOf("."));
        //    if (extendName != ".bmp" && extendName != ".gif" && extendName != ".jpg")
        //    {
        //        Tz888.Common.MessageBox.Show(this.Page, "只能上传|jpg|gif|bmp|格式的图片!");
        //        return;
        //    }
        //}
        if (txtPosition.Value == "")
        {
            Tz888.Common.MessageBox.Show(this.Page, "职务不能为空!");
            return;
        }
        if (txtLinkMan.Value.Trim() == "")
        {
            Tz888.Common.MessageBox.Show(this.Page, "联系人不能为空!");
            return;
        }
        if (txtCompanyName.Value.Trim() == "")
        {
            Tz888.Common.MessageBox.Show(this.Page, "公司名称不能为空!");
            return;
        }
        if (txtLinkTel.Text.Trim() == "" && txtPhone.Text.Trim() == "")
        {
            Tz888.Common.MessageBox.Show(this.Page, "联系人电话和手机至少填一个!");
            return;
        }
        else
        {
            if (txtLinkTel.Text.Trim() != "")
            {
                if (!PageValidate.IsNumber(txtLinkTel.Text.Trim()))
                {
                    Tz888.Common.MessageBox.Show(this.Page, "联系人电话格式错误!");
                    return;
                }
            }
        }

        if (txtEmail.Value.Trim() == "")
        {
            Tz888.Common.MessageBox.Show(this.Page, "Email不能为空!!");
            return;
        }
        if (txtEmail.Value.Trim() != "")
        {
            if (!PageValidate.IsEmail(txtEmail.Value.ToLower().Trim()))
            {
                Tz888.Common.MessageBox.Show(this.Page, "Email地址格式错误!");
                return;
            }
        }
        Professionaltalents please   = new Professionaltalents();
        ProfessionalinfoTab MainInfo = new ProfessionalinfoTab();
        ProfessionalLink    link     = new ProfessionalLink();


        if (!string.IsNullOrEmpty(Request.QueryString["ProfessionalID"]))
        {
            int ProfessionalID = int.Parse(Request.QueryString["ProfessionalID"].ToString());
            MainInfo.ProfessionalID = ProfessionalID;
        }
        if (!string.IsNullOrEmpty(ViewState["strSavePath"].ToString()))
        {
            please.Images = ViewState["strSavePath"].ToString();
        }
        else
        {
            please.Images = "/dservice/image/photo.jpg";
        }
        please.CountryCode   = this.ZoneSelectControl1.CountryID;
        please.ProvinceID    = this.ZoneSelectControl1.ProvinceID;
        please.CityID        = this.ZoneSelectControl1.CityID;
        please.CountyID      = this.ZoneSelectControl1.CountyID;
        please.companydate   = Convert.ToDateTime(DateTime.Now.ToString()); //Convert.ToDateTime(txtRegistYear.Text.Trim().ToString());
        please.position      = txtPosition.Value.Trim();
        please.title         = "";
        please.servicetypeID = int.Parse(ddlServiceType.SelectedValue.ToString());  //服务类型
        please.talentsTypeID = int.Parse(DropIndustry.SelectedValue.ToString());    //人才类别
        please.resume        = txtresume.Text;                                      //个人简历
        please.specialty     = txtspecialty.Text;                                   //个人特长
        please.ScuccCase     = txtSuccess.Text;                                     //成功案例
        please.validityID    = int.Parse(rdlValiditeTerm.SelectedValue.ToString()); //有效期
        link.CompanyName     = txtCompanyName.Value.Trim();
        link.Email           = txtEmail.Value.Trim();
        link.Fax             = txtLinkFax.Value.Trim();
        string tel = string.Empty;

        if (!string.IsNullOrEmpty(txtcontactsTel.Text.Trim()))
        {
            tel = txtcontactsTel.Text.Trim() + ",";
        }
        else
        {
            tel = ",";
        }
        if (!string.IsNullOrEmpty(txtLinkTel.Text.Trim()))
        {
            tel += txtLinkTel.Text.Trim() + ",";
        }
        else
        {
            tel += ",";
        }
        if (!string.IsNullOrEmpty(txttel2.Text.Trim()))
        {
            tel += txttel2.Text.Trim() + ",";
        }
        else
        {
            tel += ",";
        }
        link.Tel             = tel;
        link.UserName        = txtLinkMan.Value.Trim();
        link.Site            = txtWebSite.Value.Trim();
        link.phone           = txtPhone.Text.Trim();
        link.Address         = txtAddress.Text.Trim();
        MainInfo.LoginName   = Page.User.Identity.Name;
        MainInfo.Titel       = txtTitle.Text.Trim();
        MainInfo.typeID      = 3;
        MainInfo.htmlUrl     = "";
        MainInfo.FromId      = 1;
        MainInfo.recommendId = 0;
        MainInfo.price       = 0;
        if (plBll.InsertProFessionlView(MainInfo, please, link))
        {
            Response.Write("<script>alert('发布成功!');document.location='ServiesManage.aspx'</script>");
        }
        else
        {
            Tz888.Common.MessageBox.Show(this.Page, "发布失败!");
        }
    }
    protected void databindList(int ProfessionalID)
    {
        Professionaltalents plModel   = plBll.GetModel(ProfessionalID);
        ProfessionalLink    linkModel = linkBll.GetModel(ProfessionalID);
        ProfessionalinfoTab inModel   = infoBll.GetModel(ProfessionalID);

        txtTitle.Text = inModel.Titel.ToString();
        txtPrice.Text = inModel.price.ToString();
        if (!string.IsNullOrEmpty(plModel.Images))
        {
            if (plModel.Images.Equals("/dservice/image/photo.jpg"))
            {
                ViewState["flag"] = "true"; //默认图片
            }
            else
            {
                ViewState["strSavePath"] = plModel.Images;
            }
            Image1.ImageUrl = "http://www.topfo.com" + plModel.Images;

            //Image1.ImageUrl = "F:/Topfo" + plModel.Images;////本地
            imageDis.Attributes.Add("style", "display:''");
        }
        else
        {
            //DateTime Now = DateTime.Now;
            ViewState["strSavePath"] = "/dservice/image/photo.jpg";
            //ViewState["strSavePath"] = "/dservice/image/" + Now.Year.ToString() + "/" + Now.Year.ToString() + Now.Month.ToString() + Now.Day.ToString() +
            //   Now.Hour.ToString() + Now.Minute.ToString() + Now.Second.ToString() + ".jpg";
            imageDis.Attributes.Add("style", "display:none");
        }

        this.ZoneSelectControl1.CountryID  = plModel.CountryCode;
        this.ZoneSelectControl1.ProvinceID = plModel.ProvinceID;
        this.ZoneSelectControl1.CityID     = plModel.CityID;
        this.ZoneSelectControl1.CountyID   = plModel.CountyID;
        txtRegistYear.Text            = plModel.companydate.ToString("yyyy-MM-dd");
        txtPosition.Value             = plModel.position;                 //职务
        DropIndustry.SelectedValue    = plModel.talentsTypeID.ToString(); //人才类别
        txtRegistYear.Text            = plModel.companydate.ToString("yyyy-MM-dd");
        txtresume.Text                = plModel.resume;                   //个人简历
        txtspecialty.Text             = plModel.specialty;                //个人特长
        txtSuccess.Text               = plModel.ScuccCase;                //成功案例
        ddlServiceType.SelectedValue  = plModel.servicetypeID.ToString(); //服务类型
        rdlValiditeTerm.SelectedValue = plModel.validityID.ToString();    //有效期
        txtAddress.Text               = linkModel.Address;
        txtLinkMan.Text               = linkModel.UserName;
        txtPhone.Text         = linkModel.phone;
        txtCompany.Text       = linkModel.CompanyName;
        txtClick.Text         = inModel.clickId.ToString();
        txtEmail.Text         = linkModel.Email;
        txtFax.Text           = linkModel.Fax;
        tbAuditingRemark.Text = inModel.FeedBackNote;
        string tel = linkModel.Tel;

        string[] telLen = tel.Split(new char[] { ',' });
        if (telLen.Length == 1)
        {
            txtTel.Text = linkModel.Tel;
        }
        else
        {
            txtcontactsTel.Text = telLen[0].ToString();
            txtTel.Text         = telLen[1].ToString();
            txttel2.Text        = telLen[2].ToString();
        }

        txtSite.Text     = linkModel.Site;
        txtWtitle.Text   = plModel.title;
        txtKeyword1.Text = plModel.keywords;
        txtWebDesr.Text  = plModel.Webdescription;
        txtReTime.Text   = inModel.refreshTime.ToString("yyyy-MM-dd");
        //0未审核  1审核通过2审核未通过
        switch (int.Parse(inModel.auditId.ToString()))
        {
        case 0:
            rdAudit.Checked = true;
            Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", " ConAudit(0);", true);
            break;

        case 1:
            rdPass.Checked = true;
            Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", " ConAudit(1);", true);
            break;

        case 2:
            rdNopass.Checked = true;
            Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", " ConAudit(2);", true);
            break;

        case 4:
            rdDelete.Checked = true;
            rdPass.Enabled   = false;
            rdAudit.Enabled  = false;
            rdNopass.Enabled = false;
            Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", " ConAudit(0);", true);
            break;

        default:
            rdAudit.Checked = true;
            Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", " ConAudit(0);", true);
            break;
        }
        if (inModel.chargeId == 0)
        {
            rdomian.Checked = true;
            spShowPoint.Attributes.Add("style", "display:none");
        }
        else
        {
            rdoShou.Checked = true;
            spShowPoint.Attributes.Add("style", "display:''");
        }
    }
    //审核
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        ProfessionalinfoTab MainInfo = new ProfessionalinfoTab();
        Professionaltalents viewInfo = new Professionaltalents();

        ProfessionalLink personInfo = new ProfessionalLink();

        if (!string.IsNullOrEmpty(Request.QueryString["ProfessionalID"]))
        {
            int ProfessionalID = int.Parse(Request.QueryString["ProfessionalID"].ToString());
            MainInfo.ProfessionalID = ProfessionalID;
            viewInfo = plBll.GetModel(ProfessionalID);
        }
        MainInfo.Titel = txtTitle.Text.Trim();
        //0未审核  1审核通过2审核未通过
        if (rdPass.Checked)
        {
            MainInfo.auditId = 1;
        }
        else if (rdAudit.Checked)
        {
            MainInfo.auditId = 0;
        }
        else if (rdNopass.Checked)
        {
            MainInfo.auditId = 2;
        }
        else
        {
            MainInfo.auditId = 4;
        }
        //是否收费 0 免费 1收费
        // if (rdomian.Checked) { MainInfo.chargeId = 0; } else { MainInfo.chargeId = 1; }
        //来源 1 会员中心  2 业务员
        //MainInfo.FromId = int.Parse(ddlFrom.SelectedValue.ToString());
        //类型 1 需要服务2提供专业 3专业人才
        //if (rdoService.Checked) { MainInfo.typeID = 1; } else if (rdoPress.Checked) { MainInfo.typeID = 2; } else { MainInfo.typeID = 3; }
        //状态 0无效 1有效 2已过期
        //if (rdoNoEnable.Checked) { MainInfo.stateId = 0; } else if (rdoYesEnable.Checked) { MainInfo.stateId = 1; } else { MainInfo.stateId = 2; }
        //是否推荐  不推荐 0  推荐  1
        //if (rdoYesAct.Checked) { MainInfo.recommendId = 1; } else { MainInfo.recommendId = 0; }
        MainInfo.price       = Convert.ToDecimal(txtPrice.Text.ToString());
        MainInfo.refreshTime = Convert.ToDateTime(txtReTime.Text.Trim().ToString());
        MainInfo.clickId     = int.Parse(txtClick.Text.Trim().ToString());
        MainInfo.Titel       = txtTitle.Text.Trim();

        if (!string.IsNullOrEmpty(viewInfo.Images))
        {
            if (!string.IsNullOrEmpty(ViewState["strSavePath"].ToString()))
            {
                viewInfo.Images = ViewState["strSavePath"].ToString();
            }
        }
        else
        {
            viewInfo.Images = ViewState["strSavePath"].ToString();
        }
        MainInfo.typeID       = 3;
        MainInfo.FeedBackNote = tbAuditingRemark.Text.Trim();
        MainInfo.htmlUrl      = "dservice/" + DateTime.Now.ToString("yyyyMM") + "/dservice" + DateTime.Now.ToString("yyyyMMdd") + "_" + Request.QueryString["ProfessionalID"].ToString() + ".shtml";
        viewInfo.CountryCode  = this.ZoneSelectControl1.CountryID;
        viewInfo.ProvinceID   = this.ZoneSelectControl1.ProvinceID;
        viewInfo.CityID       = this.ZoneSelectControl1.CityID;
        viewInfo.CountyID     = this.ZoneSelectControl1.CountyID;
        viewInfo.companydate  = Convert.ToDateTime(txtRegistYear.Text.Trim().ToString());

        viewInfo.position      = txtPosition.Value.Trim();
        viewInfo.servicetypeID = int.Parse(ddlServiceType.SelectedValue.ToString()); //服务类型
        viewInfo.talentsTypeID = int.Parse(DropIndustry.SelectedValue.ToString());   //人才类别
        viewInfo.resume        = txtresume.Text;                                     //个人简历
        viewInfo.specialty     = txtspecialty.Text;                                  //个人特长
        viewInfo.ScuccCase     = txtSuccess.Text;                                    //成功案例

        viewInfo.title          = txtWtitle.Text.Trim();
        viewInfo.keywords       = txtKeyword1.Text.Trim();
        viewInfo.Webdescription = txtWebDesr.Text.Trim();
        viewInfo.validityID     = int.Parse(rdlValiditeTerm.SelectedValue.ToString());//有效期
        personInfo.Address      = txtAddress.Text.Trim();
        personInfo.CompanyName  = txtCompany.Text.Trim();
        personInfo.Email        = txtEmail.Text.Trim();
        personInfo.Fax          = txtFax.Text.Trim();
        personInfo.phone        = txtPhone.Text.Trim();

        string tel = string.Empty;

        if (!string.IsNullOrEmpty(txtcontactsTel.Text.Trim()))
        {
            tel = txtcontactsTel.Text.Trim() + ",";
        }
        else
        {
            tel = ",";
        }
        if (!string.IsNullOrEmpty(txtTel.Text.Trim()))
        {
            tel += txtTel.Text.Trim() + ",";
        }
        else
        {
            tel += ",";
        }
        if (!string.IsNullOrEmpty(txttel2.Text.Trim()))
        {
            tel += txttel2.Text.Trim() + ",";
        }
        else
        {
            tel += ",";
        }
        personInfo.Tel = tel;

        personInfo.UserName = txtLinkMan.Text.Trim();
        personInfo.Site     = txtSite.Text.Trim();
        if (plBll.UpdateProFessionlView(MainInfo, viewInfo, personInfo))
        {
            if (rdPass.Checked)
            {
                PageStaticTalents stat = new PageStaticTalents();
                int result             = stat.StaticHtml(int.Parse(Request.QueryString["ProfessionalID"].ToString()));
                if (result <= 0)
                {
                    Tz888.Common.MessageBox.Show(this.Page, "生成静态页面失败");
                }
            }
            Response.Write("<script>alert('审核成功!');document.location='ProfessionalManage.aspx'</script>");
        }
        else
        {
            Tz888.Common.MessageBox.Show(this.Page, "审核失败!");
        }
    }
 /// <summary>
 /// 修改一条专业人才数据
 /// </summary>
 /// <returns></returns>
 public bool UpdateProFessionlView(ProfessionalinfoTab mainInfo, Professionaltalents viewInfo, ProfessionalLink link)
 {
     return(dal.UpdateProFessionlView(mainInfo, viewInfo, link));
 }
Esempio n. 7
0
        public int StaticHtml(int professionalid)
        {
            try
            {
                infoModel = infoBll.GetModel(professionalid);
                linkModel = linkBll.GetModel(professionalid);
                plModel   = viewBll.GetModel(professionalid);
                string TempFileName = CasesTem.ToString();
                string Tem          = Compage.Reader(TempFileName);                                                                   //读取模板内容
                string TempSoure    = Tem;
                string ProviceName  = linkBll.GetProvinceNameByCode(plModel.ProvinceID.ToString()).Trim();                            //区域
                //string typeName = typeBll.GetList("institutionsID=" + plModel.institutionsID).Tables[0].Rows[0]["TypeName"].ToString();   //机构类别
                string typeName    = talentsType.GetList("typeID=" + plModel.talentsTypeID).Tables[0].Rows[0]["TypeName"].ToString(); //人才类别
                string Servicetype = typeBll1.GetModel(int.Parse(plModel.servicetypeID.ToString())).typeName;
                if (ProviceName.Trim() == "")
                {
                    ProviceName = "中国";
                }

                string price = string.Empty;
                if (infoModel.chargeId == 0)
                {
                    price = "免费资源";
                }
                else
                {
                    price = infoModel.price + "元";
                }
                string xiangxi = GetTop3Data(plModel.ProvinceID.ToString());
                string desc    = Gettop6Data();
                TempSoure = TempSoure.Replace("$ProfessionalID$", infoModel.ProfessionalID.ToString().Trim());
                TempSoure = TempSoure.Replace("$title$", linkModel.UserName.ToString());
                TempSoure = TempSoure.Replace("$AreaName$", ProviceName);
                TempSoure = TempSoure.Replace("$type$", typeName);
                TempSoure = TempSoure.Replace("$typeName$", Servicetype);
                TempSoure = TempSoure.Replace("$position$", plModel.position.ToString());
                TempSoure = TempSoure.Replace("$resume$ ", plModel.resume.ToString());
                TempSoure = TempSoure.Replace("$CreateTime$", plModel.companydate.ToString("yyyy-MM-dd"));//创建时间
                TempSoure = TempSoure.Replace("$specialty$", plModel.specialty.ToString());
                TempSoure = TempSoure.Replace("$ScuccCase$ ", plModel.ScuccCase.ToString());
                TempSoure = TempSoure.Replace("$KeyWord$", plModel.keywords.ToString().Trim());
                TempSoure = TempSoure.Replace("$DisplayTitle$", plModel.title.ToString().Trim());
                TempSoure = TempSoure.Replace("$image$", "http://www.topfo.com" + plModel.Images.ToString().Trim());
                TempSoure = TempSoure.Replace("$CompanyName$", linkModel.CompanyName.ToString().Trim());
                TempSoure = TempSoure.Replace("$Content$", xiangxi);//相关项目信息
                TempSoure = TempSoure.Replace("$Content2$", desc);
                string inPathTo = "/dservice";
                if (string.IsNullOrEmpty(infoModel.htmlUrl))
                {
                    infoModel.htmlUrl = "dservice/" + DateTime.Now.ToString("yyyyMM") + "/dservice" + DateTime.Now.ToString("yyyyMMdd") + "_" + professionalid + ".shtml";
                }
                string   htmlFile = infoModel.htmlUrl.ToString().Trim();
                string[] html     = htmlFile.Split('/');
                string[] nn       = html[2].Split('_');
                string   cc       = nn[0].Substring(nn[0].Length - 8);

                string folder = ProPath + html[1].Replace("dservice", "");
                if (Directory.Exists(folder) == false)
                {
                    Directory.CreateDirectory(folder);
                }
                string htmlpaths = folder + inPathTo + cc + "_" + professionalid + ".shtml";
                Compage.Writer(htmlpaths, TempSoure);
                return(1);
            }
            catch (Exception)
            {
                return(0);
            }
        }