using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        ykkw.SelectCommand = "select ksbh,xm,'第1天上午' as kssj,zzllm as kmdm,zzllmc as kmmc,kdmc,(select ldmc+lc from t_kdkc where t_kdkc.kddm=t_ksxx.kddm and t_kdkc.bh=t_ksxx.bh) as kcwz,kch,zwh from t_ksxx,t_kddm where t_ksxx.kccx='1' and t_ksxx.kddm=t_kddm.kddm and t_ksxx.ksbh='" + ksbh.Text + "' and zjhm='" + zjhm.Text + "' " +
"union select ksbh,xm,'第1天下午' as kssj,wgym as kmdm,wgymc as kmmc,kdmc,(select ldmc+lc from t_kdkc where t_kdkc.kddm=t_ksxx.kddm and t_kdkc.bh=t_ksxx.bh) as kcwz,kch,zwh from t_ksxx,t_kddm where t_ksxx.kccx='1' and  t_ksxx.kddm=t_kddm.kddm and t_ksxx.ksbh='" + ksbh.Text + "' and zjhm='" + zjhm.Text + "' " +
"union select ksbh,xm,'第2天上午' as kssj,ywk1m as kmdm,ywk1mc as kmmc,kdmc,(select ldmc+lc from t_kdkc where t_kdkc.kddm=t_ksxx.kddm and t_kdkc.bh=t_ksxx.bh) as kcwz,kch,zwh from t_ksxx,t_kddm where t_ksxx.kccx='1' and  t_ksxx.kddm=t_kddm.kddm and t_ksxx.ksbh='" + ksbh.Text + "' and zjhm='" + zjhm.Text + "' and ywk1m<>'999' " +
"union select ksbh,xm,'第2天下午' as kssj,ywk2m as kmdm,ywk2mc as kmmc,kdmc,(select ldmc+lc from t_kdkc where t_kdkc.kddm=t_ksxx.kddm and t_kdkc.bh=t_ksxx.bh) as kcwz,kch,zwh from t_ksxx,t_kddm where t_ksxx.kccx='1' and  t_ksxx.kddm=t_kddm.kddm and t_ksxx.ksbh='" + ksbh.Text + "' and zjhm='" + zjhm.Text + "' and ywk2m<>'999' " +
"union select t_km5.ksbh,t_km5.xm,'第3天上午' as kssj,t_km5.ywk3m as kmdm,t_km5.ywk3mc as kmmc,kdmc,(select ldmc+lc from t_kdkc where t_kdkc.kddm=t_km5.kddm and t_kdkc.bh=t_km5.bh) as kcwz,t_km5.kch,t_km5.zwh from t_km5,t_ksxx,t_kddm where t_ksxx.kccx='1' and t_km5.ksbh=t_ksxx.ksbh and t_km5.kddm=t_kddm.kddm and t_km5.ksbh='" + ksbh.Text + "' and zjhm='" + zjhm.Text + "' ";
        GridView1.DataBind();
    }
}