您目前尚未登陆,请选择【登陆】或【注册
首页->行政办公->某公司人事工资管理系统源码>>CheckManage/YearCheckPrint.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:某公司人事工资管理系统源码
当前文件:文件类型 StaffSalaryManage/CheckManage/YearCheckPrint.aspx.cs打开代码结构图
高亮显示
		            //文件名:YearCheckPrint.aspx.cs
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;
public partial class CheckManage_YearCheckPrint : System.Web.UI.Page
{
    private CheckManage_YearCheckForm MyYearCheckForm;
    protected void Page_Load(object sender, EventArgs e)
    {//将查询结果输出到Excel文件中
        MyYearCheckForm = (CheckManage_YearCheckForm)Context.Handler;
        string MySQL = MyYearCheckForm.MyPrintSQL;
        this.Label1.Text = MyYearCheckForm.MyPrintTitle;
        this.Label2.Text = MyYearCheckForm.MyPrintDate + "  (考勤符号说明:出勤/,迟到>,早退< ,产假√, 事假#, 病假+, 婚假△, 旷工×)";
        string MyConnectionString = ConfigurationManager.ConnectionStrings["MyPersonnelDBConnectionString"].ConnectionString; ;
        SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnectionString);
        DataSet MySet = new DataSet();
        MyAdapter.Fill(MySet);
        this.DataGrid1.DataSource = MySet;
        this.DataGrid1.DataBind();
        this.Response.ContentType = "application/vnd.ms-excel";
        this.Response.Charset = "";
        //关闭 ViewState
        this.EnableViewState = false;
        System.IO.StringWriter MyWriter;
        System.Web.UI.HtmlTextWriter MyWeb;
        //将信息写入字符串
        MyWriter = new System.IO.StringWriter();
        //在Web窗体页上写出一系列连续的HTML特定字符和文本
        MyWeb = new System.Web.UI.HtmlTextWriter(MyWriter);
        //将DataGrid中的内容输出到HtmlTextWriter对象中
        this.DataGrid1.RenderControl(MyWeb);
        //把HTML写回浏览器
        Response.Write(MyWriter.ToString());
    }

}


        
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:某公司人事工资管理系统源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号