<%@ Import Namespace="System.Data" %>
<html><head>
<script language="C#" runat="server">
//DataRow[] NRows;
//DataRow[] NRows1;
//DataRow[] NRows2;
//DataSet userData;
	void Page_Load(Object sender, EventArgs e){
		string n;
		n="<div id=\"plan\" style=\"position: relative ; z-index:1; display:\"><img border=0 src=\"images\\CB\\Lpic\\Type\\UB-TYPE01.jpg\" alt=底图>";
		DataTable t=(DataTable)Session["NowUserData"];
		foreach(DataRow NowRow in t.Rows){
			n+= "<div id=" + NowRow["PartID"] + " style=\"position: absolute; left: " + NowRow["LocLeft"] + "; top:" + NowRow["LocTop"] + "; z-index:" + NowRow["LocZindex"] + ";display:\"><img border=0 src=\"" + NowRow["Photo"] + "\"></div>";
		}
		Level5.DataSource=t.DefaultView;
		Level5.DataBind();
		NowSelect.DataSource=t.DefaultView;
		NowSelect.DataBind();
		n+= "</div>";
		s1.InnerHtml= n;
	}
	Double Total{
        get{
		Double m=0;
		DataTable t = (DataTable)Session["NowUserData"];
		foreach(DataRow NowRow in t.Rows){
			m+= Convert.ToDouble(NowRow["UpricePart"]);
		}
		return m;
	}
	}
	void h2_onClick(Object sender,ImageClickEventArgs e){
		Response.Redirect("Login.aspx");
	}
</script>
</head>

<body background="../../images/winback.gif">
<form runat="server"><center>
<asp:hyperlink text="回首页" NavigateUrl="Default.aspx" runat="server" />
	</span>
	<span ID="s1" RUNAT="SERVER" />
	<table><TBODY><tr><td>
		<ASP:DataGrid id="NowSelect" runat="server"
			BorderColor="black"
			BorderWidth="1"
			columns="2"
			GridLines="Both"
			CellPadding="3"
			CellSpacing="0"
			Font-Name="Verdana"
			AutoGenerateColumns="false"                   
			Font-Size="8pt"
			HeaderStyle-BackColor="#aaaadd"
			ShowFooter="True">
			<Columns>
                <asp:BoundColumn HeaderText="细项名称" DataField="PartName" />                   
                <asp:BoundColumn HeaderText="细项型号" DataField="Model"/>                   
                <asp:BoundColumn HeaderText="颜色" DataField="Color"/>
				<asp:TemplateColumn ItemStyle-HorizontalAlign="right">
            		<HeaderTemplate>
					    		价格           
					</HeaderTemplate>
					<ItemTemplate>           
						<asp:Label runat="server"  Text='<%# DataBinder.Eval(Container.DataItem, "UpricePart" ,"{0:C0}") %>' />           
					</ItemTemplate>           
					<FooterTemplate>           
						Total:<asp:label text='<%# Total.ToString("NT$#,###") %>' runat=server/>
					</FooterTemplate>           
            	</asp:TemplateColumn>                                                   
			</Columns>
		</ASP:DataGrid>
</TD></TR></TBODY></TABLE>

<table><tr><td align="middle">
	<asp:Label id="NowPrice" Runat="Server" visible="False"/>	    
	      <ASP:DataGrid id="Level5" runat="server"    
	        BorderColor="black"
	        BorderWidth="1"
			columns="2"
	        GridLines="Both"
	        CellPadding="3"
	        CellSpacing="0"
	        Font-Name="Verdana"
	        Font-Size="8pt"
	        HeaderStyle-BackColor="#aaaadd"
	        Visible=False /> 
</td></tr> </table>
</center>
</form>
</BODY>
</html>
