- 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 FileBooks_SearchRollFiles : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- LoginLogic.MatchLoad("../", "FileBooks_SearchRollFiles");
- if (!IsPostBack)
- {
- DropLoadSet();
- }
- }
- public void DropLoadSet()
- {
- //部门
- KeyValue_SSBM.DataTextField = "DeptName";
- KeyValue_SSBM.DataValueField = "ID";
- KeyValue_SSBM.DataSource = EnumGet.DepartmentGetEnum();
- KeyValue_SSBM.DataBind();
- ListItem linone = new ListItem();
- linone.Text = "无";
- linone.Value = "0";
- KeyValue_SSBM.Items.Add(linone);
- KeyValue_SSBM.SelectedIndex = KeyValue_SSBM.Items.Count - 1;
- //卷库
- KeyValue_SSJK.DataTextField = "JKMC";
- KeyValue_SSJK.DataValueField = "ID";
- KeyValue_SSJK.DataSource = EnumGet.RollRoomsGetEnum();
- linone.Text = "无";
- linone.Value = "0";
- KeyValue_SSJK.Items.Add(linone);
- KeyValue_SSJK.DataBind();
- KeyValue_SSJK.SelectedIndex = KeyValue_SSJK.Items.Count - 1;
- //密级
- KeyValue_JAMJ.DataTextField = "Text";
- KeyValue_JAMJ.DataValueField = "Value";
- KeyValue_JAMJ.DataSource = EnumGet.MiJiGetEnum();
- KeyValue_JAMJ.DataBind();
- linone.Text = "无";
- linone.Value = "0";
- KeyValue_JAMJ.Items.Add(linone);
- KeyValue_JAMJ.SelectedIndex = KeyValue_JAMJ.Items.Count - 1;
- //凭证
- KeyValue_PZLB.DataTextField = "Text";
- KeyValue_PZLB.DataValueField = "Value";
- KeyValue_PZLB.DataSource = EnumGet.PingZhengGetEnum();
- KeyValue_PZLB.DataBind();
- linone.Text = "无";
- linone.Value = "0";
- KeyValue_PZLB.Items.Add(linone);
- KeyValue_PZLB.SelectedIndex = KeyValue_PZLB.Items.Count - 1;
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- string SqlStr = "";
- SqlStr = Server.UrlEncode(SqlStr);
- SqlStr += " JAH like '" + RP.SDot(KeyValue_JAH.Text) + "%' and";
- if (KeyValue_SSJK.SelectedValue != "0")
- {
- SqlStr += " SSJK = '" + RP.SDot(KeyValue_SSJK.SelectedValue) + "' and";
- }
- if (KeyValue_SSBM.SelectedValue != "0")
- {
- SqlStr += " SSBM = '" + RP.SDot(KeyValue_SSBM.SelectedValue) + "' and";
- }
- SqlStr += " BGQX like '" + RP.SDot(KeyValue_BGQX.Text) + "%' and";
- SqlStr += " QZH like '" + RP.SDot(KeyValue_QZH.Text) + "%' and";
- SqlStr += " DAGH like '" + RP.SDot(KeyValue_DAGH.Text) + "%' and";
- SqlStr += " SWH like '" + RP.SDot(KeyValue_SWH.Text) + "%' and";
- SqlStr += " PZBH1 like '" + RP.SDot(KeyValue_PZBH1.Text) + "%' and";
- SqlStr += " YS like '" + RP.SDot(KeyValue_YS.Text) + "%' and";
- SqlStr += " ANMC like '" + RP.SDot(KeyValue_ANMC.Text) + "%' and";
- SqlStr += " JZND like '" + RP.SDot(KeyValue_JZND.Text) + "%' and";
- SqlStr += " ZZRQ like '" + RP.SDot(KeyValue_ZZRQ.Text) + "%' and";
- SqlStr += " BZJG like '" + RP.SDot(KeyValue_BZJG.Text) + "%' and";
- if (KeyValue_JAMJ.SelectedValue != "0")
- {
- SqlStr += " JAMJ ='" + RP.SDot(KeyValue_JAMJ.SelectedValue) + "' and";
- }
- SqlStr += " MLH like '" + RP.SDot(KeyValue_MLH.Text) + "%' and";
- SqlStr += " BXXH like '" + RP.SDot(KeyValue_BXXH.Text) + "%' and";
- if (KeyValue_PZLB.SelectedValue != "0")
- {
- SqlStr += " PZLB ='" + RP.SDot(KeyValue_PZLB.SelectedValue) + "' and";
- }
- SqlStr += " PZBH2 like '" + RP.SDot(KeyValue_PZBH2.Text) + "%' and";
- SqlStr += " BZ like '" + RP.SDot(KeyValue_BZ.Text) + "%' ";
- if ((KeyValue_QSRQ.Text != "") && (KeyValue_QSRQ2.Text != ""))
- {
- SqlStr += " and QSRQ >='" + KeyValue_QSRQ.Text + "' and QSRQ<='" + KeyValue_QSRQ2.Text + "'";
- }
- if ((KeyValue_ZZRQ.Text != "") && (KeyValue_ZZRQ2.Text != ""))
- {
- SqlStr += " and ZZRQ >='" + KeyValue_ZZRQ.Text + "' and ZZRQ<='" + KeyValue_ZZRQ2.Text + "'";
- }
- Response.Redirect("RollFilesManager.aspx?TiaoJian=" + SqlStr);
- }
- }