SelectMateril.aspx.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:3k
- 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;
- using com.etong.DAL.FC;
- public partial class Workflow_SelectMateril : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- string strContent = Request.QueryString["StrE"];
- string sFiled = "wz_id,wz_name,wz_spec";
- string sTable = "material_name where ";
- DataView dv = new DataView();
- EtongFlyChouCode EFlyCode = new EtongFlyChouCode();
- sTable = sTable + "wz_spec like '%" + strContent + "%'";
- dv=EFlyCode.BStringSelect(sFiled, sTable, 2);
- GridView1.DataSource = dv;
- GridView1.DataBind();
- }
- }
- protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- int iRow;
- iRow = e.Row.DataItemIndex;
- iRow = iRow % 2;
- if (iRow > 0)
- e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor='#f0f0f0';");
- else
- e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor='White';");
- e.Row.Attributes.Add("OnMouseOver", "this.style.backgroundColor='#E8F2FA';");
- }
- }
- protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
- {
- string sSelectedIndex;
- int iSelectedIndex = 0;
- sSelectedIndex = WZID.Value;
- if (sSelectedIndex.Trim() == "" || sSelectedIndex == null)
- {
- }
- else
- {
- try
- {
- iSelectedIndex = Convert.ToInt32(sSelectedIndex);
- }
- catch
- {
- iSelectedIndex = -1;
- }
- if (iSelectedIndex != -1)
- {
- ImageButton imgbtselected;
- imgbtselected = this.GridView1.Rows[iSelectedIndex].FindControl("IB_Selected") as ImageButton;
- imgbtselected.Visible = false;
- }
- }
- int i = GridView1.SelectedIndex;
- WZID.Value = Convert.ToString(i);
- ImageButton imgbt;
- imgbt = this.GridView1.SelectedRow.FindControl("IB_Selected") as ImageButton;
- imgbt.Visible = true;
- this.GridView1.SelectedRow.HorizontalAlign = HorizontalAlign.Center;
- WZValue.Value = this.GridView1.SelectedRow.Cells[2].Text;
- //TB_SelectName.Value = this.GridView1.SelectedRow.Cells[1].Text;
- //imgbt = this.GridView1.TemplateControl.FindControl("IB_Del") as ImageButton;
- }
- protected void OKConfirm_Click(object sender, ImageClickEventArgs e)
- {
- Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>window.returnValue=" +WZValue.Value +";window.close();</script>");
- }
- }