public int zfAddShow(CompanyShow model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into CompanyShow("); strSql.Append("UserName,UserPwd,TelPhone,Mobile,Email,Audit,StartTime,Valid,TypeName,RoleId,CompanyName,Countrycode,Provinceid,Cityid,Countyid,OrderId,Recomm,Industry)"); strSql.Append(" values ("); strSql.Append("@UserName,@UserPwd,@TelPhone,@Mobile,@Email,@Audit,@StartTime,@Valid,@TypeName,@RoleId,@CompanyName,@Countrycode,@Provinceid,@Cityid,@Countyid,@OrderId,@Recomm,@Industry)"); SqlParameter[] parameters = { new SqlParameter("@UserName", SqlDbType.VarChar, 50), new SqlParameter("@UserPwd", SqlDbType.VarBinary, 50), new SqlParameter("@TelPhone", SqlDbType.VarChar, 50), new SqlParameter("@Mobile", SqlDbType.VarChar, 50), new SqlParameter("@Email", SqlDbType.VarChar, 50), new SqlParameter("@Audit", SqlDbType.Int, 4), new SqlParameter("@StartTime", SqlDbType.DateTime), new SqlParameter("@Valid", SqlDbType.Int, 4), new SqlParameter("@TypeName", SqlDbType.VarChar, 20), new SqlParameter("@RoleId", SqlDbType.Int, 4), new SqlParameter("@CompanyName", SqlDbType.VarChar, 100), new SqlParameter("@Countrycode", SqlDbType.VarChar, 20), new SqlParameter("@Provinceid", SqlDbType.VarChar, 20), new SqlParameter("@Cityid", SqlDbType.VarChar, 20), new SqlParameter("@Countyid", SqlDbType.VarChar, 20), new SqlParameter("@OrderId", SqlDbType.Int, 4), new SqlParameter("@Recomm", SqlDbType.VarChar, 50), new SqlParameter("@Industry", SqlDbType.VarChar, 50) }; parameters[0].Value = model.UserName; parameters[1].Value = model.UserPwd; parameters[2].Value = model.TelPhone; parameters[3].Value = model.Mobile; parameters[4].Value = model.Email; parameters[5].Value = model.Audit; parameters[6].Value = model.StartTime; parameters[7].Value = model.Valid; parameters[8].Value = model.Typename; parameters[9].Value = 6; parameters[10].Value = model.CompanyName; parameters[11].Value = model.Countrycode; parameters[12].Value = model.Provinceid; parameters[13].Value = model.Cityid; parameters[14].Value = model.Countyid; parameters[15].Value = model.OrderId; parameters[16].Value = model.Recomm; parameters[17].Value = model.Industry; object obj = crm.GetSingleShow(strSql.ToString(), parameters); if (obj == null) { return(1); } else { return(Convert.ToInt32(obj)); } }
/// <summary> ///创建视频静态页面 /// </summary> public int StaticHtml(int id, string loginname) { try { string TempFileName = CasesTem.ToString(); string Tem = Compage.Reader(TempFileName); //读取模板内容 string TempSoure = Tem; GZS.Model.VideoSysM model = videosysdal.GetModel(id); StringBuilder imageurls = new StringBuilder(); // string inPathTo = "/video"; List <GZS.Model.VideoSysM> list = videosysdal.GetTopModel(loginname); if (list.Count > 0) { for (int i = 0; i < list.Count; i++) { string urlhtml = list[i].htmlurl.Trim();//连接地址 if (list[i].ImageName.Trim() != ConfigurationManager.AppSettings["VideoDefaultImgeName"].ToString().Trim()) { imageurls.Append("<li><a href=\"http://" + loginname + ".topfo.com/" + urlhtml + "\"><img alt=\"" + list[i].videotitle + "\" src=\"http://dp.topfo.com/img/" + loginname + "/"); imageurls.Append(list[i].ImageName + "\""); imageurls.Append(" width=\"110\" height=\"83\" /></a></li>"); } else { imageurls.Append("<li><a href=\"http://" + loginname + ".topfo.com/" + urlhtml + "\"><img alt=\"" + list[i].videotitle + "\" src=\"http://dp.topfo.com/UpImage/" + ConfigurationManager.AppSettings["VideoDefaultImgeNames"].ToString().Trim() + "\""); imageurls.Append(" width=\"110\" height=\"83\" /></a></li>"); } } } TempSoure = TempSoure.Replace("$VoidioTitle$", model.videotitle.ToString().Trim()); TempSoure = TempSoure.Replace("$context$", model.introduction.ToString().Trim()); TempSoure = TempSoure.Replace("$name$", model.VidoiName.Trim()); TempSoure = TempSoure.Replace("$imageurl$", imageurls.ToString()); TempSoure = TempSoure.Replace("$loginName$", loginname.Trim()); CompanyShow com = new CompanyShow(); TempSoure = TempSoure.Replace("$CompanyName$", com.GetCompanyNameByLoginName(loginname)); string htmlFile = model.htmlurl.ToString().Trim(); //string[] html = htmlFile.Split('/'); //string[] nn = html[2].Split('_'); //string cc = nn[0].Substring(nn[0].Length - 8); string wenjian = MerchantTmpPathTo + loginname + "/"; if (Directory.Exists(wenjian) == false) { Directory.CreateDirectory(wenjian); } string htmlpaths = MerchantTmpPathTo + loginname + "/" + htmlFile; Compage.Writer(htmlpaths, TempSoure); return(1); } catch (Exception e) { return(0); } }
public int StaticHtml(int id, string loginName) { try { //string TempFileName = InvestTem.ToString(); //string Tem = Compage.Reader(TempFileName); //读取模板内容 //string TempSoure = Tem; //string boolS = boolStr(loginName); //TempSoure = TempSoure.Replace("$InvestID$", id.ToString()); //TempSoure = TempSoure.Replace("$Content$", content(loginName, boolS)); //TempSoure = TempSoure.Replace("$loginName$", loginName); //CompanyShow com = new CompanyShow(); //TempSoure = TempSoure.Replace("$CompanyName$", com.GetCompanyNameByLoginName(loginName)); //string htmlFile = "cost.htm"; //string wenjian = InvestPath + loginName; //if (!Directory.Exists(wenjian)) //{ // Directory.CreateDirectory(wenjian); //} //string htmlpaths = wenjian + "/" + htmlFile; //Compage.Writer(htmlpaths, TempSoure); //return 1; string TempFileName = InvestTem.ToString(); string Tem = Compage.Reader(TempFileName); //读取模板内容 string TempSoure = Tem; InvestCostM costm = new InvestCostM(); InvestCostDAL costb = new InvestCostDAL(); if (id == 0) { costm = costb.GetModels(loginName); } else { costm = costb.GetModel(id); } TempSoure = TempSoure.Replace("$zhongwencontex$", costm.Chineseintroduced.ToString()); TempSoure = TempSoure.Replace("$EnglishContext$", costm.Englishintroduction.ToString()); TempSoure = TempSoure.Replace("$loginName$", loginName); CompanyShow com = new CompanyShow(); TempSoure = TempSoure.Replace("$CompanyName$", com.GetCompanyNameByLoginName(loginName)); string htmlFile = "cost.htm"; string wenjian = InvestPath + loginName; if (!Directory.Exists(wenjian)) { Directory.CreateDirectory(wenjian); } string htmlpaths = wenjian + "/" + htmlFile; Compage.Writer(htmlpaths, TempSoure); return(1); } catch (Exception e) { return(0); } }
/// <summary> /// 根据用户名查询出所对应的信息 /// </summary> /// <param name="id"></param> /// <returns></returns> public CompanyShow SelAllShows(string userName) { CompanyShow model = new CompanyShow(); string sql = "select CompanyID,UserName,UserPwd,TelPhone,Mobile,Email,Audit,StartTime,Valid,TypeName,Hit,countrycode,provinceid,cityid,countyid,orderId,Recomm,CompanyName " + " from CompanyShow where UserName=@UserName "; SqlParameter[] para = { new SqlParameter("@UserName", SqlDbType.VarChar, 50) }; para[0].Value = userName; DataSet ds = crm.QueryShow(sql, para); if (ds != null & ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["CompanyID"].ToString() != "") { model.CompanyID = int.Parse(ds.Tables[0].Rows[0]["CompanyID"].ToString()); //编号 } model.UserName = ds.Tables[0].Rows[0]["UserName"].ToString(); //用户名 if (ds.Tables[0].Rows[0]["UserPwd"].ToString() != "") { model.UserPwd = (byte[])ds.Tables[0].Rows[0]["UserPwd"]; //密码 } model.TelPhone = ds.Tables[0].Rows[0]["TelPhone"].ToString(); //电话号码 model.Mobile = ds.Tables[0].Rows[0]["Mobile"].ToString(); //手机号码 model.Email = ds.Tables[0].Rows[0]["Email"].ToString(); //电子邮箱 if (ds.Tables[0].Rows[0]["Audit"].ToString() != "") { model.Audit = int.Parse(ds.Tables[0].Rows[0]["Audit"].ToString());//审核状态 } if (ds.Tables[0].Rows[0]["StartTime"].ToString() != "") { model.StartTime = DateTime.Parse(ds.Tables[0].Rows[0]["StartTime"].ToString());//发布时间 } if (ds.Tables[0].Rows[0]["Valid"].ToString() != "") { model.Valid = int.Parse(ds.Tables[0].Rows[0]["Valid"].ToString()); //展厅有效期 } model.TypeName = ds.Tables[0].Rows[0]["TypeName"].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.OrderId = int.Parse(ds.Tables[0].Rows[0]["orderId"].ToString()); model.Recomm = ds.Tables[0].Rows[0]["Recomm"].ToString(); if (ds.Tables[0].Rows[0]["Hit"].ToString() != "") { model.Hit = int.Parse(ds.Tables[0].Rows[0]["Hit"].ToString());//点击率 } return(model); } else { return(null); } }
public int StaticHtml(int id, string loginName) { try { string TempFileName = ProductTem.ToString(); string Tem = Compage.Reader(TempFileName); //读取模板内容 string TempSoure = Tem; ProductDominM doma = new ProductDominM(); if (id == 0) { doma = doBll.GetProductByName(loginName); } else { doma = doBll.GetModel(id); } if (doma != null) { TempSoure = TempSoure.Replace("$ProductID$", doma.productid.ToString().Trim()); } else { string a = "0"; TempSoure = TempSoure.Replace("$ProductID$", a); } string ids = ""; int scriptId = 0; TempSoure = TempSoure.Replace("$typeName$", type(ref ids, ref scriptId, loginName)); TempSoure = TempSoure.Replace("$loginName$", loginName); TempSoure = TempSoure.Replace("$ChinaName$", content(ids, loginName)); //TempSoure = TempSoure.Replace("$ProductScript$", script(scriptId)); TempSoure = TempSoure.Replace("$ProductScript$", scriptId.ToString()); CompanyShow com = new CompanyShow(); TempSoure = TempSoure.Replace("$CompanyName$", com.GetCompanyNameByLoginName(loginName)); if (string.IsNullOrEmpty(doM.htmlurl)) { doma.htmlurl = "industry.htm"; // doma.htmlurl = doma.loginName + "/" + DateTime.Now.ToString("yyyyMMdd") + "_" + id + ".shtml"; } string htmlFile = "industry.htm"; string wenjian = ProductPath + loginName; if (!Directory.Exists(wenjian)) { Directory.CreateDirectory(wenjian); } string htmlpaths = wenjian + "/" + htmlFile; Compage.Writer(htmlpaths, TempSoure); return(1); } catch (Exception e) { return(0); } }
public int StaticHtmls(int id, string loginname) { try { GZS.Model.ImageTabM model = GetModel(id); string TempFileName = CasesTems.ToString(); string Tem = Compage.Reader(TempFileName); //读取模板内容 string TempSoure = Tem; List <GZS.Model.ImageUrlTabM> list = dal.GetAlls(loginname); StringBuilder ste = new StringBuilder(); if (list.Count > 0) { for (int i = 0; i < list.Count; i++) { GZS.Model.ImageTabM dsd = GetModel(Convert.ToInt32(list[i].Imageid)); List <GZS.Model.ImageUrlTabM> lists = dal.GetAllByImageIds(Convert.ToInt32(list[i].Imageid)); if (lists.Count > 0) { string imagetu = lists[0].Imagepath.Trim(); string imagemiaoshu = list[i].imgexplain; ste.Append("<li><a href=\"http://" + loginname + ".topfo.com/" + dsd.Htmlurl + "\"><img alt=\"" + imagemiaoshu + "\" src=\"http://dp.topfo.com/img/" + loginname + "/" + imagetu + "\" /></a> </li>"); } } } TempSoure = TempSoure.Replace("$context$", ste.ToString()); TempSoure = TempSoure.Replace("$loginName$", loginname.ToString().Trim()); CompanyShow com = new CompanyShow(); TempSoure = TempSoure.Replace("$CompanyName$", com.GetCompanyNameByLoginName(loginname)); string htmlFile = model.Htmlurllist.ToString().Trim(); // string[] html = htmlFile.Split('/'); // string[] nn = html[1].Split('_'); //string[] nn = html[2].Split('_'); // string cc = nn[0].Substring(nn[0].Length - 8); string wenjian = MerchantTmpPathTo + loginname + "/"; if (Directory.Exists(wenjian) == false) { Directory.CreateDirectory(wenjian); } string htmlpaths = MerchantTmpPathTo + loginname + "/" + htmlFile; Compage.Writer(htmlpaths, TempSoure); return(1); } catch (Exception e) { return(0); } }
string ParkTem = ConfigurationManager.AppSettings["ParkTemplate"].ToString(); //其他成功案例模版存放位置 public int StaticHtml(int id, string loginName) { try { string TempFileName = ParkTem.ToString(); string Tem = Compage.Reader(TempFileName); //读取模板内容 string TempSoure = Tem; if (id == 0) { parkM = parkBLL.GetParkByLoginName(loginName); } else { parkM = parkBLL.GetModel(id); } TempSoure = TempSoure.Replace("$ParkID$", parkM.parkid.ToString().Trim()); string ids = ""; int scriptId = 0; TempSoure = TempSoure.Replace("$typeName$", type(ref ids, ref scriptId, loginName)); TempSoure = TempSoure.Replace("$style$", types(ids)); TempSoure = TempSoure.Replace("$ChinaName$", content(ids, loginName)); TempSoure = TempSoure.Replace("$loginName$", loginName); CompanyShow com = new CompanyShow(); TempSoure = TempSoure.Replace("$CompanyName$", com.GetCompanyNameByLoginName(loginName)); //TempSoure = TempSoure.Replace("$ProductScript$", script(scriptId)); TempSoure = TempSoure.Replace("$ParkScript$", scriptId.ToString()); if (string.IsNullOrEmpty(parkM.htmlurl)) { parkM.htmlurl = "Park.htm"; } string htmlFile = "Park.htm";//parkM.htmlurl; string wenjian = ParkPath + loginName; if (!Directory.Exists(wenjian)) { Directory.CreateDirectory(wenjian); } string htmlpaths = wenjian + "/" + htmlFile; Compage.Writer(htmlpaths, TempSoure); return(1); } catch (Exception e) { return(0); } }
string PolicyRightTem = ConfigurationManager.AppSettings["PolicyRight"].ToString(); //其他成功案例模版存放位置 public int StaticHtml(int id, string loginName) { try { string TempFileName = CasesTem.ToString(); string Tem = Compage.Reader(TempFileName); //读取模板内容 string TempSoure = Tem; PolicyModel policyModel = new PolicyModel(); if (id == 0) { policyModel = dal.GetPolicyByName(loginName); } else { policyModel = dal.GetModel(id); } TempSoure = TempSoure.Replace("$PolicyID$", policyModel.policyId.ToString().Trim()); TempSoure = TempSoure.Replace("$ChinaName$", policyModel.Chineseintroduced.ToString().Trim()); TempSoure = TempSoure.Replace("$englishName$", policyModel.Englishintroduction.ToString().Trim()); TempSoure = TempSoure.Replace("$loginName$", loginName); CompanyShow com = new CompanyShow(); TempSoure = TempSoure.Replace("$CompanyName$", com.GetCompanyNameByLoginName(loginName)); if (string.IsNullOrEmpty(policyModel.htmlUrl)) { //policyModel.htmlUrl = policyModel.loginName + "/policy" + policyModel.loginName + ".htm"; policyModel.htmlUrl = "Preferentialpolicies.htm"; } string htmlFile = "Preferentialpolicies.htm"; string wenjian = PolicyPath + loginName; if (!Directory.Exists(wenjian)) { Directory.CreateDirectory(wenjian); } string htmlpaths = wenjian + "/" + htmlFile; Compage.Writer(htmlpaths, TempSoure); return(1); } catch (Exception e) { return(0); } }
/// <summary> /// 修改展厅信息 /// </summary> /// <param name="model"></param> /// <param name="id"></param> /// <returns></returns> public int ModfiyShow(CompanyShow model, int id) { int num = 0; StringBuilder strSql = new StringBuilder(); strSql.Append("update CompanyShow set "); strSql.Append("UserName=@UserName,"); strSql.Append("UserPwd=@UserPwd,"); strSql.Append("TelPhone=@TelPhone,"); strSql.Append("Mobile=@Mobile,"); strSql.Append("Email=@Email,"); strSql.Append("Audit=@Audit,"); strSql.Append("StartTime=@StartTime,"); strSql.Append("Valid=@Valid,"); strSql.Append("TypeName=@TypeName,"); strSql.Append("Hit=@Hit,"); strSql.Append("RoleId=@RoleId,"); strSql.Append("Countrycode=@Countrycode,"); strSql.Append("Provinceid=@Provinceid,"); strSql.Append("Cityid=@Cityid,"); strSql.Append("Countyid=@Countyid,"); strSql.Append("OrderId=@OrderId,"); strSql.Append("Recomm=@Recomm1"); strSql.Append(" where CompanyID=@CompanyID "); SqlParameter[] parameters = { new SqlParameter("@CompanyID", SqlDbType.Int, 4), new SqlParameter("@UserName", SqlDbType.VarChar, 50), new SqlParameter("@UserPwd", SqlDbType.VarBinary, 50), new SqlParameter("@TelPhone", SqlDbType.VarChar, 50), new SqlParameter("@Mobile", SqlDbType.VarChar, 50), new SqlParameter("@Email", SqlDbType.VarChar, 50), new SqlParameter("@Audit", SqlDbType.Int, 4), new SqlParameter("@StartTime", SqlDbType.DateTime), new SqlParameter("@Valid", SqlDbType.Int, 4), new SqlParameter("@TypeName", SqlDbType.VarChar, 20), new SqlParameter("@Hit", SqlDbType.Int, 4), new SqlParameter("@RoleId", SqlDbType.Int, 4), new SqlParameter("@Countrycode", SqlDbType.VarChar, 20), new SqlParameter("@Provinceid", SqlDbType.VarChar, 20), new SqlParameter("@Cityid", SqlDbType.VarChar, 20), new SqlParameter("@Countyid", SqlDbType.VarChar, 20), new SqlParameter("@OrderId", SqlDbType.Int, 4), new SqlParameter("@Recomm1", SqlDbType.VarChar, 50) }; model.CompanyID = id; parameters[0].Value = model.CompanyID; parameters[1].Value = model.UserName; parameters[2].Value = model.UserPwd; parameters[3].Value = model.TelPhone; parameters[4].Value = model.Mobile; parameters[5].Value = model.Email; parameters[6].Value = model.Audit; parameters[7].Value = model.StartTime; parameters[8].Value = model.Valid; parameters[9].Value = model.TypeName; parameters[10].Value = model.Hit; parameters[11].Value = model.RoleId; parameters[12].Value = model.Countrycode; parameters[13].Value = model.Provinceid; parameters[14].Value = model.Cityid; parameters[15].Value = model.Countyid; parameters[16].Value = model.OrderId; parameters[17].Value = model.Recomm; num = Convert.ToInt32(crm.ExecuteSqls(strSql.ToString(), parameters)); //num = Convert.ToInt32(crm.ExecuteSqls(strSql.ToString(), parameters)); return(num); }
/// <summary> ///创建相册静态页面 /// </summary> public int StaticHtml(int id, string loginname) { try { string TempFileName = CasesTem.ToString(); string Tem = Compage.Reader(TempFileName); //读取模板内容 string TempSoure = Tem; GZS.Model.ImageTabM areatabm = GetModel(id); //主表 List <GZS.Model.ImageUrlTabM> list = dal.GetAllByImageIds(id); //从表 StringBuilder imageurls = new StringBuilder(); StringBuilder imagedescript = new StringBuilder(); //上一影集; GZS.Model.ImageTabM shangImageModel = GetYinJi(id, loginname, "<", "desc"); string shangImangeUrl = ""; //链接地址 string shangImageDefault = ""; //默认图片 if (shangImageModel != null) { List <GZS.Model.ImageUrlTabM> listd = dal.GetAllByImageIds(shangImageModel.imageid); if (listd.Count > 0) { shangImageDefault = listd[0].Imagepath.Trim(); } else { shangImageDefault = ConfigurationManager.AppSettings["ImagesDefaultImgeName"].ToString(); } shangImangeUrl = shangImageModel.Htmlurl; } else { shangImangeUrl = areatabm.Htmlurl; if (list.Count > 0) { shangImageDefault = list[0].Imagepath.Trim(); } else { shangImageDefault = ConfigurationManager.AppSettings["ImagesDefaultImgeName"].ToString(); } } //下一影集; GZS.Model.ImageTabM xiaImageModel = GetYinJi(id, loginname, ">", "asc"); string xiaImangeUrl = ""; //链接地址 string xiaImageDefault = ""; //默认图片 if (xiaImageModel != null) { xiaImangeUrl = xiaImageModel.Htmlurl; List <GZS.Model.ImageUrlTabM> lists = dal.GetAllByImageIds(xiaImageModel.imageid); if (lists.Count > 0) { xiaImageDefault = lists[0].Imagepath.Trim(); } else { xiaImageDefault = ConfigurationManager.AppSettings["ImagesDefaultImgeName"].ToString(); } } else { xiaImangeUrl = areatabm.Htmlurl; if (list.Count > 0) { xiaImageDefault = list[0].Imagepath.Trim(); } else { xiaImageDefault = ConfigurationManager.AppSettings["ImagesDefaultImgeName"].ToString(); } } string iamgedefault = ""; if (list.Count > 0) { iamgedefault = "<img src=\"http://dp.topfo.com/img/" + loginname + "/" + list[0].Imagepath.Trim() + "\" id=\"placeholder\" />"; for (int i = 0; i < list.Count; i++) { imageurls.Append(" <div class=\"pic\"><a href=\"http://dp.topfo.com/img/" + loginname + "/" + list[i].Imagepath.Trim() + "\" onMouseOver=\"showPic(this," + (i + 1) + "," + list.Count + ");return false;\" target=\"_blank\">"); imageurls.Append("<img src=\"http://dp.topfo.com/img/" + loginname + "/" + list[i].Imagepath.Trim() + "\" width=\"126\" height=\"94\" /> </a> </div>"); if (i == 0) { imagedescript.Append("<div style=\"text-align:center; display:block\" id=\"show" + (i + 1) + "\">" + list[i].imgexplain + "</div>"); } else { imagedescript.Append("<div style=\"text-align:center; display:none\" id=\"show" + (i + 1) + "\">" + list[i].imgexplain + "</div>"); } } } else { iamgedefault = ""; imageurls.Append(""); } string shanga = ""; string xiaa = ""; if (shangImageDefault.Trim() != ConfigurationManager.AppSettings["ImagesDefaultImgeName"].ToString().Trim()) { shanga = "<a href=\"http://" + loginname + ".topfo.com/" + shangImangeUrl + "\"><img src=\"http://dp.topfo.com/img/" + loginname + "/" + shangImageDefault + "\" /></a><p><a href=\"http://" + loginname + ".topfo.com/" + shangImangeUrl + "\">上一影集</a></p>"; } else { shanga = "<a href=\"http://" + loginname + ".topfo.com/" + shangImangeUrl + "\"><img src=\"" + ConfigurationManager.AppSettings["ImagesDefaultLuJin"].ToString() + "\" /></a><p><a href=\"http://" + loginname + ".topfo.com/" + shangImangeUrl + "\">上一影集</a></p>"; } if (xiaImageDefault.Trim() != ConfigurationManager.AppSettings["ImagesDefaultImgeName"].ToString().Trim()) { xiaa = "<a href=\"http://" + loginname + ".topfo.com/" + xiaImangeUrl + "\"><img src=\"http://dp.topfo.com/img/" + loginname + "/" + xiaImageDefault + "\" /></a><p><a href=\"http://" + loginname + ".topfo.com/" + xiaImangeUrl + "\">下一影集</a></p>"; } else { xiaa = "<a href=\"http://" + loginname + ".topfo.com/" + xiaImangeUrl + "\"><img src=\"" + ConfigurationManager.AppSettings["ImagesDefaultLuJin"].ToString() + "\" /></a><p><a href=\"http://" + loginname + ".topfo.com/" + xiaImangeUrl + "\">下一影集</a></p>"; } TempSoure = TempSoure.Replace("$shang$", shanga); TempSoure = TempSoure.Replace("$xia$", xiaa); TempSoure = TempSoure.Replace("$ImageTitle$", areatabm.imageName.Trim()); TempSoure = TempSoure.Replace("$DefaultImage$", iamgedefault.Trim()); TempSoure = TempSoure.Replace("$ImageList$", imageurls.ToString()); TempSoure = TempSoure.Replace("$loginName$", loginname.Trim()); TempSoure = TempSoure.Replace("$imagedescript$", imagedescript.ToString()); CompanyShow com = new CompanyShow(); TempSoure = TempSoure.Replace("$CompanyName$", com.GetCompanyNameByLoginName(loginname)); string htmlFile = areatabm.Htmlurl.ToString().Trim(); // string[] html = htmlFile.Split('/'); // string[] nn = html[1].Split('_'); //string[] nn = html[2].Split('_'); // string cc = nn[0].Substring(nn[0].Length - 8); string wenjian = MerchantTmpPathTo + loginname + "/"; if (Directory.Exists(wenjian) == false) { Directory.CreateDirectory(wenjian); } string htmlpaths = MerchantTmpPathTo + loginname + "/" + htmlFile; Compage.Writer(htmlpaths, TempSoure); return(1); } catch (Exception e) { return(0); } }
/// <summary> ///创建投资环境静态页面 /// </summary> public int StaticHtml(string loginname) { try { string ids = ""; string TempFileName = CasesTem.ToString(); string Tem = Compage.Reader(TempFileName); //读取模板内容 string TempSoure = Tem; GZS.DAL.EnvironmentTypeDAL typedal = new EnvironmentTypeDAL(); GZS.DAL.EnvironmentImgDAL Imgdal = new EnvironmentImgDAL(); List <GZS.Model.EnvironmentTypeM> list = typedal.GetAllType(); StringBuilder str = new StringBuilder(); for (int i = 0; i < list.Count; i++) { GZS.Model.EnvironmentTabM envtab = EnvironmentlistByLoginNameandTypeid(loginname, list[i].EnvironmentTypeID); string zhongwen = ""; string english = ""; string txt1 = ""; string txt2 = ""; string txt3 = ""; string txt4 = ""; string txts1 = ""; string txts2 = ""; string txts3 = ""; string txts4 = ""; if (envtab != null) { zhongwen = envtab.Chineseintroduced.Trim(); english = envtab.Englishintroduction.Trim(); List <GZS.Model.EnvironmentImgM> lists = Imgdal.GetAllByEnvironmentTabId(envtab.Environmentid); for (int t = 0; t < lists.Count; t++) { if (t == 0) { txt1 = lists[t].imgpath; txts1 = lists[t].imgexplain; } if (t == 1) { txt2 = lists[t].imgpath; txts2 = lists[t].imgexplain; } if (t == 2) { txt3 = lists[t].imgpath; txts3 = lists[t].imgexplain; } if (t == 3) { txt4 = lists[t].imgpath; txts4 = lists[t].imgexplain; } } } if (i == 0) { str.Append("<div id=\"gk_con_" + (10 + i) + "\" style =\"display:block\">"); ids += 10 + i + ","; } else { ids += 10 + i + ","; str.Append("<div id=\"gk_con_" + (10 + i) + "\" style =\"display:none\">"); } str.Append("<div class=\"envuroment-right1\">" + zhongwen + "</div>"); str.Append("<div class=\"envuroment-right1\">" + english + "</div>"); str.Append("<div class=\"envuroment-right2\">"); str.Append("<div class=\"industry-img-left001\"><ul>"); if (txt1.Trim() != "") { str.Append("<li class=\"l\">"); str.Append("<a href=\"http://dp.topfo.com/img/" + loginname + "/" + txt1 + "\" alt='点击查看大图' target=\"_blank\">"); str.Append("<img alt='点击查看大图' src=\"http://dp.topfo.com/img/" + loginname + "/" + txt1 + "\" />"); str.Append("<p style=\"text-align:center;\">" + txts1 + "</p>"); str.Append("</li>"); } else { //str.Append("<li class=\"l\">"); } if (txt2.Trim() != "") { str.Append("<li class=\"r\">"); str.Append("<a href=\"http://dp.topfo.com/img/" + loginname + "/" + txt2 + "\" alt='点击查看大图' target=\"_blank\">"); str.Append("<img src=\"http://dp.topfo.com/img/" + loginname + "/" + txt2 + "\" alt='点击查看大图'/>"); str.Append("<p style=\"text-align:center;\">" + txts2 + "</p>"); str.Append("</li>"); } else { // str.Append("<li class=\"r\">"); } str.Append("</ul>"); str.Append("</div></div>"); if (txt3.Trim() != "") { str.Append("<div class=\"envuroment-right3\"><div class=\"industry-img-left001\">"); str.Append("<a href=\"http://dp.topfo.com/img/" + loginname + "/" + txt3 + "\" alt='点击查看大图' target=\"_blank\">"); str.Append("<img src=\"http://dp.topfo.com/img/" + loginname + "/" + txt3 + "\" alt='点击查看大图'/>"); str.Append("<p style=\"text-align:center;\">" + txts3 + "</p>"); str.Append("</div>"); } else { //str.Append("<div class=\"envuroment-right3\">"); } if (txt4.Trim() != "") { str.Append("<div class=\"envuroment-right4\"><div class=\"industry-img-left001\">"); str.Append("<a href=\"http://dp.topfo.com/img/" + loginname + "/" + txt4 + "\" alt='点击查看大图' target=\"_blank\">"); str.Append("<img src=\"http://dp.topfo.com/img/" + loginname + "/" + txt4 + "\" />"); str.Append("<p style=\"text-align:center;\">" + txts4 + "</p>"); str.Append("</div>"); } else { //str.Append("<div class=\"envuroment-right4\">"); } //str.Append("</div></div>"); str.Append("</div>"); } TempSoure = TempSoure.Replace("$contex$", str.ToString()); TempSoure = TempSoure.Replace("$loginName$", loginname.Trim()); TempSoure = TempSoure.Replace("$styles$", types(ids)); CompanyShow com = new CompanyShow(); TempSoure = TempSoure.Replace("$CompanyName$", com.GetCompanyNameByLoginName(loginname)); string wenjian = MerchantTmpPathTo + loginname + "/"; if (Directory.Exists(wenjian) == false) { Directory.CreateDirectory(wenjian); } string htmlpaths = MerchantTmpPathTo + loginname + "/" + "Investmentenvironment.htm"; Compage.Writer(htmlpaths, TempSoure); return(1); } catch (Exception e) { return(0); } }
/// <summary> ///创建区域静态页面 /// </summary> public int StaticHtml(int id, string loaginnames) { try { string TempFileName = CasesTem.ToString(); string Tem = Compage.Reader(TempFileName); //读取模板内容 GZS.Model.AreaTab areatabm = null; List <GZS.Model.Areaimg> list = null; string TempSoure = Tem; if (id == 0) { areatabm = GetModelCountByLogName(loaginnames); } else { areatabm = GetModel(id); } StringBuilder imageurls = new StringBuilder(); GZS.DAL.AreaimgDAL areaimgdal = new AreaimgDAL(); if (id == 0) { list = areaimgdal.GetAllModelByareId(areatabm.areaid); } else { list = areaimgdal.GetAllModelByareId(id); } string iamgedefaults = ""; string iamgedefault = ""; if (list.Count > 0) { if (list[0].ImageUrl.Trim() != "") { iamgedefaults = "<img src=\" http://dp.topfo.com/img/" + loaginnames + "/" + list[0].ImageUrl.Trim() + "\" />"; iamgedefault = "<img src=\" http://dp.topfo.com/img/" + loaginnames + "/" + list[0].ImageUrl.Trim() + "\" id=\"placeholder\" />"; for (int i = 0; i < list.Count; i++) { imageurls.Append(" <div class=\"pic\"><a href=\"http://dp.topfo.com/img/" + loaginnames + "/" + list[i].ImageUrl.Trim() + "\" onMouseOver=\"showPic(this);return false;\" target=\"_blank\">"); imageurls.Append("<img id=\"dx" + i + "\" src=\"http://dp.topfo.com/img/" + loaginnames + "/" + list[i].ImageUrl.Trim() + "\" /> </a> </div>"); } } else { iamgedefault = ""; iamgedefaults = ""; imageurls.Append("<li></li>"); } } TempSoure = TempSoure.Replace("$zhongwencontex$", areatabm.Chineseintroduced.Trim()); TempSoure = TempSoure.Replace("$EnglishContext$", areatabm.Englishintroduction.Trim()); TempSoure = TempSoure.Replace("$DefaultImage$", iamgedefault.Trim()); TempSoure = TempSoure.Replace("$ImageList$", imageurls.ToString()); TempSoure = TempSoure.Replace("$loginName$", loaginnames.Trim()); TempSoure = TempSoure.Replace("$txtup$", iamgedefaults.Trim()); CompanyShow com = new CompanyShow(); TempSoure = TempSoure.Replace("$CompanyName$", com.GetCompanyNameByLoginName(loaginnames)); string htmlFile = areatabm.Htmlurl.ToString().Trim(); //string[] nn = html[2].Split('_'); // string cc = nn[0].Substring(nn[0].Length - 8); string wenjian = MerchantTmpPathTo + loaginnames + "/"; if (Directory.Exists(wenjian) == false) { Directory.CreateDirectory(wenjian); } string htmlpaths = MerchantTmpPathTo + loaginnames + "/" + htmlFile; Compage.Writer(htmlpaths, TempSoure); return(1); } catch (Exception e) { return(0); } }
/// <summary> /// 修改展厅信息 /// </summary> /// <param name="model"></param> /// <param name="id"></param> /// <returns></returns> public int ModfiyShow(CompanyShow model, int id) { return(dal.ModfiyShow(model, id)); }