/// <summary> /// 得到一个对象实体 /// </summary> public Professionalview GetModel(int pvid) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 pvid,ProfessionalID,CountryCode,ProvinceID,CityID,CountyID,typeID,validityID,description,title,keywords,Webdescription from Professionalview "); strSql.Append(" where ProfessionalID=@pvid"); SqlParameter[] parameters = { new SqlParameter("@pvid", SqlDbType.Int, 4) }; parameters[0].Value = pvid; Professionalview model = new Professionalview(); DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["pvid"].ToString() != "") { model.pvid = int.Parse(ds.Tables[0].Rows[0]["pvid"].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]["typeID"].ToString() != "") { model.typeID = int.Parse(ds.Tables[0].Rows[0]["typeID"].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); } }
public bool UpdateProFessionlView(ProfessionalinfoTab mainInfo, Professionalview 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("@typeID1", 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), //8 new SqlParameter("@price", SqlDbType.Decimal, 18), //1 new SqlParameter("@flag", SqlDbType.VarChar, 20), new SqlParameter("@ProfessionalID", SqlDbType.Int, 4) //2 }; 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.typeID; parameters[11].Value = viewInfo.validityID; parameters[12].Value = viewInfo.description; parameters[13].Value = viewInfo.title; parameters[14].Value = viewInfo.keywords; parameters[15].Value = viewInfo.Webdescription; 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 = "Update"; parameters[26].Value = mainInfo.ProfessionalID; return(DbHelperSQL.RunProcLob("Professionalviewtab_insert", parameters)); }
//审核 protected void btnSubmit_Click(object sender, EventArgs e) { ProfessionalinfoTab MainInfo = new ProfessionalinfoTab(); Professionalview viewInfo = new Professionalview(); ProfessionalLink personInfo = new ProfessionalLink(); if (!string.IsNullOrEmpty(Request.QueryString["ProfessionalID"])) { int ProfessionalID = int.Parse(Request.QueryString["ProfessionalID"].ToString()); MainInfo.ProfessionalID = ProfessionalID; MainInfo = infoBll.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.FeedBackNote = tbAuditingRemark.Text.Trim(); MainInfo.clickId = int.Parse(txtClick.Text.Trim().ToString()); MainInfo.Titel = txtTitle.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.description = txtContent.Text.Trim(); viewInfo.title = txtWtitle.Text.Trim(); viewInfo.keywords = txtKeyword1.Text.Trim(); viewInfo.Webdescription = txtWebDesr.Text.Trim(); viewInfo.validityID = int.Parse(rdlValiditeTerm.SelectedValue.ToString()); viewInfo.typeID = int.Parse(ddlServiceType.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 (viewbll.UpdateProFessionlView(MainInfo, viewInfo, personInfo)) { if (rdPass.Checked) { Tz888.BLL.ProfessionalManage.PageStatic stat = new PageStatic(); 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 btnSubmit_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.txtTitle.Text)) { Tz888.Common.MessageBox.Show(this.Page, "请填写标题!"); return; } if (string.IsNullOrEmpty(this.ddlServiceType.SelectedValue)) { Tz888.Common.MessageBox.Show(this.Page, "请选择服务大类!"); return; } //if (string.IsNullOrEmpty(this.slServerMDrop.SelectedValue)) //{ // Tz888.Common.MessageBox.Show(this.Page, "请选择服务小类!"); // return; //} if (string.IsNullOrEmpty(this.txtContent.Text)) { Tz888.Common.MessageBox.Show(this.Page, "请填写说明!"); return; } if (string.IsNullOrEmpty(this.txtLinkMan.Text)) { Tz888.Common.MessageBox.Show(this.Page, "请填写申请人!"); return; } if (string.IsNullOrEmpty(this.txtCompany.Text)) { Tz888.Common.MessageBox.Show(this.Page, "请填写单位名称!"); return; } //if (string.IsNullOrEmpty(this.txtTel.Text)) //{ // Tz888.Common.MessageBox.Show(this.Page, "请填写联系电话!"); // return; //} if (txtTel.Text.Trim() == "" && txtPhone.Text.Trim() == "") { Tz888.Common.MessageBox.Show(this.Page, "联系人电话和手机至少填一个!"); return; } else { if (txtTel.Text.Trim() != "") { if (!PageValidate.IsNumber(txtTel.Text.Trim())) { Tz888.Common.MessageBox.Show(this.Page, "联系人电话格式错误!"); return; } } } //if (string.IsNullOrEmpty(this.txtFax.Text)) //{ // Tz888.Common.MessageBox.Show(this.Page, "请填写传真号码!"); // return; //} if (txtEmail.Text.Trim() == "") { Tz888.Common.MessageBox.Show(this.Page, "Email不能为空!!"); return; } if (txtEmail.Text.Trim() != "") { if (!PageValidate.IsEmail(txtEmail.Text.ToLower().Trim())) { Tz888.Common.MessageBox.Show(this.Page, "Email地址格式错误!"); return; } } ProfessionalinfoTab MainInfo = new ProfessionalinfoTab(); Professionalview viewInfo = new Professionalview(); ProfessionalLink personInfo = new ProfessionalLink(); MainInfo.LoginName = Page.User.Identity.Name; MainInfo.Titel = txtTitle.Text.Trim(); MainInfo.typeID = 1; //MainInfo.auditId = 0; MainInfo.stateId = 0; MainInfo.chargeId = 0;MainInfo.clickId = 0; //MainInfo.creatgeDate = Convert.ToDateTime(DateTime.Now.ToString());MainInfo.refreshTime= MainInfo.htmlUrl = ""; MainInfo.FromId = 1; MainInfo.recommendId = 0; MainInfo.price = 0; //Convert.ToDecimal(txtPrice.Text.Trim()); 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.title = ""; //txtTitle.Text.Trim(); viewInfo.keywords = ""; //txtKeyword1.Text.Trim(); viewInfo.Webdescription = ""; //txtWebDesr.Text.Trim(); viewInfo.validityID = int.Parse(rdlValiditeTerm.SelectedValue.ToString()); viewInfo.typeID = int.Parse(ddlServiceType.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(); personInfo.phone = txtPhone.Text.Trim(); if (viewbll.InsertProFessionlView(MainInfo, viewInfo, personInfo)) { Response.Write("<script>alert('发布成功!');document.location='ServiesManage.aspx'</script>"); } else { Tz888.Common.MessageBox.Show(this.Page, "发布失败!"); } }
/// <summary> /// 修改一条专业服务数据 /// </summary> /// <returns></returns> public bool UpdateProFessionlView(ProfessionalinfoTab mainInfo, Professionalview viewInfo, ProfessionalLink link) { return(dal.UpdateProFessionlView(mainInfo, viewInfo, link)); }
//修改 protected void btnSubmit_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.txtTitle.Text)) { Tz888.Common.MessageBox.Show(this.Page, "请填写标题!"); return; } if (string.IsNullOrEmpty(this.ddlServiceType.SelectedValue)) { Tz888.Common.MessageBox.Show(this.Page, "请选择服务大类!"); return; } //if (string.IsNullOrEmpty(this.slServerMDrop.SelectedValue)) //{ // Tz888.Common.MessageBox.Show(this.Page, "请选择服务小类!"); // return; //} if (string.IsNullOrEmpty(this.txtContent.Text)) { Tz888.Common.MessageBox.Show(this.Page, "请填写说明!"); return; } if (string.IsNullOrEmpty(this.txtCompany.Text)) { Tz888.Common.MessageBox.Show(this.Page, "请填写单位名称!"); return; } if (string.IsNullOrEmpty(this.txtLinkMan.Text)) { Tz888.Common.MessageBox.Show(this.Page, "请填写申请人!"); return; } if (txtTel.Text.Trim() == "" && txtPhone.Text.Trim() == "") { Tz888.Common.MessageBox.Show(this.Page, "联系人电话和手机至少填一个!"); return; } else { if (txtTel.Text.Trim() != "") { if (!PageValidate.IsNumber(txtTel.Text.Trim())) { Tz888.Common.MessageBox.Show(this.Page, "联系人电话格式错误!"); return; } } } if (txtEmail.Text.Trim() != "") { if (!PageValidate.IsEmail(txtEmail.Text.ToLower().Trim())) { Tz888.Common.MessageBox.Show(this.Page, "Email地址格式错误!"); return; } } ProfessionalinfoTab MainInfo = new ProfessionalinfoTab(); Professionalview viewInfo = new Professionalview(); 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(); 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.validityID = int.Parse(rdlValiditeTerm.SelectedValue.ToString()); viewInfo.typeID = int.Parse(ddlServiceType.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(); personInfo.Tel = txtTel.Text.Trim(); personInfo.UserName = txtLinkMan.Text.Trim(); personInfo.Site = txtSite.Text.Trim(); personInfo.phone = txtPhone.Text.Trim(); MainInfo.LoginName = Page.User.Identity.Name; if (viewbll.UpdateProFessionlView(MainInfo, viewInfo, personInfo)) { Response.Write("<script>alert('更新成功!');document.location='ServiesManage.aspx'</script>"); } else { Tz888.Common.MessageBox.Show(this.Page, "更新失败!"); } }
/// <summary> /// 插入一条专业服务数据 /// </summary> /// <returns></returns> public bool InsertProFessionlView(ProfessionalinfoTab mainInfo, Professionalview viewInfo, ProfessionalLink link) { return(viewIdal.InsertProFessionlView(mainInfo, viewInfo, link)); }
public int StaticHtml(int professionalid) { try { infoModel = infoBll.GetModel(professionalid); linkModel = linkBll.GetModel(professionalid); viewModel = viewBll.GetModel(professionalid); string TempFileName = CasesTem.ToString(); string Tem = Compage.Reader(TempFileName); //读取模板内容 string TempSoure = Tem; string ProviceName = linkBll.GetProvinceNameByCode(viewModel.ProvinceID.ToString()).Trim(); string typeName = typeBll.GetModel(viewModel.typeID).typeName; //服务类别 if (ProviceName.Trim() == "") { ProviceName = "中国"; } string systime = ""; if (viewModel.validityID == 3) { systime = "3个月"; } else if (viewModel.validityID == 6) { systime = "半年"; } else if (viewModel.validityID == 12) { systime = "1年"; } else if (viewModel.validityID == 24) { systime = "2年"; } else if (viewModel.validityID == 36) { systime = "3年"; } else if (viewModel.validityID == 60) { systime = "5年"; } string price = string.Empty; if (infoModel.chargeId == 0) { price = "免费资源"; } else { price = infoModel.price + "元"; } string xiangxi = GetTop3Data(viewModel.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("$publishT$", infoModel.creatgeDate.ToString().Substring(0, 9)); TempSoure = TempSoure.Replace("$validateID$", systime); TempSoure = TempSoure.Replace("$Content1$", viewModel.description.ToString().Trim()); TempSoure = TempSoure.Replace("$KeyWord$", viewModel.keywords.ToString().Trim()); TempSoure = TempSoure.Replace("$DisplayTitle$", viewModel.title.ToString().Trim()); TempSoure = TempSoure.Replace("$charge$", price); TempSoure = TempSoure.Replace("$CompanyName$", linkModel.CompanyName.ToString().Trim()); //TempSoure = TempSoure.Replace("$Info$", xiangxi); 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); } }