SearchDuty.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:2k
- 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 Dutys_SearchDuty : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- LoginLogic.MatchLoad("../", "Dutys_SearchDuty");
- if (!IsPostBack)
- {
- DropLoadSet();
- }
- }
- public void DropLoadSet()
- {
- //值班类别
- KeyValue_ZBLB.DataTextField = "LBMC";
- KeyValue_ZBLB.DataValueField = "ID";
- KeyValue_ZBLB.DataSource = EnumGet.ZhiBanTypeGetEnum();
- KeyValue_ZBLB.DataBind();
- ListItem linone = new ListItem();
- linone.Text = "--请选择--";
- linone.Value = "0";
- KeyValue_ZBLB.Items.Add(linone);
- KeyValue_ZBLB.SelectedIndex = KeyValue_ZBLB.Items.Count - 1;
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- string SqlStr = "";
- SqlStr += " ZBLB = '" + KeyValue_ZBLB.SelectedValue + "'";
- if (!String.IsNullOrEmpty(KeyValue_ZBRY.Text.Trim()))
- {
- SqlStr += " and ZBRY like '" + RP.SDot(KeyValue_ZBRY.Text) + "%'";
- }
- if (!String.IsNullOrEmpty(KeyValue_ZBKSSJ.Text.Trim()))
- {
- SqlStr += " and convert(varchar(10),ZBKSSJ,120) >= convert(varchar(10)," + KeyValue_ZBKSSJ.Text + ",120)";
- }
- if (!String.IsNullOrEmpty(KeyValue_ZBJSSJ.Text.Trim()))
- {
- SqlStr += " and convert(varchar(10),ZBJSSJ,120) <= convert(varchar(10)," + KeyValue_ZBJSSJ.Text + ",120)";
- }
- SqlStr = Server.UrlEncode(SqlStr);
- Response.Redirect("DutysManager.aspx?TiaoJian=" + SqlStr);
- }
- }