市长热线演示版

ZuoXiWorkTotal.aspx.cs 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using System.Text;
  8. using System.Data;
  9. namespace HySoft.BaseCallCenter.Web.reportmanage.operationdata
  10. {
  11. public partial class ZuoXiWorkTotal : System.Web.UI.Page
  12. {
  13. protected void Page_Load(object sender, EventArgs e)
  14. {
  15. txtStartTime.Text = DateTime.Now.ToString("yyyy-MM-01");
  16. txtEndTime.Text = DateTime.Now.ToString("yyyy-MM-dd");
  17. if (!this.IsPostBack)
  18. {
  19. DataTable dt = DBUtility.DbHelperSQL.Query("select F_DeptId,F_DeptName,F_Remark from T_Sys_Department where F_ParentId!=0 and F_State=0").Tables[0];
  20. this.dtDpt.DataTextField = "F_DeptName";
  21. this.dtDpt.DataValueField = "F_DeptId";
  22. this.dtDpt.DataSource = dt;
  23. this.dtDpt.DataBind();
  24. this.dtDpt.Items.Insert(0, new ListItem("请选择"));
  25. this.dtDpt.SelectedIndex = 0;
  26. }
  27. }
  28. protected void exportExcel_Click(object sender, EventArgs e)
  29. {
  30. string fileName = "坐席报表" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls";
  31. Response.Clear();
  32. Response.Charset = "GB2312";
  33. Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
  34. Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fileName));
  35. Response.ContentType = "application/ms-excel";
  36. Response.Write(this.htHtmlReport.Value);
  37. Response.End();
  38. }
  39. }
  40. }