国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 學(xué)院 > 開發(fā)設(shè)計(jì) > 正文

gridview中彈窗口(根據(jù)不同的條件,彈出不同的窗口)

2019-11-17 04:10:17
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

//第一種 方式
    PRotected void RecAmtGridView_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {
        string billNo = RecAmtGridView.Rows[e.NewSelectedIndex].Cells[3].Text;
        string billType = RecAmtGridView.Rows[e.NewSelectedIndex].Cells[2].Text;
        if (billType =="進(jìn)貨")
        {
            Response.Redirect("TS_HqReceiveReg.aspx?Action=3&fBillNo=" + billNo);
            ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, UpdatePanel1.GetType(), "進(jìn)貨", "window.open('TS_HqReceiveReg.aspx?Action=3&fBillNo=" + billNo + "')", true);
        }
        else if (billType == "退貨")
        {
            Response.Redirect("TS_HqReturnReg.aspx?Action=3&fBillNo=" + billNo);
            ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, UpdatePanel1.GetType(), "進(jìn)貨", "window.open('TS_HqReturnReg.aspx?Action=3&fBillNo=" + billNo + "')", true);

        }
        else
        {
            Response.Redirect("CostRegView.aspx?Action=3&fBillNo=" + billNo);
            ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, UpdatePanel1.GetType(), "進(jìn)貨", "window.open('CostRegView.aspx?Action=3&fBillNo=" + billNo + "')", true);

        }

    }

    //第二種方式: 加入模板
  <asp:TemplateField HeaderText="單據(jù)編號(hào)">
     <ItemTemplate>
     <asp:LinkButton ID="lbRecAmtBill" CommandName="lbRecAmtBill"  Text='<%#Eval("fBillNo")%>'  runat="server"></asp:LinkButton>
     </ItemTemplate>
 </asp:TemplateField>

    protected void RecAmtGridView_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        GridViewRow GridViewRow1 = (GridViewRow)((Control)e.CommandSource).Parent.Parent;

        LinkButton lbbutton = GridViewRow1.FindControl("lbRecAmtBill") as LinkButton;
        string billNo = lbbutton.Text;
        string billType = GridViewRow1.Cells[2].Text;
        if (billType == "進(jìn)貨")
        {
            ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, UpdatePanel1.GetType(), "進(jìn)貨", "window.open('TS_HqReceiveReg.aspx?Action=3&fBillNo=" + billNo + "')", true);
        }
        else if (billType == "退貨")
        {
            ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, UpdatePanel1.GetType(), "退貨", "window.open('TS_HqReturnReg.aspx?Action=3&fBillNo=" + billNo + "')", true);

        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, UpdatePanel1.GetType(), "費(fèi)用", "window.open('CostRegView.aspx?Action=3&fBillNo=" + billNo + "')", true);

        }

    }


    //第三種方式
   <asp:HyperLinkField HeaderText="單據(jù)編號(hào)" Text="單據(jù)編號(hào)"  Target="mainframe" NavigateUrl="" DataTextField="fBillNo" >
   </asp:HyperLinkField>

    protected void PayAmtGridView_RowDataBound(object sender, GridViewRowEventArgs e)
    {

        if (e.Row.RowIndex >= 0)
        {

            sumRealAmt += Convert.ToDouble(e.Row.Cells[3].Text);
            sumDiscAmt += Convert.ToDouble(e.Row.Cells[4].Text);
            sumTotAmt += Convert.ToDouble(e.Row.Cells[5].Text);
            sumInvAmt += Convert.ToDouble(e.Row.Cells[6].Text);

        }
        else if (e.Row.RowType == DataControlRowType.Footer) 每列匯總求和
        {
            e.Row.Cells[2].Text = "總計(jì):";
            e.Row.Cells[3].Text = sumRealAmt.ToString();
            e.Row.Cells[4].Text = sumDiscAmt.ToString();
            e.Row.Cells[5].Text = sumTotAmt.ToString();
            e.Row.Cells[6].Text = sumInvAmt.ToString();

        }

        綁定轉(zhuǎn)向頁(yè)面
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            必須將HyperLinkField 轉(zhuǎn)化為 HyperLink 才能進(jìn)行操作
            HyperLink linkField = (HyperLink)e.Row.Cells[3].Controls[0];
            billNo = linkField.Text ;
            billType = e.Row.Cells[2].Text;

            if (billType == "進(jìn)貨")
            {
                 url = "TS_HqReceiveReg.aspx?Action=3&fBillNo=" + billNo + "";
            }
            else if (billType == "退貨")
            {
                 url = "TS_HqReturnReg.aspx?Action=3&fBillNo=" + billNo + "";

            }
            else
            {
                 url = "CostRegView.aspx?Action=3&fBillNo=" + billNo + "";

            }

            linkField.NavigateUrl = url;
        }

    }


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 昌平区| 诏安县| 青浦区| 门源| 新余市| 乌拉特后旗| 平顶山市| 沾益县| 花莲县| 涟水县| 分宜县| 大名县| 同仁县| 横山县| 许昌市| 璧山县| 金溪县| 社会| 阳信县| 鹰潭市| 淮滨县| 胶州市| 策勒县| 福建省| 内乡县| 囊谦县| 宣武区| 兴和县| 清徐县| 石景山区| 锦屏县| 吴川市| 常熟市| 乡宁县| 达尔| 昌图县| 巨野县| 乐清市| 炎陵县| 开平市| 嵊州市|