Exemplo n.º 1
0
    protected void btn_export_floor_Click(object sender, EventArgs e)
    {
        PatientTable pt = new PatientTable();
        DateTime     beginDate, endDate;

        beginDate = DateTime.Now.AddMonths(-1);
        endDate   = DateTime.Now.AddMonths(1);
        beginDate = Convert.ToDateTime(tbox_beginDate.Text);
        beginDate = beginDate.AddDays(-1);
        endDate   = Convert.ToDateTime(tbox_endDate.Text);
        endDate   = endDate.AddDays(1);
        string floorName = ddl_floor.SelectedValue;
        string category  = ddl_category2.SelectedValue;
        string fileName  = System.Configuration.ConfigurationManager.AppSettings["ExportPath"] + category + "_" + floorName + DateTime.Now.ToString("yyyyMMdd") + ".xls";
        string sqlWhere  = " and brifeInfo.floorName ='" + floorName + "'";
        string result    = "";

        switch (category)
        {
        case "医疗":
            result = pt.Exportyl(fileName, beginDate, endDate, sqlWhere);
            DownloadFile(result, Response, fileName, "医疗工作_" + category + "_" + floorName + ".xls");
            break;

        case "护理":
            result = pt.Exporthl(fileName, beginDate, endDate, sqlWhere);
            DownloadFile(result, Response, fileName, "护理工作_" + category + "_" + floorName + ".xls");
            break;

        case "医技":
            result = pt.Exportyj(fileName, beginDate, endDate, sqlWhere);
            DownloadFile(result, Response, fileName, "医技工作_" + category + "_" + floorName + ".xls");
            break;

        case "后勤":
            result = pt.Exporthq(fileName, beginDate, endDate, sqlWhere);
            DownloadFile(result, Response, fileName, "后勤工作_" + category + "_" + floorName + ".xls");
            break;

        case "行政-收费":
            result = pt.Exportzy(fileName, beginDate, endDate, sqlWhere);
            DownloadFile(result, Response, fileName, "行政-收费_" + category + "_" + floorName + ".xls");
            break;

        default:
            break;
        }
    }
Exemplo n.º 2
0
    protected void btn_export_zy_Click(object sender, EventArgs e)
    {
        PatientTable pt = new PatientTable();
        DateTime     beginDate, endDate;

        beginDate = DateTime.Now.AddMonths(-1);
        endDate   = DateTime.Now.AddMonths(1);
        beginDate = Convert.ToDateTime(tbox_beginDate.Text);
        beginDate = beginDate.AddDays(-1);
        endDate   = Convert.ToDateTime(tbox_endDate.Text);
        endDate   = endDate.AddDays(1);
        string fileName = System.Configuration.ConfigurationManager.AppSettings["ExportPath"] + "行政收费.xls";
        string result   = pt.Exportzy(fileName, beginDate, endDate, null);

        DownloadFile(result, Response, fileName, "行政收费.xls");
    }
Exemplo n.º 3
0
    protected void btn_export_dept_Click(object sender, EventArgs e)
    {
        PatientTable pt = new PatientTable();
        DateTime     beginDate, endDate;

        beginDate = DateTime.Now.AddMonths(-1);
        endDate   = DateTime.Now.AddMonths(1);
        beginDate = Convert.ToDateTime(tbox_beginDate.Text);
        beginDate = beginDate.AddDays(-1);
        endDate   = Convert.ToDateTime(tbox_endDate.Text);
        endDate   = endDate.AddDays(1);
        string    deptName = "";     // ddl_dept.SelectedValue;
        UserPower user     = Session["user"] as UserPower;

        if (user == null)
        {
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "javascript", "<script>alert('没有登录或会话失效,请登录!')</script>");
            Response.Redirect("../../Admin_login.aspx");
        }
        else
        {
            deptName = user.GetPowerDept();
            if (deptName.Equals(""))
            {
                //use selected dept
                deptName = ddl_dept.SelectedValue;
            }
        }
        //deptName = GetPowerDept()
        string category = ddl_category1.SelectedValue;
        string fileName = System.Configuration.ConfigurationManager.AppSettings["ExportPath"] + category + "_" + deptName + DateTime.Now.ToString("yyyyMMdd") + ".xls";
        string sqlWhere = " and brifeInfo.dept ='" + deptName + "'";
        string result   = "";

        switch (category)
        {
        case "医疗":
            result = pt.Exportyl(fileName, beginDate, endDate, sqlWhere);
            DownloadFile(result, Response, fileName, "医疗_" + category + "_" + deptName + ".xls");
            break;

        case "护理":
            result = pt.Exporthl(fileName, beginDate, endDate, sqlWhere);
            DownloadFile(result, Response, fileName, "护理_" + category + "_" + deptName + ".xls");
            break;

        case "医技":
            result = pt.Exportyj(fileName, beginDate, endDate, sqlWhere);
            DownloadFile(result, Response, fileName, "医技_" + category + "_" + deptName + ".xls");
            break;

        case "后勤":
            result = pt.Exporthq(fileName, beginDate, endDate, sqlWhere);
            DownloadFile(result, Response, fileName, "后勤_" + category + "_" + deptName + ".xls");
            break;

        case "行政-收费":
            result = pt.Exportzy(fileName, beginDate, endDate, sqlWhere);
            DownloadFile(result, Response, fileName, "行政-收费_" + category + "_" + deptName + ".xls");
            break;

        default:
            break;
        }
    }