コード例 #1
0
    //全部生成
    protected void btnAllGenerate_Click(object sender, EventArgs e)
    {
        int num = 0;

        try
        {
            com.topfo.wyzs.GenerateStatic gen = new com.topfo.wyzs.GenerateStatic();
            num = gen.AllGenerate();
        }
        catch (Exception ex)
        {
            Tz888.Common.MessageBox.Show(this.Page, "静态页面生成失败");
        }
        if (num > 0)
        {
            Tz888.Common.MessageBox.Show(this.Page, "静态页面生成成功");
        }
        else
        {
            Tz888.Common.MessageBox.Show(this.Page, "静态页面生成失败");
        }
        //for (int i = 0; i < 7; i++)
        //{
        //    if (i == 0)
        //    {
        //        GenerateStaticPage("index.aspx", "index.html");
        //    }
        //    else
        //    {
        //        GenerateStaticPage("index_0" + i + ".aspx", "index_0" + i + ".html");
        //    }
        //}
    }
コード例 #2
0
    protected void btnUpload2_Click(object sender, EventArgs e)
    {
        string imgName = "";

        if (uploadPic.HasFile)
        {
            try
            {
                com.topfo.wyzs.GenerateStatic gen = new com.topfo.wyzs.GenerateStatic();
                HttpPostedFile mFile    = uploadPic.PostedFile;
                int            fileSize = mFile.ContentLength;

                byte[] mFileByte = new Byte[fileSize];
                mFile.InputStream.Read(mFileByte, 0, fileSize);

                //检测控制图片类型
                string   fileExt  = (System.IO.Path.GetExtension(mFile.FileName)).ToString().ToLower();
                DateTime Now      = DateTime.Now;
                string   fileMain = Now.Year.ToString() + Now.Month.ToString() + Now.Day.ToString() +
                                    Now.Hour.ToString() + Now.Minute.ToString() + Now.Second.ToString();
                if (fileExt == ".jpg" || fileExt == ".gif" || fileExt == ".png" || fileExt == ".bmp")
                {
                    imgName = fileMain + fileExt;
                    ViewState["strSaveName"] = imgName;
                    if (gen.UpCommerceImages(imgName, mFileByte) > 0)
                    {
                        //显示图片
                        Image1.ImageUrl = "http://wyzs.topfo.com/img/img/" + ViewState["strSaveName"].ToString();
                        imageDis.Attributes.Add("style", "display:''");
                    }
                }
                else
                {
                    //LblMessage2.Text = "该文件类型不允许上传!";
                }
            }
            catch (Exception ex)
            {
                // LblMessage2.Text = "文件上传失败,请重试!<br/>详细错误信息:" + ex.ToString();
            }
        }
        else
        {
            Response.Write("<script>alert('请选择上传的图片!');</script>");
        }
    }
コード例 #3
0
 protected void btnAudit_Click(object sender, EventArgs e)
 {
     model          = bll.GetModel(int.Parse(Request.QueryString["id"].ToString()));
     model.orderid  = Convert.ToInt32(txtorder.Text.ToString());
     model.title    = txtTitle.Text.Trim();
     model.descript = txtContent.Value.ToString();
     model.htmlurl  = "details_" + model.id.ToString() + ".html";
     //model.pageAddress = rdochannel.Checked == true ? 0 : 1;
     if (!bll.Update(model))
     {
         Response.Write("<script>alert('修改失败!');document.location='contractManage.aspx'</script>");
     }
     else
     {
         com.topfo.wyzs.GenerateStatic gen = new com.topfo.wyzs.GenerateStatic();
         gen.GenerateContract(model.id);
         Response.Redirect("contractManage.aspx");
     }
 }
コード例 #4
0
ファイル: Static.aspx.cs プロジェクト: 262734254/TopfoManage
    protected void Button1_Click(object sender, EventArgs e)
    {
        int num = 0;

        try
        {
            com.topfo.wyzs.GenerateStatic gen = new com.topfo.wyzs.GenerateStatic();
            num = gen.QyIndex();
        }
        catch (Exception ex)
        {
            Tz888.Common.MessageBox.Show(this.Page, "静态页面生成失败");
        }
        if (num > 0)
        {
            Tz888.Common.MessageBox.Show(this.Page, "静态页面生成成功");
        }
        else
        {
            Tz888.Common.MessageBox.Show(this.Page, "静态页面生成失败");
        }
    }
コード例 #5
0
    //商业街
    protected void btnBusinessStreet_Click(object sender, EventArgs e)
    {
        int num = 0;

        try
        {
            com.topfo.wyzs.GenerateStatic gen = new com.topfo.wyzs.GenerateStatic();
            num = gen.BusinessStreet();
        }
        catch (Exception ex)
        {
            Tz888.Common.MessageBox.Show(this.Page, "静态页面生成失败");
        }
        if (num > 0)
        {
            Tz888.Common.MessageBox.Show(this.Page, "静态页面生成成功");
        }
        else
        {
            Tz888.Common.MessageBox.Show(this.Page, "静态页面生成失败");
        }
        // GenerateStaticPage("index_03.aspx", "index_03.html");
    }
コード例 #6
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        //model.htmlurl = txtSite.Text.Trim();
        model.orderid     = Convert.ToInt32(txtorder.Text.ToString());
        model.title       = txtTitle.Text.Trim();
        model.descript    = txtContent.Value.ToString();
        model.pageAddress = 3;
        int num = bll.Add(model);

        if (num > 0)
        {
            model.htmlurl = "details_" + num + ".html";
            model.id      = num;
            bll.Update(model);
            com.topfo.wyzs.GenerateStatic gen = new com.topfo.wyzs.GenerateStatic();
            gen.GenerateContract(num);
            Response.Redirect("contractManage.aspx");
        }
        else
        {
            Response.Write("<script>alert('添加失败!');document.location='contractManage.aspx'</script>");
        }
    }