コード例 #1
0
ファイル: index.aspx.cs プロジェクト: eyren/OScms
 //批量删除
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("advert", OSEnums.ActionEnum.Delete.ToString()); //检查权限
     int sucCount = 0;
     int errorCount = 0;
     BLL.plugins.advert bll = new BLL.plugins.advert();
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
         if (cb.Checked)
         {
             if (bll.Delete(id))
             {
                 sucCount++;
             }
             else
             {
                 errorCount++;
             }
         }
     }
     AddAdminLog(OSEnums.ActionEnum.Delete.ToString(), "删除广告位成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
     JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!",
      Utils.CombUrlTxt("index.aspx", "keywords={0}&&property={1}", this.keywords, this.property), "Success");
 }
コード例 #2
0
        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("advert", OSEnums.ActionEnum.Delete.ToString()); //检查权限
            int sucCount   = 0;
            int errorCount = 0;

            BLL.plugins.advert bll = new BLL.plugins.advert();
            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int      id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    if (bll.Delete(id))
                    {
                        sucCount++;
                    }
                    else
                    {
                        errorCount++;
                    }
                }
            }
            AddAdminLog(OSEnums.ActionEnum.Delete.ToString(), "删除广告位成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
            JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!",
                       Utils.CombUrlTxt("index.aspx", "keywords={0}&&property={1}", this.keywords, this.property), "Success");
        }
コード例 #3
0
ファイル: bar_edit.aspx.cs プロジェクト: eryueren/OScms
        private void TreeBind()
        {
            BLL.plugins.advert bll = new BLL.plugins.advert();
            DataTable          dt  = bll.GetList("").Tables[0];

            this.ddlAdvertId.Items.Clear();
            this.ddlAdvertId.Items.Add(new ListItem("所有广告位", ""));
            foreach (DataRow dr in dt.Rows)
            {
                this.ddlAdvertId.Items.Add(new ListItem(dr["title"].ToString(), dr["id"].ToString()));
            }
        }
コード例 #4
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page                      = OSRequest.GetQueryInt("page", 1);
            this.txtKeywords.Text          = this.keywords;
            this.ddlProperty.SelectedValue = this.property;
            BLL.plugins.advert bll = new BLL.plugins.advert();
            this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            this.rptList.DataBind();
            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("index.aspx", "keywords={0}&property={1}&page={2}", this.keywords, this.property, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
コード例 #5
0
ファイル: adv_edit.aspx.cs プロジェクト: eryueren/OScms
        private void ShowInfo(int _id)
        {
            BLL.plugins.advert   bll   = new BLL.plugins.advert();
            Model.plugins.advert model = bll.GetModel(_id);

            txtTitle.Text           = model.title;
            rblType.SelectedValue   = model.type.ToString();
            txtRemark.Text          = model.remark;
            txtViewNum.Text         = model.view_num.ToString();
            txtPrice.Text           = model.price.ToString();
            txtViewWidth.Text       = model.view_width.ToString();
            txtViewHeight.Text      = model.view_height.ToString();
            rblTarget.SelectedValue = model.target;
        }
コード例 #6
0
ファイル: adv_edit.aspx.cs プロジェクト: eyren/OScms
        private bool DoAdd()
        {
            bool result = false;
            Model.plugins.advert model = new Model.plugins.advert();
            BLL.plugins.advert bll = new BLL.plugins.advert();

            model.title = txtTitle.Text.Trim();
            model.type = int.Parse(rblType.SelectedValue);
            model.price = decimal.Parse(txtPrice.Text.Trim());
            model.remark = txtRemark.Text.Trim();
            model.view_num = int.Parse(txtViewNum.Text.Trim());
            model.view_width = int.Parse(txtViewWidth.Text.Trim());
            model.view_height = int.Parse(txtViewHeight.Text.Trim());
            model.target = rblTarget.SelectedValue;

            if (bll.Add(model) >0)
            {
                AddAdminLog(OSEnums.ActionEnum.Add.ToString(), "添加广告位:" + model.title); //记录日志
                result = true;
            }
            return result;
        }
コード例 #7
0
ファイル: adv_edit.aspx.cs プロジェクト: eryueren/OScms
        private bool DoAdd()
        {
            bool result = false;

            Model.plugins.advert model = new Model.plugins.advert();
            BLL.plugins.advert   bll   = new BLL.plugins.advert();

            model.title       = txtTitle.Text.Trim();
            model.type        = int.Parse(rblType.SelectedValue);
            model.price       = decimal.Parse(txtPrice.Text.Trim());
            model.remark      = txtRemark.Text.Trim();
            model.view_num    = int.Parse(txtViewNum.Text.Trim());
            model.view_width  = int.Parse(txtViewWidth.Text.Trim());
            model.view_height = int.Parse(txtViewHeight.Text.Trim());
            model.target      = rblTarget.SelectedValue;

            if (bll.Add(model) > 0)
            {
                AddAdminLog(OSEnums.ActionEnum.Add.ToString(), "添加广告位:" + model.title); //记录日志
                result = true;
            }
            return(result);
        }
コード例 #8
0
ファイル: index.aspx.cs プロジェクト: eyren/OScms
 private void RptBind(string _strWhere, string _orderby)
 {
     this.page = OSRequest.GetQueryInt("page", 1);
     this.txtKeywords.Text = this.keywords;
     this.ddlProperty.SelectedValue = this.property;
     BLL.plugins.advert bll = new BLL.plugins.advert();
     this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
     this.rptList.DataBind();
     //绑定页码
     txtPageNum.Text = this.pageSize.ToString();
     string pageUrl = Utils.CombUrlTxt("index.aspx", "keywords={0}&property={1}&page={2}", this.keywords, this.property, "__id__");
     PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
 }
コード例 #9
0
ファイル: adv_edit.aspx.cs プロジェクト: eyren/OScms
        private void ShowInfo(int _id)
        {
            BLL.plugins.advert bll = new BLL.plugins.advert();
            Model.plugins.advert model = bll.GetModel(_id);

            txtTitle.Text = model.title;
            rblType.SelectedValue = model.type.ToString();
            txtRemark.Text = model.remark;
            txtViewNum.Text = model.view_num.ToString();
            txtPrice.Text = model.price.ToString();
            txtViewWidth.Text = model.view_width.ToString();
            txtViewHeight.Text = model.view_height.ToString();
            rblTarget.SelectedValue = model.target;
        }
コード例 #10
0
ファイル: bar_list.aspx.cs プロジェクト: eyren/OScms
        private void TreeBind()
        {
            BLL.plugins.advert bll = new BLL.plugins.advert();
            DataTable dt = bll.GetList("").Tables[0];

            this.ddlAdvertId.Items.Clear();
            this.ddlAdvertId.Items.Add(new ListItem("所有广告位", ""));
            foreach (DataRow dr in dt.Rows)
            {
                this.ddlAdvertId.Items.Add(new ListItem(dr["title"].ToString(), dr["id"].ToString()));
            }
        }
コード例 #11
0
        public void ProcessRequest(HttpContext context)
        {
            int aid = OSRequest.GetQueryInt("id");

            //获得广告位的ID
            if (aid < 1)
            {
                context.Response.Write("document.write('错误提示,请勿提交非法字符!');");
                return;
            }

            //检查广告位是否存在
            BLL.plugins.advert abll = new BLL.plugins.advert();
            if (!abll.Exists(aid))
            {
                context.Response.Write("document.write('错误提示,该广告位不存在!');");
                return;
            }

            //取得该广告位详细信息
            Model.plugins.advert aModel = abll.GetModel(aid);

            //输出该广告位下的广告条,不显示未开始、过期、暂停广告
            BLL.plugins.advert_banner bbll = new BLL.plugins.advert_banner();
            DataSet ds = bbll.GetList("is_lock=0 and datediff(d,start_time,getdate())>=0 and datediff(d,end_time,getdate())<=0 and aid=" + aid);

            if (ds.Tables[0].Rows.Count < 1)
            {
                context.Response.Write("document.write('该广告位下暂无广告内容');");
                return;
            }

            //=================判断广告位类别,输出广告条======================

            //新增,取得站点配置信息
            Model.configs.siteconfig siteConfig = new BLL.configs.siteconfig().loadConfig();      //获得站点配置信息


            switch (aModel.type)
            {
            case 1:     //文字
                context.Response.Write("document.write('<ul>');\n");
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    //如果超出限制广告数量,则退出循环
                    if (i >= aModel.view_num)
                    {
                        break;
                    }
                    DataRow dr = ds.Tables[0].Rows[i];
                    context.Response.Write("document.write('<li>');");
                    context.Response.Write("document.write('<a title=\"" + dr["title"] + "\" target=\"" + aModel.target + "\" href=\"" + dr["link_url"] + "\">" + dr["title"] + "</a>');");
                    context.Response.Write("document.write('</li>');\n");
                }
                context.Response.Write("document.write('</ul>');\n");
                break;

            case 2:     //图片
                if (ds.Tables[0].Rows.Count == 1)
                {
                    DataRow dr = ds.Tables[0].Rows[0];
                    context.Response.Write("document.write('<a title=\"" + dr["title"] + "\" target=\"" + aModel.target + "\" href=\"" + dr["link_url"] + "\">');");
                    context.Response.Write("document.write('<img src=\"" + dr["file_path"] + "\" width=" + aModel.view_width + " height=" + aModel.view_height + " border=0 />');");
                    context.Response.Write("document.write('</a>');");
                }
                else
                {
                    context.Response.Write("document.write('<ul>');\n");
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        //如果超出限制广告数量,则退出循环
                        if (i >= aModel.view_num)
                        {
                            break;
                        }
                        DataRow dr = ds.Tables[0].Rows[i];
                        context.Response.Write("document.write('<li>');");
                        context.Response.Write("document.write('<a title=\"" + dr["title"] + "\" target=\"" + aModel.target + "\" href=\"" + dr["link_url"] + "\">');");
                        context.Response.Write("document.write('<img src=\"" + dr["file_path"] + "\" width=" + aModel.view_width + " height=" + aModel.view_height + " border=0 />');");
                        context.Response.Write("document.write('</a>');\n");
                        context.Response.Write("document.write('</li>');\n");
                    }
                    context.Response.Write("document.write('</ul>');\n");
                }
                break;

            case 3:     //幻灯片
                StringBuilder picTitle = new StringBuilder();
                StringBuilder picUrl   = new StringBuilder();
                StringBuilder picLink  = new StringBuilder();
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    //如果超出限制广告数量,则退出循环
                    if (i >= aModel.view_num)
                    {
                        break;
                    }
                    DataRow dr = ds.Tables[0].Rows[i];
                    picUrl.Append(dr["file_path"].ToString());
                    picLink.Append(dr["link_url"].ToString());
                    if (i < ds.Tables[0].Rows.Count - 1)
                    {
                        picUrl.Append("|");
                        picLink.Append("|");
                    }
                }
                context.Response.Write("document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" d=scriptmain name=scriptmain codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"" + aModel.view_width + "\" height=\"" + aModel.view_height + "\">');\n");
                context.Response.Write("document.write('<param name=\"movie\" value=\"/plugins/focus.swf?width=" + aModel.view_width + "&height=" + aModel.view_height + "&bigSrc=" + picUrl + "&href=" + picLink + "\">');\n");
                context.Response.Write("document.write('<param name=\"quality\" value=\"high\">');\n");
                context.Response.Write("document.write('<param name=\"loop\" value=\"false\">');\n");
                context.Response.Write("document.write('<param name=\"menu\" value=\"false\">');\n");
                context.Response.Write("document.write('<param name=\"wmode\" value=\"transparent\">');\n");
                context.Response.Write("document.write('<embed src=\"/plugins/focus.swf?width=" + aModel.view_width + "&height=" + aModel.view_height + "&bigSrc=" + picUrl + "&href=" + picLink + "\" width=\"" + aModel.view_width + "\" height=\"" + aModel.view_height + "\" loop=\"false\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" menu=\"false\"></embed>');\n");
                context.Response.Write("document.write('</object>');\n");
                break;

            case 4:     //动画
                if (ds.Tables[0].Rows.Count == 1)
                {
                    DataRow dr = ds.Tables[0].Rows[0];
                    context.Response.Write("document.write('<object classid=\"clsid:D27CDB6E-AE6D-11CF-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\" width=\"" + aModel.view_width + "\" height=\"" + aModel.view_height + "\">');\n");
                    context.Response.Write("document.write('<param name=\"movie\" value=\"" + dr["file_path"] + "\">');\n");
                    context.Response.Write("document.write('<param name=\"quality\" value=\"high\">');\n");
                    context.Response.Write("document.write('<param name=\"wmode\" value=\"transparent\">');\n");
                    context.Response.Write("document.write('<param name=\"menu\" value=\"false\">');\n");
                    context.Response.Write("document.write('<embed src=\"" + dr["file_path"] + "\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + aModel.view_width + "\" height=\"" + aModel.view_height + "\" quality=\"High\" wmode=\"transparent\">');\n");
                    context.Response.Write("document.write('</embed>');\n");
                    context.Response.Write("document.write('</object>');\n");
                }
                else
                {
                    context.Response.Write("document.write('<ul>');\n");
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        //如果超出限制广告数量,则退出循环
                        if (i >= aModel.view_num)
                        {
                            break;
                        }
                        DataRow dr = ds.Tables[0].Rows[i];
                        context.Response.Write("document.write('<li>');");
                        context.Response.Write("document.write('<object classid=\"clsid:D27CDB6E-AE6D-11CF-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\" width=\"" + aModel.view_width + "\" height=\"" + aModel.view_height + "\">');\n");
                        context.Response.Write("document.write('<param name=\"movie\" value=\"" + dr["file_path"] + "\">');\n");
                        context.Response.Write("document.write('<param name=\"quality\" value=\"high\">');\n");
                        context.Response.Write("document.write('<param name=\"wmode\" value=\"transparent\">');\n");
                        context.Response.Write("document.write('<param name=\"menu\" value=\"false\">');\n");
                        context.Response.Write("document.write('<embed src=\"" + dr["file_path"] + "\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + aModel.view_width + "\" height=\"" + aModel.view_height + "\" quality=\"High\" wmode=\"transparent\">');\n");
                        context.Response.Write("document.write('</embed>');\n");
                        context.Response.Write("document.write('</object>');\n");
                        context.Response.Write("document.write('</li>');\n");
                    }
                    context.Response.Write("document.write('</ul>');\n");
                }
                break;

            case 5:    //视频
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    //如果超出限制广告数量,则退出循环
                    if (i >= 1)
                    {
                        break;
                    }
                    DataRow dr = ds.Tables[0].Rows[i];
                    context.Response.Write("document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\" width=" + aModel.view_width + " height=" + aModel.view_height + " viewastext>');\n");
                    context.Response.Write("document.write('<param name=\"movie\" value=\"/plugins/player.swf\" />');\n");
                    context.Response.Write("document.write('<param name=\"quality\" value=\"high\" />');\n");
                    context.Response.Write("document.write('<param name=\"allowFullScreen\" value=\"true\" />');\n");
                    context.Response.Write("document.write('<param name=\"FlashVars\" value=\"vcastr_file=" + dr["file_path"].ToString() + "&LogoText=www.auto.cn&BarTransparent=30&BarColor=0xffffff&IsAutoPlay=1&IsContinue=1\" />');\n");
                    context.Response.Write("document.write('</object>');\n");
                }
                break;

            case 6:    //代码
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    //如果超出限制广告数量,则退出循环
                    if (i >= 1)
                    {
                        break;
                    }
                    DataRow       dr = ds.Tables[0].Rows[i];
                    StringBuilder sb = new StringBuilder(dr["content"].ToString());
                    sb.Replace("&lt;", "<");
                    sb.Replace("&gt;", ">");
                    sb.Replace("\"", "'");
                    context.Response.Write("document.write(\"" + sb.ToString() + "\")");
                }
                break;
            }
        }
コード例 #12
0
ファイル: advert_js.ashx.cs プロジェクト: eyren/OScms
        public void ProcessRequest(HttpContext context)
        {
            int aid = OSRequest.GetQueryInt("id");

            //获得广告位的ID
            if (aid < 1)
            {
                context.Response.Write("document.write('错误提示,请勿提交非法字符!');");
                return;
            }

            //检查广告位是否存在
            BLL.plugins.advert abll = new BLL.plugins.advert();
            if (!abll.Exists(aid))
            {
                context.Response.Write("document.write('错误提示,该广告位不存在!');");
                return;
            }

            //取得该广告位详细信息
            Model.plugins.advert aModel = abll.GetModel(aid);

            //输出该广告位下的广告条,不显示未开始、过期、暂停广告
            BLL.plugins.advert_banner bbll = new BLL.plugins.advert_banner();
            DataSet ds = bbll.GetList("is_lock=0 and datediff(d,start_time,getdate())>=0 and datediff(d,end_time,getdate())<=0 and aid=" + aid);
            if (ds.Tables[0].Rows.Count < 1)
            {
                context.Response.Write("document.write('该广告位下暂无广告内容');");
                return;
            }

            //=================判断广告位类别,输出广告条======================

            //新增,取得站点配置信息
                 Model.configs.siteconfig siteConfig = new BLL.configs.siteconfig().loadConfig(); //获得站点配置信息

            switch (aModel.type)
            {
                case 1: //文字
                    context.Response.Write("document.write('<ul>');\n");
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        //如果超出限制广告数量,则退出循环
                        if (i >= aModel.view_num)
                            break;
                        DataRow dr = ds.Tables[0].Rows[i];
                        context.Response.Write("document.write('<li>');");
                        context.Response.Write("document.write('<a title=\"" + dr["title"] + "\" target=\"" + aModel.target + "\" href=\"" + dr["link_url"] + "\">" + dr["title"] + "</a>');");
                        context.Response.Write("document.write('</li>');\n");
                    }
                    context.Response.Write("document.write('</ul>');\n");
                    break;
                case 2: //图片
                    if (ds.Tables[0].Rows.Count == 1)
                    {
                        DataRow dr = ds.Tables[0].Rows[0];
                        context.Response.Write("document.write('<a title=\"" + dr["title"] + "\" target=\"" + aModel.target + "\" href=\"" + dr["link_url"] + "\">');");
                        context.Response.Write("document.write('<img src=\"" + dr["file_path"] + "\" width=" + aModel.view_width + " height=" + aModel.view_height + " border=0 />');");
                        context.Response.Write("document.write('</a>');");
                    }
                    else
                    {
                        context.Response.Write("document.write('<ul>');\n");
                        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                        {
                            //如果超出限制广告数量,则退出循环
                            if (i >= aModel.view_num)
                                break;
                            DataRow dr = ds.Tables[0].Rows[i];
                            context.Response.Write("document.write('<li>');");
                            context.Response.Write("document.write('<a title=\"" + dr["title"] + "\" target=\"" + aModel.target + "\" href=\"" + dr["link_url"] + "\">');");
                            context.Response.Write("document.write('<img src=\"" + dr["file_path"] + "\" width=" + aModel.view_width + " height=" + aModel.view_height + " border=0 />');");
                            context.Response.Write("document.write('</a>');\n");
                            context.Response.Write("document.write('</li>');\n");
                        }
                        context.Response.Write("document.write('</ul>');\n");
                    }
                    break;
                case 3: //幻灯片
                    StringBuilder picTitle = new StringBuilder();
                    StringBuilder picUrl = new StringBuilder();
                    StringBuilder picLink = new StringBuilder();
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        //如果超出限制广告数量,则退出循环
                        if (i >= aModel.view_num)
                            break;
                        DataRow dr = ds.Tables[0].Rows[i];
                        picUrl.Append(dr["file_path"].ToString());
                        picLink.Append(dr["link_url"].ToString());
                        if (i < ds.Tables[0].Rows.Count - 1)
                        {
                            picUrl.Append("|");
                            picLink.Append("|");
                        }
                    }
                    context.Response.Write("document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" d=scriptmain name=scriptmain codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"" + aModel.view_width + "\" height=\"" + aModel.view_height + "\">');\n");
                    context.Response.Write("document.write('<param name=\"movie\" value=\"/plugins/focus.swf?width=" + aModel.view_width + "&height=" + aModel.view_height + "&bigSrc=" + picUrl + "&href=" + picLink + "\">');\n");
                    context.Response.Write("document.write('<param name=\"quality\" value=\"high\">');\n");
                    context.Response.Write("document.write('<param name=\"loop\" value=\"false\">');\n");
                    context.Response.Write("document.write('<param name=\"menu\" value=\"false\">');\n");
                    context.Response.Write("document.write('<param name=\"wmode\" value=\"transparent\">');\n");
                    context.Response.Write("document.write('<embed src=\"/plugins/focus.swf?width=" + aModel.view_width + "&height=" + aModel.view_height + "&bigSrc=" + picUrl + "&href=" + picLink + "\" width=\"" + aModel.view_width + "\" height=\"" + aModel.view_height + "\" loop=\"false\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" menu=\"false\"></embed>');\n");
                    context.Response.Write("document.write('</object>');\n");
                    break;
                case 4: //动画
                    if (ds.Tables[0].Rows.Count == 1)
                    {
                        DataRow dr = ds.Tables[0].Rows[0];
                        context.Response.Write("document.write('<object classid=\"clsid:D27CDB6E-AE6D-11CF-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\" width=\"" + aModel.view_width + "\" height=\"" + aModel.view_height + "\">');\n");
                        context.Response.Write("document.write('<param name=\"movie\" value=\"" + dr["file_path"] + "\">');\n");
                        context.Response.Write("document.write('<param name=\"quality\" value=\"high\">');\n");
                        context.Response.Write("document.write('<param name=\"wmode\" value=\"transparent\">');\n");
                        context.Response.Write("document.write('<param name=\"menu\" value=\"false\">');\n");
                        context.Response.Write("document.write('<embed src=\"" + dr["file_path"] + "\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + aModel.view_width + "\" height=\"" + aModel.view_height + "\" quality=\"High\" wmode=\"transparent\">');\n");
                        context.Response.Write("document.write('</embed>');\n");
                        context.Response.Write("document.write('</object>');\n");
                    }
                    else
                    {
                        context.Response.Write("document.write('<ul>');\n");
                        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                        {
                            //如果超出限制广告数量,则退出循环
                            if (i >= aModel.view_num)
                                break;
                            DataRow dr = ds.Tables[0].Rows[i];
                            context.Response.Write("document.write('<li>');");
                            context.Response.Write("document.write('<object classid=\"clsid:D27CDB6E-AE6D-11CF-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\" width=\"" + aModel.view_width + "\" height=\"" + aModel.view_height + "\">');\n");
                            context.Response.Write("document.write('<param name=\"movie\" value=\"" + dr["file_path"] + "\">');\n");
                            context.Response.Write("document.write('<param name=\"quality\" value=\"high\">');\n");
                            context.Response.Write("document.write('<param name=\"wmode\" value=\"transparent\">');\n");
                            context.Response.Write("document.write('<param name=\"menu\" value=\"false\">');\n");
                            context.Response.Write("document.write('<embed src=\"" + dr["file_path"] + "\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + aModel.view_width + "\" height=\"" + aModel.view_height + "\" quality=\"High\" wmode=\"transparent\">');\n");
                            context.Response.Write("document.write('</embed>');\n");
                            context.Response.Write("document.write('</object>');\n");
                            context.Response.Write("document.write('</li>');\n");
                        }
                        context.Response.Write("document.write('</ul>');\n");
                    }
                    break;
                case 5://视频
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        //如果超出限制广告数量,则退出循环
                        if (i >= 1)
                            break;
                        DataRow dr = ds.Tables[0].Rows[i];
                        context.Response.Write("document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\" width=" + aModel.view_width + " height=" + aModel.view_height + " viewastext>');\n");
                        context.Response.Write("document.write('<param name=\"movie\" value=\"/plugins/player.swf\" />');\n");
                        context.Response.Write("document.write('<param name=\"quality\" value=\"high\" />');\n");
                        context.Response.Write("document.write('<param name=\"allowFullScreen\" value=\"true\" />');\n");
                        context.Response.Write("document.write('<param name=\"FlashVars\" value=\"vcastr_file=" + dr["file_path"].ToString() + "&LogoText=www.auto.cn&BarTransparent=30&BarColor=0xffffff&IsAutoPlay=1&IsContinue=1\" />');\n");
                        context.Response.Write("document.write('</object>');\n");
                    }
                    break;
                case 6://代码
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        //如果超出限制广告数量,则退出循环
                        if (i >= 1)
                            break;
                        DataRow dr = ds.Tables[0].Rows[i];
                        StringBuilder sb = new StringBuilder(dr["content"].ToString());
                        sb.Replace("&lt;", "<");
                        sb.Replace("&gt;", ">");
                        sb.Replace("\"", "'");
                        context.Response.Write("document.write(\"" + sb.ToString() + "\")");
                    }
                    break;

            }
        }