悬赏园豆:5
[已解决问题]
解决于 2008-07-25 10:44
<P><BR> #region 查询随行人员<BR> protected void lbtcha_Click(object sender, ImageClickEventArgs e)<BR> {<BR> try<BR> {<BR> a = 1;<BR> this.Panel1.Visible = true;<BR> }<BR> catch (lepus.CException ex)<BR> {<BR> ex.ToString();</P>
<P> }<BR> catch (Exception ex)<BR> {<BR> ex.ToString();</P>
<P> }</P>
<P> }<BR> #endregion</P>
<P> #region 查询员工<BR> protected void lbtquery_Click(object sender, ImageClickEventArgs e)<BR> {<BR> try<BR> {<BR> a = 0;<BR> this.Panel1.Visible = true;<BR> BandgvSearchItem();<BR> }<BR> catch (lepus.CException ex)<BR> {<BR> ex.ToString();</P>
<P> }<BR> catch (Exception ex)<BR> {<BR> ex.ToString();</P>
<P> }<BR> }<BR> #endregion</P>
<P> #region 员工选择事件<BR> protected void gvSearchItem_SelectedIndexChanged(object sender, EventArgs e)<BR> {<BR> try<BR> {<BR> if (a == 0)<BR> {<BR> this.txtname.Text = this.gvSearchItem.SelectedRow.Cells[1].Text.ToString();<BR> this.txtdepar.Text = this.gvSearchItem.SelectedRow.Cells[2].Text.ToString();<BR> this.Panel1.Visible = false;<BR> BandList();<BR> }<BR> else <BR> {<BR> this.txtemp.Text = this.gvSearchItem.SelectedRow.Cells[1].Text.ToString();<BR> this.Panel1.Visible = false;</P>
<P> }<BR> }<BR> catch (lepus.CException ex)<BR> {<BR> ex.ToString();</P>
<P> }<BR> catch (Exception ex)<BR> {<BR> ex.ToString();</P>
<P> }<BR> }<BR> #endregion</P>
<P> #region 员工查询的确定事件<BR> protected void lbtquety_Click(object sender, ImageClickEventArgs e)<BR> {<BR> try<BR> {<BR> this.BandGv1();<BR> }<BR> catch (lepus.CException ex)<BR> {<BR> ex.ToString();</P>
<P> }<BR> catch (Exception ex)<BR> {<BR> ex.ToString();</P>
<P> }</P>
<P> }<BR> #endregion</P>
<P> #region 查询设备清单事件<BR> protected void lbtchalist_Click(object sender, ImageClickEventArgs e)<BR> {<BR> try<BR> {<BR> this.Panel3.Visible = true;<BR> this.BandGrid();<BR> }<BR> catch (lepus.CException ex)<BR> {<BR> ex.ToString();</P>
<P> }<BR> catch (Exception ex)<BR> {<BR> ex.ToString();</P>
<P> }<BR> }<BR> #endregion</P>
<P> #region 取消员工查询<BR> protected void lbtcan_Click(object sender, ImageClickEventArgs e)<BR> {<BR> try<BR> {<BR> this.Panel1.Visible = false;<BR> }<BR> catch (lepus.CException ex)<BR> {<BR> ex.ToString();</P>
<P> }<BR> catch (Exception ex)<BR> {<BR> ex.ToString();</P>
<P> }<BR> }<BR> #endregion</P>
<P> #region 取消设备清单查询<BR> protected void ImageButton2_Click(object sender, ImageClickEventArgs e)<BR> {<BR> try<BR> {<BR> this.Panel3.Visible = false;<BR> }<BR> catch (lepus.CException ex)<BR> {<BR> ex.ToString();</P>
<P> }<BR> catch (Exception ex)<BR> {<BR> ex.ToString();</P>
<P> }<BR> }<BR> #endregion</P>
<P> #region 设备清单的确定事件<BR> protected void ImageButton1_Click(object sender, ImageClickEventArgs e)<BR> {<BR> try<BR> {<BR> BandGridView1();<BR> }<BR> catch (lepus.CException ex)<BR> {<BR> ex.ToString();</P>
<P> }<BR> catch (Exception ex)<BR> {<BR> ex.ToString();</P>
<P> }<BR> }<BR> #endregion</P>
<P> #region 查询随行人员<BR> protected void lbtcha_Click(object sender, ImageClickEventArgs e)<BR> {<BR> try<BR> {<BR> a = 1;<BR> this.Panel1.Visible = true;<BR> }<BR> catch (lepus.CException ex)<BR> {<BR> ex.ToString();</P>
<P> }<BR> catch (Exception ex)<BR> {<BR> ex.ToString();</P>
<P> }</P>
<P> }<BR> #endregion</P>
<P>这是两个事件 ,我定了一个全局变量 int a = 0;</P>
<P>然后再</P>
<P> #region 员工选择事件<BR> protected void gvSearchItem_SelectedIndexChanged(object sender, EventArgs e)<BR> {<BR> try<BR> {<BR> if (a == 0)<BR> {<BR> this.txtname.Text = this.gvSearchItem.SelectedRow.Cells[1].Text.ToString();<BR> this.txtdepar.Text = this.gvSearchItem.SelectedRow.Cells[2].Text.ToString();<BR> this.Panel1.Visible = false;<BR> BandList();<BR> }<BR> else <BR> {<BR> this.txtemp.Text = this.gvSearchItem.SelectedRow.Cells[1].Text.ToString();<BR> this.Panel1.Visible = false;</P>
<P> }<BR> }<BR> catch (lepus.CException ex)<BR> {<BR> ex.ToString();</P>
<P> }<BR> catch (Exception ex)<BR> {<BR> ex.ToString();</P>
<P> }<BR> }<BR> #endregion</P>
<P>为什么都不走else的语句阿 ?</P>
<P>也没有报错。。</P>
<P>很郁闷阿~~~</P>
<P>谁有好的方法赶快和我联系阿。。。</P>
<P>谢谢了。很急的问题啊。。。。</P>
<P mce_keep="true"> </P>
<P mce_keep="true"> </P>
<P mce_keep="true"> </P>
冰儿
|
初学一级
|
园豆:
200
提问于:2008-07-25 09:06