- 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;
- public partial class Entertain_SearchEntertain : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- LoginLogic.MatchLoad("../", "Entertain_SearchEntertain");
- if (!IsPostBack)
- {
- DropLoadSet();
- }
- }
- /// <summary>
- /// 绑定接待类别
- /// </summary>
- public void DropLoadSet()
- {
- //接待类别
- KeyValue_JDLB.DataTextField = "Text";
- KeyValue_JDLB.DataValueField = "Value";
- KeyValue_JDLB.DataSource = EnumGet.JieDaiGetEnum();
- KeyValue_JDLB.DataBind();
- ListItem linone = new ListItem();
- linone.Text = "--请选择--";
- linone.Value = "0";
- KeyValue_JDLB.Items.Add(linone);
- KeyValue_JDLB.SelectedIndex = KeyValue_JDLB.Items.Count - 1;
- }
- public void DropLoadSet(string i)
- {
- string name = EnumGet.GetJieDaiName(i);
- switch (name)
- {
- case "用餐":
- KeyValue_XXLB.Enabled = true;
- KeyValue_XXLB.DataTextField = "YCLBMC";
- KeyValue_XXLB.DataValueField = "ID";
- KeyValue_XXLB.DataSource = EnumGet.YongCanGetEnum();
- KeyValue_XXLB.DataBind();
- ListItem linone = new ListItem();
- linone.Text = "--请选择--";
- linone.Value = "0";
- KeyValue_XXLB.Items.Add(linone);
- KeyValue_XXLB.SelectedIndex = KeyValue_XXLB.Items.Count - 1;
- break;
- case "住宿":
- KeyValue_XXLB.Enabled = true;
- KeyValue_XXLB.DataTextField = "ZSLBM";
- KeyValue_XXLB.DataValueField = "ID";
- KeyValue_XXLB.DataSource = EnumGet.ZhuSuGetEnum();
- KeyValue_XXLB.DataBind();
- ListItem linone2 = new ListItem();
- linone2.Text = "--请选择--";
- linone2.Value = "0";
- KeyValue_XXLB.Items.Add(linone2);
- KeyValue_XXLB.SelectedIndex = KeyValue_XXLB.Items.Count - 1;
- break;
- default:
- KeyValue_XXLB.Items.Clear();
- KeyValue_XXLB.Enabled = false;
- break;
- }
- }
- protected void KeyValue_JDLB_SelectedIndexChanged(object sender, EventArgs e)
- {
- string i = KeyValue_JDLB.SelectedValue;
- DropLoadSet(i);
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- string SqlStr = "";
- SqlStr += " JDLB = '" + KeyValue_JDLB.SelectedValue + "'";
- if (KeyValue_XXLB.Enabled == true)
- {
- SqlStr += " and XXLB = '" + KeyValue_XXLB.SelectedValue + "'";
- }
- if (!String.IsNullOrEmpty(KeyValue_BJDZXM.Text))
- {
- SqlStr += " and BJDZXM like '" + RP.SDot(KeyValue_BJDZXM.Text) + "%'";
- }
- if (!String.IsNullOrEmpty(KeyValue_FSRQ.Text))
- {
- SqlStr += " and convert(varchar(10),FSRQ,120) = convert(varchar(10)," + KeyValue_FSRQ + ",120)";
- }
- SqlStr = Server.UrlEncode(SqlStr);
- Response.Redirect("EntertainManager.aspx?TiaoJian=" + SqlStr);
- }
- }