//导出数据 protected void Button1_Click(object sender, EventArgs e) { string tisanetime1 = ""; string STime1 = ""; string ETime1 = ""; string tisanestatus1 = ""; STime1 = STime.Value; ETime1 = ETime.Value; if (tisanestatus.Value == "") { tisanestatus1 = "2"; } else { tisanestatus1 = tisanestatus.Value; } string tisanemethod1 = tisanemethod.Value; string tisaneman1 = tisaneman.Value; string tisaneid1 = ""; if (tisaneid.Value == "") { tisaneid1 = "0"; } else { tisaneid1 = tisaneid.Value; } if (tisaneid1 == "") { tisaneid1 = "0"; } if (tisaneman1 == "") { tisaneman1 = "0"; } TeModel tm = new TeModel(); // DataBaseLayer db = new DataBaseLayer(); // string str = "select * from lossiInfor where type ='" + type + "'"; DataTable dt = tm.queryTisaneInfoDao(Convert.ToInt32(tisaneid1), tisaneman1, Convert.ToInt32(tisanestatus1), Convert.ToInt32(tisanemethod1), STime1, ETime1); System.DateTime currentTime = new System.DateTime(); currentTime = System.DateTime.Now; string now = currentTime.ToString("yyyyMMdd"); CreateExcel(dt, "application/ms-excel", "煎药查询功能" + now); }