<%@ Page Language="C#" MasterPageFile="~/MasterPage2.master" AutoEventWireup="true" CodeFile="hpfb.aspx.cs" Inherits="hpfb" Title="发布换品" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
   <table border=0 width="100%" cellpadding=0 cellspacing=1 bgcolor="#cdcdcd">
    <tr bgcolor="#f5f5f5" height="70">
      <td style="padding-left:8px;padding-top:5px" valign="top">
        <div>※ <span class="span2">发布新的物品</span></div> 
        <div style="padding-left:10px;padding-top:10px;">
        <asp:FormView ID="FormView1" DataSourceID="sqldatasource1" runat="server" DefaultMode="insert" OnItemInserting="FormView1_ItemInserting" OnItemInserted="FormView1_ItemInserted">
          <InsertItemTemplate>
          <table align=center width="620" height="350" border=0 cellpadding=0 cellspacing=0>
          <tr height="35">
            <td align="right" valign=top style="padding-right:8px;">换品类型(<font color="red">*</font>)：</td>
            <td align="left">
              <asp:DropDownList ID="drop1" DataSourceID="sqldatasource2" DataTextField="typename" DataValueField="typeid" runat="server">
              </asp:DropDownList><br />
              <font color="#808080">
              请准确选择换品类型，以便于换家找到您的换品
              </font>
            </td>
          </tr>
          <tr height="35">
            <td width="140" align="right" style="padding-right:8px;" >换品名称(<font color="red">*</font>)：</td>
            <td width="480" align="left">
              <asp:TextBox ID="hpm" Text='<%# Bind("wu_name")%>' Width="270" runat="server" />
              <asp:RequiredFieldValidator ID="Required1" ControlToValidate="hpm"
                runat="server" ErrorMessage="换品名称不可为空" />
            </td>
          </tr>
          <tr height="35">
            <td align="right" style="padding-right:8px;">换品图片：</td>
            <td align="left">
              <asp:FileUpload ID="pic" Width="350" runat="server" />
            </td>
          </tr>
          <tr height="35">
            <td align="right" style="padding-right:8px;">新旧程度(<font color="red">*</font>)：</td>
            <td align="left">
              <asp:DropDownList ID="DropDownList1" selectedvalue='<%# Bind("wu_xjcd")%>' runat="server">
                <asp:ListItem Text="全新" Value="全新" />
                <asp:ListItem Text="9成新" Value="9成新" />
                <asp:ListItem Text="8成新" Value="8成新" />
                <asp:ListItem Text="7成新" Value="7成新" />
                <asp:ListItem Text="6成新" Value="6成新" />
                <asp:ListItem Text="5成新" Value="5成新" />
                <asp:ListItem Text="4成新" Value="4成新" />
                <asp:ListItem Text="3成新" Value="3成新" />
                <asp:ListItem Text="2成新" Value="2成新" />
                <asp:ListItem Text="1成新" Value="1成新" />
              </asp:DropDownList>
            </td>
          </tr>  
          <tr height="35">
            <td align="right" valign="top" style="padding-right:8px;">换品描述(<font color="red">*</font>)：</td>
            <td align="left">
              <asp:TextBox ID="hkxy" Rows="7" Text='<%# Bind("wu_descr")%>' Columns="48" TextMode="MultiLine" runat="server" />
            </td>
          </tr>
          <tr height="3"><td colspan=2></td></tr>
          <tr height="35">
            <td align="right" style="padding-right:8px;">想交换的换品名称：</td>
            <td align="left">
              <asp:TextBox ID="TextBox3" Text='<%# Bind("hop_wpname")%>' Width="270" runat="server" />
            </td>
          </tr>  
          <tr height="35">
            <td align="right" style="padding-right:8px;">期望的交换地：</td>
            <td align="left">
              <asp:TextBox ID="TextBox4" Text='<%# Bind("hop_addr")%>' runat="server" />
            </td>
          </tr>
          <tr height="35">
            <td align="right" valign="top" style="padding-right:8px;">交换条件说明：</td>
            <td align="left">
              <asp:TextBox ID="TextBox6" Rows="5" Text='<%# Bind("hop_memo")%>' Columns="48" TextMode="MultiLine" runat="server" />
            </td>
          </tr>
          <tr height="30">
            <td colspan=2 align=center style="padding-top:8px;padding-bottom:8px;">
              <asp:Button ID="Button1" CommandName="insert" runat="server" Text="提 交" />
            </td>
          </tr>
          </table>
          </InsertItemTemplate>
          </asp:FormView>
        </div>
      </td>
    </tr>
    </table>    
    <asp:SqlDataSource 
        id="SqlDataSource1" 
        runat="server" 
        InsertCommand="insert into wu_info(wuid,wu_user,wu_type,wu_name,wu_pic,wu_xjcd,wu_descr,hop_wpname,hop_addr,hop_memo) values(@wpid,@userid,@wptype,@wu_name,@wppic,@wu_xjcd,@wu_descr,@hop_wpname,@hop_addr,@hop_memo)"
        ConnectionString="<%$ ConnectionStrings:CnnString%>" >
        <InsertParameters >
          <asp:Parameter name="wpid" DefaultValue="" Type="string" />
          <asp:Parameter Name="userid" />
          <asp:Parameter Name="wppic" DefaultValue="none.gif" Type="string" />
          <asp:Parameter Name="wptype" DefaultValue="" Type="string" />
        </InsertParameters>
  </asp:SqlDataSource>
  <asp:SqlDataSource 
        id="SqlDataSource2"
        runat="server"
        SelectCommand="select * from wu_type order by typeid"
        ConnectionString="<%$ ConnectionStrings:CnnString%>" >
  </asp:SqlDataSource>
</asp:Content>

