<%@ page language="C#" masterpagefile="../ShopMasterPage/MyShopMasterPage.master" autoeventwireup="true" inherits="Shop_Member_ShopDeliverType, HoWaveVGO" title="送货方式管理" enableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="pageTitle">送货方式管理</div>
<br />
    <table class="SearchTableStyle">   
         <tr>
             <td><asp:Button ID="AddDeliverType" runat="server" Text="新增加送货方式" OnClick="Button1_Click" /></td>
         </tr>
    </table>
<br />   
     
     <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="DeliverSource"  CssClass="tableHead"
          DataKeyNames="TypeID"  OnSelectedIndexChanged="GridView1_SelectedIndexChanged" OnDataBound="GridView1_DataBound">
        <Columns>
            
            <asp:BoundField DataField="Typeid" HeaderText="编号" />
            <asp:BoundField DataField="TypeName" HeaderText="名称" />
            <asp:TemplateField HeaderText="运费支付">
               <ItemTemplate>
                  <asp:Literal ID="DeliverPayType" runat="server" Text='<%# (Convert.ToString(Eval("chargetype"))=="0")?"卖家支付":"买家支付" %>' />
               </ItemTemplate>
            </asp:TemplateField>            
            <asp:BoundField HeaderText="运费价格" DataField="Charge" />
            <asp:CheckBoxField DataField="IsDisabled" HeaderText="是否禁用" />
            <asp:CheckBoxField DataField="IsDefault" HeaderText="是否默认" />
            <asp:BoundField HeaderText="备注" DataField="Intro" />
            <asp:CommandField SelectText="设成默认" ShowSelectButton="True" HeaderText="设成默认" />
            <asp:HyperLinkField DataNavigateUrlFields="Typeid" DataNavigateUrlFormatString="Shop_UpDateDeliverType.aspx?Typeid={0}" HeaderText="更改" Text="更改" />
            <asp:CommandField HeaderText="删除" ShowDeleteButton="True" />
        </Columns>
         <EmptyDataTemplate >                   
             <div style="padding:10px;">没有符合查询条件的记录！</div>      
            </EmptyDataTemplate>
    </asp:GridView>
           
    <asp:ObjectDataSource ID="DeliverSource" runat="server" SelectMethod="GetDeliverTypeByUserIDTypeIDStatusDisabled"
        TypeName="Shop_DeliverType" UpdateMethod="SetDeliverTypeAsDefault"  DeleteMethod="DeleteDeliver" >
        <SelectParameters>
            <asp:Parameter DefaultValue="-1" Name="Typeid" Type="Int32" />
            <asp:SessionParameter DefaultValue="0" Name="UserID" SessionField="Howave_UserID" Type="Int32" />
            <asp:Parameter DefaultValue="-1" Name="Status" Type="Int32" />
            <asp:Parameter DefaultValue="-1" Name="IsDisabled" Type="Int32" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="TypeID" Type="Int32" />
        </UpdateParameters>
        <DeleteParameters>
            <asp:Parameter Name="TypeID" Type="Int32" />
            <asp:SessionParameter DefaultValue="0" Name="UserID" SessionField="Howave_UserID" Type="Int32" />
        </DeleteParameters>
    </asp:ObjectDataSource>
</asp:Content>

