Exemplo n.º 1
0
        /// <summary>
        ///创建首页友情链接静态页面
        /// </summary>
        public int StaticHtml(string loginname)
        {
            try
            {
                string TempFileName = CasesTem.ToString();
                string Tem          = Compage.Reader(TempFileName); //读取模板内容

                string TempSoure = Tem;
                GZS.DAL.product.CommStatic dal = new GZS.DAL.product.CommStatic();
                TempSoure = TempSoure.Replace("$cntex$", dal.GetListFriend(loginname));
                //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 + "/FriendLink.htm";
                Compage.Writer(htmlpaths, TempSoure);
                return(1);
            }

            catch (Exception e)
            {
                return(0);
            }
        }
Exemplo n.º 2
0
        private string areabe = ConfigurationManager.AppSettings["areabe"].ToString(); //区域概括生成的静态页面存放路径
        // private string areaMa = ConfigurationManager.AppSettings["areaMa"].ToString(); //区域概括模版页存放路径

        public void AreaHtml(string name, int num)
        {
            GZS.DAL.product.CommStatic comm = new GZS.DAL.product.CommStatic();
            string areaMa = "J:/topfo/tzWeb/Corporation/cn001/index.htm";

            //string areaMa = "F:/zf/topfo001/index.html";
            string[] ar = areaMa.Split('/');
            string   nn = ar[ar.Length - 2].ToString();
            string   ma = nn.Replace(nn, name);

            string bb = "J:\\topfo\\tzWeb\\Corporation\\" + ma + "\\index.htm";
            // string bb = "F:\\zf\\"+ma+"\\index.html";
            string TempFileName = bb.ToString();
            string Tem          = Compage.Reader(TempFileName); //读取模板内容

            #region 替换模版
            string TempSoure = Tem;
            if (num == 1)//产品优势
            {
                string industry = comm.GetListUIByloginName(name);
                TempSoure = TempSoure.Replace("$industry$", industry);
            }
            else if (num == 2)//投资环境
            {
            }
            else if (num == 3)//园区特色
            {
                string land = comm.GetParkListUIByLoginName(name);
                TempSoure = TempSoure.Replace("$Land$", land);
            }
            else if (num == 4)//投资成本
            {
                string project = comm.GetInvestListUIByLoginName(name);
                TempSoure = TempSoure.Replace("$Project$", project);
            }
            else if (num == 5)//区域概括
            {
                string area = SelArea(name);
                TempSoure = TempSoure.Replace("$area$", area);
            }
            else if (num == 6)//友情链接
            {
                string friend = comm.GetListFriend(name);
                TempSoure = TempSoure.Replace("$friendship$", friend);
            }
            else if (num == 7)//相册图片
            {
                string pic = comm.GetImageList(name);
                TempSoure = TempSoure.Replace("$pic$", pic);
            }
            else if (num == 8)//优惠政策
            {
                string Policy = comm.GetPolicyListUIByLoginName(name);
                TempSoure = TempSoure.Replace("$Policy$", Policy);
            }
            #endregion

            string wenjian = areabe + name;
            if (Directory.Exists(wenjian) == false)
            {
                Directory.CreateDirectory(wenjian);
            }
            string htmlpaths = wenjian + "\\" + "index.htm";
            Compage.Writer(htmlpaths, TempSoure);
        }