国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 仙桃市| 清河县| 平武县| 和平县| 赫章县| 盐亭县| 宝鸡市| 兴文县| 托克逊县| 龙江县| 丰镇市| 延吉市| 铜川市| 辽中县| 大厂| 祥云县| 工布江达县| 靖远县| 奉新县| 宿州市| 昌吉市| 瓦房店市| 安徽省| 涪陵区| 巴中市| 金塔县| 大邑县| 遂昌县| 永嘉县| 常山县| 台江县| 泽州县| 富蕴县| 武安市| 武陟县| 赤城县| 封丘县| 仪陇县| 云龙县| 宁陵县| 日照市|