protected void databindList(int ProfessionalID) { ProfessionalPlease plModel = plBll.GetModel(ProfessionalID); ProfessionalLink linkModel = linkBll.GetModel(ProfessionalID); ProfessionalinfoTab inModel = infoBll.GetModel(ProfessionalID); txtTitle.Text = inModel.Titel.ToString(); this.ZoneSelectControl1.CountryID = plModel.CountryCode; this.ZoneSelectControl1.ProvinceID = plModel.ProvinceID; this.ZoneSelectControl1.CityID = plModel.CityID; this.ZoneSelectControl1.CountyID = plModel.CountyID; txtBusinesDetails.Text = plModel.description; txtRegistYear.Text = plModel.companydate.ToString("yyyy-MM-dd"); ddlServiceType.SelectedValue = plModel.servicetypeID.ToString(); //服务类型 DropIndustry.SelectedValue = plModel.institutionsID.ToString(); //机构类别 txtEmployeeCount.Value = plModel.Enterprisesize; //企业规模 txtRegistMoeny.Value = plModel.funds; //注册资金 txtTurnover.Value = plModel.turnover; //营业额 rdlValiditeTerm.SelectedValue = plModel.validityID.ToString(); //有效期 txtAddress.Text = linkModel.Address; txtLinkMan.Value = linkModel.UserName; txtPhone.Text = linkModel.phone; txtCompanyName.Value = linkModel.CompanyName; txtEmail.Value = linkModel.Email; txtLinkFax.Value = linkModel.Fax; txtLinkTel.Value = linkModel.Tel; txtWebSite.Value = linkModel.Site; }
/// <summary> /// 得到一个对象实体 /// </summary> public ProfessionalPlease GetModel(int ProfessionalID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 provideID,ProfessionalID,CountryCode,ProvinceID,CityID,CountyID,servicetypeID,institutionsID,Enterprisesize,funds,turnover,companydate,validityID,description,title,keywords,webdescription from ProfessionalPlease "); strSql.Append(" where ProfessionalID=@ProfessionalID"); SqlParameter[] parameters = { new SqlParameter("@ProfessionalID", SqlDbType.Int, 4) }; parameters[0].Value = ProfessionalID; ProfessionalPlease model = new ProfessionalPlease(); DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["provideID"].ToString() != "") { model.provideID = int.Parse(ds.Tables[0].Rows[0]["provideID"].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(); 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]["institutionsID"].ToString() != "") { model.institutionsID = int.Parse(ds.Tables[0].Rows[0]["institutionsID"].ToString()); } model.Enterprisesize = ds.Tables[0].Rows[0]["Enterprisesize"].ToString(); model.funds = ds.Tables[0].Rows[0]["funds"].ToString(); model.turnover = ds.Tables[0].Rows[0]["turnover"].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.description = ds.Tables[0].Rows[0]["description"].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); } }
/// <summary> /// 插入一条专业服务数据 /// </summary> /// <returns></returns> public bool InsertProFessionlView(ProfessionalinfoTab mainInfo, ProfessionalPlease 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("@servicetypeID", SqlDbType.Int, 4), new SqlParameter("@validityID", SqlDbType.Int, 4), new SqlParameter("@description", SqlDbType.NVarChar, 2000), new SqlParameter("@Webtitle", SqlDbType.VarChar, 50), new SqlParameter("@keywords", SqlDbType.VarChar, 50), new SqlParameter("@Webdescription", SqlDbType.VarChar, 50), //10 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("@institutionsID", SqlDbType.Int, 4), new SqlParameter("@Enterprisesize", SqlDbType.NVarChar, 2000), new SqlParameter("@funds", SqlDbType.VarChar, 50), new SqlParameter("@turnover", SqlDbType.VarChar, 50), new SqlParameter("@companyDate", SqlDbType.DateTime) //5 }; 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.servicetypeID; parameters[11].Value = viewInfo.validityID; parameters[12].Value = viewInfo.description; parameters[13].Value = viewInfo.title; parameters[14].Value = viewInfo.keywords; parameters[15].Value = viewInfo.description; parameters[16].Value = link.UserName; parameters[17].Value = link.CompanyName; parameters[18].Value = link.Address; parameters[19].Value = link.Tel; parameters[20].Value = link.phone; parameters[21].Value = link.Fax; parameters[22].Value = link.Email; parameters[23].Value = link.Site; parameters[24].Value = mainInfo.price; parameters[25].Value = viewInfo.institutionsID; parameters[26].Value = viewInfo.Enterprisesize; parameters[27].Value = viewInfo.funds; parameters[28].Value = viewInfo.turnover; parameters[29].Value = viewInfo.companydate; return(DbHelperSQL.RunProcLob("ProfessionalPleasetab_insert", parameters)); }
protected void databindList(int ProfessionalID) { ProfessionalPlease plModel = plBll.GetModel(ProfessionalID); ProfessionalLink linkModel = linkBll.GetModel(ProfessionalID); ProfessionalinfoTab inModel = infoBll.GetModel(ProfessionalID); txtTitle.Text = inModel.Titel.ToString(); txtPrice.Text = inModel.price.ToString(); tbAuditingRemark.Text = inModel.FeedBackNote; this.ZoneSelectControl1.CountryID = plModel.CountryCode; this.ZoneSelectControl1.ProvinceID = plModel.ProvinceID; this.ZoneSelectControl1.CityID = plModel.CityID; this.ZoneSelectControl1.CountyID = plModel.CountyID; txtContent.Text = plModel.description; txtRegistYear.Text = plModel.companydate.ToString("yyyy-MM-dd"); ddlServiceType.SelectedValue = plModel.servicetypeID.ToString(); //服务类型 DropIndustry.SelectedValue = plModel.institutionsID.ToString(); //机构类别 txtEmployeeCount.Value = plModel.Enterprisesize; //企业规模 txtRegistMoeny.Value = plModel.funds; //注册资金 txtTurnover.Value = plModel.turnover; //营业额 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; 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(); ProfessionalPlease viewInfo = new ProfessionalPlease(); ProfessionalLink personInfo = new ProfessionalLink(); if (!string.IsNullOrEmpty(Request.QueryString["ProfessionalID"])) { int ProfessionalID = int.Parse(Request.QueryString["ProfessionalID"].ToString()); MainInfo.ProfessionalID = 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(); MainInfo.FeedBackNote = tbAuditingRemark.Text.Trim(); MainInfo.typeID = 2; 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.description = txtContent.Text.Trim(); viewInfo.companydate = Convert.ToDateTime(txtRegistYear.Text.Trim().ToString()); viewInfo.servicetypeID = int.Parse(ddlServiceType.SelectedValue.ToString()); //服务类型 viewInfo.institutionsID = int.Parse(DropIndustry.SelectedValue.ToString()); //机构类别 viewInfo.Enterprisesize = txtEmployeeCount.Value.Trim(); //企业规模 viewInfo.funds = txtRegistMoeny.Value.Trim(); //注册资金 viewInfo.turnover = txtTurnover.Value.Trim(); //营业额 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) { PageStaticOrg stat = new PageStaticOrg(); 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, "审核失败!"); } }
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 (txtEmployeeCount.Value != "") { if (!PageValidate.IsNumber(txtEmployeeCount.Value)) { Tz888.Common.MessageBox.Show(this.Page, "企业规模请填写数字!"); return; } } if (txtRegistMoeny.Value != "") { if (!PageValidate.IsNumber(txtRegistMoeny.Value)) { Tz888.Common.MessageBox.Show(this.Page, "注册资金请填写数字!"); return; } } //if (txtRegistYear.Text == "") //{ // Tz888.Common.MessageBox.Show(this.Page, "创建时间请填写!"); // return; //} if (txtTurnover.Value != "") { if (!PageValidate.IsNumber(txtTurnover.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.Value.Trim() == "") //{ // Tz888.Common.MessageBox.Show(this.Page, "联系人电话不能为空!"); // return; //} if (txtLinkTel.Value.Trim() == "" && txtPhone.Text.Trim() == "") { Tz888.Common.MessageBox.Show(this.Page, "联系人电话和手机至少填一个!"); return; } else { if (txtLinkTel.Value.Trim() != "") { if (!PageValidate.IsNumber(txtLinkTel.Value.Trim())) { Tz888.Common.MessageBox.Show(this.Page, "联系人电话格式错误!"); return; } } } if (txtEmail.Value.Trim() != "") { if (!PageValidate.IsEmail(txtEmail.Value.ToLower().Trim())) { Tz888.Common.MessageBox.Show(this.Page, "Email地址格式错误!"); return; } } ProfessionalPlease please = new ProfessionalPlease(); ProfessionalinfoTab MainInfo = new ProfessionalinfoTab(); if (!string.IsNullOrEmpty(Request.QueryString["ProfessionalID"])) { int ProfessionalID = int.Parse(Request.QueryString["ProfessionalID"].ToString()); MainInfo.ProfessionalID = ProfessionalID; } ProfessionalLink link = new ProfessionalLink(); please.CountryCode = this.ZoneSelectControl1.CountryID; please.ProvinceID = this.ZoneSelectControl1.ProvinceID; please.CityID = this.ZoneSelectControl1.CityID; please.CountyID = this.ZoneSelectControl1.CountyID; please.description = txtBusinesDetails.Text.Trim(); please.companydate = Convert.ToDateTime(txtRegistYear.Text.Trim().ToString()); please.servicetypeID = int.Parse(ddlServiceType.SelectedValue.ToString()); //服务类型 please.institutionsID = int.Parse(DropIndustry.SelectedValue.ToString()); //机构类别 please.Enterprisesize = txtEmployeeCount.Value.Trim(); //企业规模 please.funds = txtRegistMoeny.Value.Trim(); //注册资金 please.turnover = txtTurnover.Value.Trim(); //营业额 please.validityID = int.Parse(rdlValiditeTerm.SelectedValue.ToString()); //有效期 link.CompanyName = txtCompanyName.Value.Trim(); link.Email = txtEmail.Value.Trim(); link.Fax = txtLinkFax.Value.Trim(); link.Tel = txtLinkTel.Value.Trim(); link.UserName = txtLinkMan.Value.Trim(); link.Site = txtWebSite.Value.Trim(); link.Address = txtAddress.Text.Trim(); link.phone = txtPhone.Text.Trim(); MainInfo.Titel = txtTitle.Text.Trim(); MainInfo.LoginName = Page.User.Identity.Name; if (plBll.UpdateProFessionlView(MainInfo, please, link)) { Response.Write("<script>alert('修改成功!');document.location='ServiesManage.aspx'</script>"); } else { Tz888.Common.MessageBox.Show(this.Page, "修改失败!"); } }
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(); //机构类别 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$", infoModel.Titel.ToString().Trim()); TempSoure = TempSoure.Replace("$AreaName$", ProviceName); TempSoure = TempSoure.Replace("$typeName$", typeName); TempSoure = TempSoure.Replace("$Enterprisesize$", plModel.Enterprisesize); //企业规模 TempSoure = TempSoure.Replace("$funds$", plModel.funds); //注册资金 TempSoure = TempSoure.Replace("$CreateTime$", plModel.companydate.ToString("yyyy-MM-dd")); //创建时间 TempSoure = TempSoure.Replace("$turnover$", plModel.turnover); //营业额 TempSoure = TempSoure.Replace("$charge$", price); //资源类型 TempSoure = TempSoure.Replace("$Content1$", plModel.description.ToString()); TempSoure = TempSoure.Replace("$KeyWord$", plModel.keywords.ToString().Trim()); TempSoure = TempSoure.Replace("$DisplayTitle$", plModel.title.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); } }
public bool UpdateProFessionlView(ProfessionalinfoTab mainInfo, ProfessionalPlease viewInfo, ProfessionalLink link) { return(dal.UpdateProFessionlView(mainInfo, viewInfo, link)); }