<%@ page language="C#" masterpagefile="~/Admin/AdminIndexMaster.master" autoeventwireup="true" inherits="Admin_Admin_JXC_StockTypeManage, WebApp_deploy" title="入库/出库类型" %>

<asp:Content ID="cphContent" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <asp:ScriptManager ID="sm" runat="server">
    </asp:ScriptManager>
    <script src="Js/Jquery/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="Js/Function.js" type="text/javascript"></script>
    <table class="nick" id="table_item" runat="server">
        <tr>
            <td class="tit left1">
                &nbsp;&nbsp;入库/出库类型管理
            </td>
            <td class="tit" style="text-align: right;">
                <a href="Admin_JXC_StockTypeManage.aspx?action=addinfo&MenuName=进销存管理&FileName=添加入库/出库类型">
                    <img style="border: 0px;" src="tpl/img/ico/add.gif" alt="添加" />新增 </a>&nbsp;&nbsp;
            </td>
        </tr>
    </table>
    <%--列表 begin--%>
    <asp:PlaceHolder ID="phManage" runat="server">
        <table class="nick">
            <tr>
                <td colspan="4" class="tit">
                    &nbsp;查询：
                </td>
            </tr>
            <tr>
                <td class="ltd">
                    名称：
                </td>
                <td class="rtd">
                    &nbsp;<asp:TextBox ID="txtSearchName" CausesValidation="false" runat="server"></asp:TextBox>
                </td>
                <td class="ltd">
                    类型：
                </td>
                <td class="rtd">
                    &nbsp;<asp:DropDownList ID="ddlSearchStockTypeStatue" runat="server">
                        <asp:ListItem Value="" Text="全部"></asp:ListItem>
                        <asp:ListItem Value="in" Text="入库"></asp:ListItem>
                        <asp:ListItem Value="out" Text="出库"></asp:ListItem>
                    </asp:DropDownList>
                    &nbsp;&nbsp;<asp:Button ID="btnSearch" runat="server" Text="查询" OnClick="btnSearch_Click" />
                </td>
            </tr>
        </table>
        <asp:GridView ID="gvList" runat="server" CssClass="adminlist" AllowPaging="True"
            AutoGenerateColumns="False" PageSize="20" OnRowDataBound="gvList_RowDataBound">
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <input type="checkbox" id="chk_select" name="chk_select" value='<%# Eval("StockTypeID") %>' />
                    </ItemTemplate>
                    <HeaderTemplate>
                        <input id="chkAll" onclick="SelectAllCheckboxes(this,'chk_select');" runat="server"
                            type="checkbox" />
                    </HeaderTemplate>
                    <ItemStyle HorizontalAlign="Center" Width="5%" />
                </asp:TemplateField>
                <asp:BoundField HeaderText="行号" DataField="row" />
                <asp:BoundField DataField="StockTypeNumber" HeaderText="类型编号"></asp:BoundField>
                <asp:BoundField DataField="StockTypeName" HeaderText="类型名称"></asp:BoundField>
                <asp:BoundField DataField="StockTypeSpell" HeaderText="拼音码"></asp:BoundField>
                <asp:TemplateField HeaderText="入库/出库类型">
                    <ItemTemplate>
                        <%# getStatus(Eval("StockTypeStatue").ToString())%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="AccountSNumber" HeaderText="科目编号"></asp:BoundField>
                <asp:BoundField DataField="AccountSName" HeaderText="科目名称 "></asp:BoundField>
                <asp:BoundField DataField="Remark" HeaderText="备注 "></asp:BoundField>
                <asp:TemplateField HeaderText="操作">
                    <ItemTemplate>
                        <%--<a href='<%#"Admin_JXC_StockTypeManage.aspx?action=checkinfo&MenuName=进销存管理&FileName=查看会计科目&InfoID="+Eval("AccountSubjectID") %>'>
                            查看</a>--%><a href='<%#"Admin_JXC_StockTypeManage.aspx?action=editinfo&MenuName=进销存管理&FileName=修改入库/出库类型&InfoID="+Eval("StockTypeID") %>'>
                                修改</a>
                        <asp:LinkButton ID="btnDelete" runat="server" OnClientClick="return confirm('您真的要删除该信息记录吗?')"
                            CommandName='DelInfo' CommandArgument='<%# Eval("StockTypeID") %>' Text="删除"
                            OnCommand="Button_Command" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                <table class="adminlist">
                    <tr>
                        <th>
                            行号
                        </th>
                        <th>
                            类型编号
                        </th>
                        <th>
                            类型名称
                        </th>
                        <th>
                            拼音码
                        </th>
                        <th>
                            入库/出库类型
                        </th>
                        <th>
                            科目编号
                        </th>
                        <th>
                            科目名称
                        </th>
                        <th>
                            备注
                        </th>
                    </tr>
                    <tr>
                        <td colspan="8">
                            会计科目数据!
                        </td>
                    </tr>
                </table>
            </EmptyDataTemplate>
        </asp:GridView>
        <div style="text-align: center">
            <asp:Label ID="PagePanel" runat="server" />
        </div>
        <asp:Button ID="btnMoreDelete" CommandName="MoreDel" OnCommand="Button_Command" Text="批量删除"
            runat="server" />
    </asp:PlaceHolder>
    <%--列表 end--%>
    <%--添加/修改 begin--%>
    <asp:PlaceHolder ID="phAddOrEdit" runat="server">
        <table class="nick" width="100%" id="AddTable" runat="server">
            <tr>
                <td class="tit" colspan="2">
                    &nbsp;&nbsp;<asp:Literal ID="ltrTitle" runat="server">添加入库/出库类型</asp:Literal>
                </td>
            </tr>
            <tr>
                <td class="ltd">
                    类型编号 ：
                </td>
                <td class="rtd">
                    <asp:TextBox ID="txtStockTypeNumber" runat="server"></asp:TextBox>(由数字组成)
                </td>
            </tr>
            <tr>
                <td class="ltd">
                    类型名称 ：
                </td>
                <td class="rtd">
                    <asp:TextBox ID="txtStockTypeName" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="ltd">
                    拼音码 ：
                </td>
                <td class="rtd">
                    <asp:TextBox ID="txtStockTypeSpell" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="ltd">
                    类型 ：
                </td>
                <td class="rtd">
                    <asp:DropDownList ID="ddlStockTypeStatue" runat="server">
                        <asp:ListItem Value="in">入库</asp:ListItem>
                        <asp:ListItem Value="out">出库</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="ltd">
                    会计科目 ：
                </td>
                <td class="rtd">
                    <asp:DropDownList ID="ddlAccountSubject" runat="server" AppendDataBoundItems="true">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="ltd">
                    备注 ：
                </td>
                <td class="rtd">
                    <asp:TextBox ID="txtRemark" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td colspan="2" class="btm">
                    <asp:Button ID="btnAdd" runat="server" Text="添 加" OnClientClick="return checkPass()"
                        OnClick="btnAdd_Click" />
                    <input type="button" onclick="location.href='Admin_JXC_StockTypeManage.aspx'" value="返 回" />
                </td>
            </tr>
        </table>
    </asp:PlaceHolder>
    <%--添加/修改 end--%>
    <%--查看 begin--%>
    <asp:PlaceHolder ID="phCheck" runat="server"></asp:PlaceHolder>
    <%--查看 end--%>
    <br />
    <script type="text/javascript">
        //编号
        function checkNumber() {
            var txtNumber = $("#<%=txtStockTypeNumber.ClientID %>"); //科目编号
            if (txtNumber.val().length == 0) {
                alert("编号不能为空!");
                txtNumber.focus();
                return false;
            }
            return true;
        }
        //名称
        function checkName() {
            var txtName = $("#<%=txtStockTypeName.ClientID %>"); //科目名称
            if (txtName.val().length == 0) {
                alert("名称不能为空!");
                txtName.focus();
                return false;
            }
            return true;
        }
        function checkPass() {
            if (checkNumber() && checkName()) {
                return true;
            } else {
                return false;
            }
        }
    </script>
</asp:Content>
