码迷,mamicode.com
首页 > Web开发 > 详细

.net 后台在gridview中弹出前台页面

时间:2015-09-06 09:47:02      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:

后台
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                DataRowView data = (DataRowView)e.Row.DataItem;
                
                e.Row.Cells[0].Text = " <a href=‘#‘ style=‘color:Blue‘  onclick=‘Dsplay(\"../Adim/Admin_OrderEit.aspx?o_id=" + data["id"].ToString() + "&flag=E\",800,1000)‘>" + data["F_ORDERNO"].ToString() + "</a>";
                string sql = " select sum(s_pay) as s_pay  from ACCEPTANCE t1 inner join Y_ORDERS t2 on t1.order_id=t2.id where t1.s_stuses=‘2‘ and t2.F_ORDERNO=‘" + data["F_ORDERNO"].ToString() + "";
                DataTable dt = DBUtility.DBHelper.GetDataTable(sql);
                double syje=0;
                if (dt.Rows.Count != 0)
                {
                    if (dt.Rows[0]["s_pay"].ToString() != "")
                    {
                        if (Convert.ToDouble(data["F_ENSURE"].ToString()) > Convert.ToDouble(dt.Rows[0]["s_pay"].ToString()))
                        {
                            syje = Convert.ToDouble(data["F_ENSURE"].ToString()) - Convert.ToDouble(dt.Rows[0]["s_pay"].ToString());
                        }
                    }
                    else
                    {
                        syje = Convert.ToDouble(data["F_ENSURE"].ToString());
                    }
                }
                else
                {
                    syje = Convert.ToDouble(data["F_ENSURE"].ToString());
                }
                     
                 //    syje = Convert.ToDouble(data["F_ENSURE"].ToString() == "" ? "0" : data["F_ENSURE"].ToString()) - Convert.ToDouble(data["Y_J"].ToString() == "" ? "0" : data["Y_J"].ToString());

                if (syje > 0)
                {
                    e.Row.Cells[10].Text = syje.ToString();
                } 
                else
                {
                    e.Row.Cells[10].Text = "0";
                }
               
                if (syje > 0)
                {
                    e.Row.Cells[12].Text = "<img  src=‘../../images/yisheng.png‘ style=‘width:20px; height:20px;‘ alt=‘‘ onclick=‘Dsplay(\"S_receive.aspx?O_id=" + data["id"].ToString() + "&Flag=I\")‘/>";
                    e.Row.Cells[12].Attributes.Add("onmouseover", "style.cursor=‘hand‘");
                }
                else
                {
                    e.Row.Cells[12].Text = "<img  src=‘../../images/yisheng.png‘ style=‘width:20px; height:20px;filter:gray;‘ alt=‘‘id=‘imgs‘/>";
                }
                e.Row.Cells[11].Text = "<img  src=‘../../images/656565656565.jpg‘ style=‘width:20px; height:20px;‘ alt=‘‘ onclick=‘Dsplay(\"ServerHt.aspx?ht_o=" + data["medical_o"].ToString() + "&ht_t=" + data["medical_t"].ToString() + "\",400,400)‘/>";
                e.Row.Cells[11].Attributes.Add("onmouseover", "style.cursor=‘hand‘");
                

            }
        }
前台
<script type="text/javascript" language="javascript">
     function Dsplay(h_src)
      {
       var iwidth = 900;   
       var iheight = 600;
       var itop = (window.screen.availHeight-30-iheight)/2;
       var ileft = (window.screen.availWidth-10-iwidth)/2;
      window.open(h_src,newwindow,height=+800+,width=+800+,top=+10+,left=+ileft+,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,status=no)
      }
            function btnFreshData() { 
            document.getElementById("ctl00_ContentPlaceHolder1_ImageButton1").click(); 
                              } 
    </script>

 

.net 后台在gridview中弹出前台页面

标签:

原文地址:http://www.cnblogs.com/110abcd/p/4784485.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!