SearchEntertain.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:3k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. public partial class Entertain_SearchEntertain : System.Web.UI.Page
  12. {
  13.     protected void Page_Load(object sender, EventArgs e)
  14.     {
  15.         LoginLogic.MatchLoad("../", "Entertain_SearchEntertain");
  16.         if (!IsPostBack)
  17.         {
  18.             DropLoadSet();
  19.         }
  20.     }
  21.     /// <summary>
  22.     /// 绑定接待类别
  23.     /// </summary>
  24.     public void DropLoadSet()
  25.     {
  26.         //接待类别
  27.         KeyValue_JDLB.DataTextField = "Text";
  28.         KeyValue_JDLB.DataValueField = "Value";
  29.         KeyValue_JDLB.DataSource = EnumGet.JieDaiGetEnum();
  30.         KeyValue_JDLB.DataBind();
  31.         ListItem linone = new ListItem();
  32.         linone.Text = "--请选择--";
  33.         linone.Value = "0";
  34.         KeyValue_JDLB.Items.Add(linone);
  35.         KeyValue_JDLB.SelectedIndex = KeyValue_JDLB.Items.Count - 1;
  36.     }
  37.     public void DropLoadSet(string i)
  38.     {
  39.         string name = EnumGet.GetJieDaiName(i);
  40.         switch (name)
  41.         {
  42.             case "用餐":
  43.                 KeyValue_XXLB.Enabled = true;
  44.                 KeyValue_XXLB.DataTextField = "YCLBMC";
  45.                 KeyValue_XXLB.DataValueField = "ID";
  46.                 KeyValue_XXLB.DataSource = EnumGet.YongCanGetEnum();
  47.                 KeyValue_XXLB.DataBind();
  48.                 ListItem linone = new ListItem();
  49.                 linone.Text = "--请选择--";
  50.                 linone.Value = "0";
  51.                 KeyValue_XXLB.Items.Add(linone);
  52.                 KeyValue_XXLB.SelectedIndex = KeyValue_XXLB.Items.Count - 1;
  53.                 break;
  54.             case "住宿":
  55.                 KeyValue_XXLB.Enabled = true;
  56.                 KeyValue_XXLB.DataTextField = "ZSLBM";
  57.                 KeyValue_XXLB.DataValueField = "ID";
  58.                 KeyValue_XXLB.DataSource = EnumGet.ZhuSuGetEnum();
  59.                 KeyValue_XXLB.DataBind();
  60.                 ListItem linone2 = new ListItem();
  61.                 linone2.Text = "--请选择--";
  62.                 linone2.Value = "0";
  63.                 KeyValue_XXLB.Items.Add(linone2);
  64.                 KeyValue_XXLB.SelectedIndex = KeyValue_XXLB.Items.Count - 1;
  65.                 break;
  66.             default:
  67.                 KeyValue_XXLB.Items.Clear();
  68.                 KeyValue_XXLB.Enabled = false;
  69.                 break;
  70.         }
  71.     }
  72.     protected void KeyValue_JDLB_SelectedIndexChanged(object sender, EventArgs e)
  73.     {
  74.         string i = KeyValue_JDLB.SelectedValue;
  75.         DropLoadSet(i);
  76.     }
  77.     protected void Button1_Click(object sender, EventArgs e)
  78.     {
  79.         string SqlStr = "";
  80.         SqlStr += " JDLB = '" + KeyValue_JDLB.SelectedValue + "'";
  81.         if (KeyValue_XXLB.Enabled == true)
  82.         {
  83.             SqlStr += " and XXLB = '" + KeyValue_XXLB.SelectedValue + "'";
  84.         }
  85.         if (!String.IsNullOrEmpty(KeyValue_BJDZXM.Text))
  86.         {
  87.             SqlStr += " and BJDZXM like '" + RP.SDot(KeyValue_BJDZXM.Text) + "%'";
  88.         }
  89.         if (!String.IsNullOrEmpty(KeyValue_FSRQ.Text))
  90.         {
  91.             SqlStr += " and convert(varchar(10),FSRQ,120) = convert(varchar(10)," + KeyValue_FSRQ + ",120)";
  92.         }
  93.         SqlStr = Server.UrlEncode(SqlStr);
  94.         Response.Redirect("EntertainManager.aspx?TiaoJian=" + SqlStr);
  95.     }
  96. }