麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 學院 > 開發設計 > 正文

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

2019-11-17 04:10:17
字體:
來源:轉載
供稿:網友

//第一種 方式
    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 =="進貨")
        {
            Response.Redirect("TS_HqReceiveReg.aspx?Action=3&fBillNo=" + billNo);
            ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, UpdatePanel1.GetType(), "進貨", "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(), "進貨", "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(), "進貨", "window.open('CostRegView.aspx?Action=3&fBillNo=" + billNo + "')", true);

        }

    }

    //第二種方式: 加入模板
  <asp:TemplateField HeaderText="單據編號">
     <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 == "進貨")
        {
            ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, UpdatePanel1.GetType(), "進貨", "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(), "費用", "window.open('CostRegView.aspx?Action=3&fBillNo=" + billNo + "')", true);

        }

    }


    //第三種方式
   <asp:HyperLinkField HeaderText="單據編號" Text="單據編號"  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 = "總計:";
            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();

        }

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

            if (billType == "進貨")
            {
                 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;
        }

    }


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 一区二区三区手机在线观看 | 国产一区二区三区四区精 | 成人毛片在线免费看 | www.91pron| 欧洲狠狠鲁 | 国产中文一区 | 一本大道av| 国产精选电影免费在线观看网站 | xxnxx中国18 | 四虎久草 | 国产成人在线观看免费网站 | 国产高清自拍一区 | 日本一级黄色大片 | 国产一级免费电影 | 国产青草视频在线观看视频 | xxxxxx免费| 久久久国产精品免费观看 | 黄网在线 | 久久96国产精品久久秘臀 | 国产精品久久久久久久久久 | 国产免费久久久久 | h视频在线观看免费 | 黄色小视频免费在线观看 | 国产电影精品久久 | 欧美黑人xx | 免费试看av| 精品欧美一区二区精品久久 | 免费观看三级毛片 | 最新av在线免费观看 | 男人久久天堂 | 黄网站色成年大片免费高 | 亚洲一区二区免费 | 国产一区二区三区视频免费 | 国产精品视频一区二区三区四区五区 | 美女视频免费一区二区 | 成人aaaaa片毛片按摩 | 成人毛片免费播放 | 一区二区三区欧美日韩 | 一级免费在线 | 亚欧在线免费观看 | 狠狠99 |