yjfc_xinxi/Report.aspx.cs

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Text;
namespace yjfc_xinxi
{
    public partial class Report : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string startdate = TextBox1.Text.ToString().Trim();
            string enddate = TextBox2.Text.ToString().Trim();
            string sql = "select c.organizename as 部门, c.usertruename as 信息员,count(case c.jifenjb when '信息提交' then c.jifen else null end) as [信息提交数量(条)],sum(case c.jifenjb when '信息提交' then c.jifen else null end) as [信息提交总积分(分)],count(case c.jifenjb when '房产之窗采用' then c.jifen else null end) as [房产之窗采用数量(条)],sum(case c.jifenjb when '房产之窗采用' then c.jifen else null end) as [房产之窗采用总积分(分)],count(case c.jifenjb when '市级信息采用' then c.jifen else null end) as [市级信息采用数量(条)],sum(case c.jifenjb when '市级信息采用' then c.jifen else null end) as [市级信息采用总积分(分)],count(case c.jifenjb when '市级信息简讯采用' then c.jifen else null end) as [市级信息简讯采用数量(条)],sum(case c.jifenjb when '市级信息简讯采用' then c.jifen else null end) as [市级信息简讯采用总积分(分)],count(case c.jifenjb when '州级信息采用' then c.jifen else null end) as [州级信息采用数量(条)],sum(case c.jifenjb when '州级信息采用' then c.jifen else null end) as [州级信息采用总积分(分)],count(case c.jifenjb when '省级信息采用' then c.jifen else null end) as [省级信息采用数量(条)],sum(case c.jifenjb when '省级信息采用' then c.jifen else null end) as [市省级信息采用总积分(分)],count(case c.jifenjb when '国家级信息采用' then c.jifen else null end) as [国家级信息采用数量(条)],sum(case c.jifenjb when '国家级信息采用' then c.jifen else null end) as [国家级信息采用总积分(分)],count(case c.jifenjb when '市级媒体及网站采用' then c.jifen else null end) as [市级媒体及网站采用数量(条)],sum(case c.jifenjb when '市级媒体及网站采用' then c.jifen else null end) as [市级媒体及网站采用总积分(分)],count(case c.jifenjb when '州级媒体及网站采用' then c.jifen else null end) as [州级媒体及网站采用数量(条)],sum(case c.jifenjb when '州级媒体及网站采用' then c.jifen else null end) as [州级媒体及网站采用总积分(分)],count(case c.jifenjb when '省级媒体及网站采用' then c.jifen else null end) as [省级媒体及网站采用数量(条)],sum(case c.jifenjb when '省级媒体及网站采用' then c.jifen else null end) as [省级媒体及网站采用总积分(分)],count(case c.jifenjb when '国家级媒体及网站采用' then c.jifen else null end) as [国家级媒体及网站采用数量(条)],sum(case c.jifenjb when '国家级媒体及网站采用' then c.jifen else null end) as [国家级媒体及网站采用总积分(分)],count(case c.jifenjb when '市级约稿采用' then c.jifen else null end) as [市级约稿采用数量(条)],sum(case c.jifenjb when '市级约稿采用' then c.jifen else null end) as [市级约稿采用总积分(分)],count(case c.jifenjb when '领导批示' then c.jifen else null end) as [领导批示数量(条)],sum(case c.jifenjb when '领导批示' then c.jifen else null end) as [领导批示总积分(分)],count(case c.jifenjb when '州领导批示' then c.jifen else null end) as [州领导批示数量(条)],sum(case c.jifenjb when '州领导批示' then c.jifen else null end) as [州领导批示总积分(分)],count(case c.jifenjb when '省领导批示' then c.jifen else null end) as [省领导批示数量(条)],sum(case c.jifenjb when '省领导批示' then c.jifen else null end) as [省领导批示总积分(分)],count(case c.jifenjb when '国家领导批示' then c.jifen else null end) as [国家领导批示数量(条)],sum(case c.jifenjb when '国家领导批示' then c.jifen else null end) as [国家领导批示总积分(分)]from (select xinxi_jifen.*,xinxi_xinxi.issubmit,xinxi_xinxi.isused,xinxi_xinxi.xinxititle, xinxi_xinxi.xinxiid,xinxi_users.usertruename,xinxi_organize.organizename,xinxi_xinxi.xinxitime,xinxi_xinxi.xinxi_usetime from xinxi_users left outer join xinxi_xinxi on xinxi_xinxi.xinxiauthor=xinxi_users.userid left outer join xinxi_organize on xinxi_users.organizeid=xinxi_organize.organizeid left outer join xinxi_jifen on xinxi_xinxi.xinxijifenid=xinxi_jifen.jifenid where xinxi_xinxi.xinxititle is not null and xinxi_xinxi.xinxitime>='"+startdate+"' and xinxi_xinxi.xinxitime <='"+enddate+"') as c group by c.organizename,c.usertruename order by c.organizename";
            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString);
            SqlDataAdapter adp = new SqlDataAdapter(sql, conn);
            DataSet ds = new DataSet();
            conn.Open();
            adp.Fill(ds);
            GridView1.DataSource = ds;
           GridView1.DataBind();
            //Repeater2.DataSource = ds;
            //Repeater2.DataBind();
            conn.Close();
            Button2.Visible = true;
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            string filename = "市房产局" + TextBox1.Text.ToString() + "至" + TextBox2.Text.ToString() + "信息报送及稿件采用情况表.xls";
            Export(GridView1, "1", filename);
        }
        /// <summary>
        /// GridView导出Word或Excel表格
        /// </summary>
        /// <param name="_gv">要导出的GridView名称</param>
        /// <param name="filetype">要导出的类型:1为Excel,其它值为Word</param>
        /// <param name="FileName">要导出的文件的名称,速扩展名</param>
        private void Export(GridView _gv, string filetype, string FileName)
        {
            if (filetype == "1")
            {
                string style = @"<style> .text { mso-number-format:\@; } </script> ";
                Response.Clear();
                Response.Buffer = true;
                Response.Charset = "GB2312";
                Response.Write("<meta http-equiv=Content-Type content=text/html;charset=GB2312>");
                Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(FileName, Encoding.UTF8).ToString());//FileName.xls");
后面还有 35 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。