<%@ page language="C#" masterpagefile="~/Admin/AdminIndexMaster.master" autoeventwireup="true" inherits="Admin_Admin_JXC_CalculateUnitManage, 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_CalculateUnitManage.aspx?MenuID=1&MenuName=进销存管理&FileName=添加计量单位&action=addinfo">
                    <img style="border: 0px;" src="tpl/img/ico/add.gif" alt="添加" />新增 </a>&nbsp;&nbsp;
            </td>
        </tr>
    </table>
    <%--列表 begin--%>
    <asp:PlaceHolder ID="phManage" runat="server">
        <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("CalculateUnitID") %>' />
                    </ItemTemplate>
                    <HeaderTemplate>
                        <input id="chkAll" onclick="SelectAllCheckboxes(this,'chk_select');" runat="server"
                            type="checkbox" />
                    </HeaderTemplate>
                    <ItemStyle HorizontalAlign="Center" Width="5%" />
                </asp:TemplateField>
                <asp:BoundField DataField="CalculateUnitID" HeaderText="ID"></asp:BoundField>
                <asp:BoundField DataField="CalculateUnitNumber" HeaderText="编号"></asp:BoundField>
                <asp:BoundField DataField="CalculateUnitName" HeaderText="名称"></asp:BoundField>
                <asp:BoundField DataField="Remark" HeaderText="备注 "></asp:BoundField>
                <asp:TemplateField HeaderText="操作">
                    <ItemTemplate>
                        <a href='<%#"Admin_JXC_CalculateUnitManage.aspx?MenuID=1&MenuName=进销存管理&FileName=修改计量单位管理&action=editinfo&InfoID="+Eval("CalculateUnitID") %>'>
                            修改</a>
                        <asp:LinkButton ID="btnDelete" runat="server" OnClientClick="return confirm('您真的要删除该信息记录吗?')"
                            CommandName='DelInfo' CommandArgument='<%# Eval("CalculateUnitID") %>' Text="删除"
                            OnCommand="Button_Command" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                <table class="adminlist">
                    <tr>
                        <th>
                            行号
                        </th>
                        <th>
                            编号
                        </th>
                        <th>
                            名称
                        </th>
                        <th>
                            备注
                        </th>
                    </tr>
                    <tr>
                        <td colspan="4">
                            没有您要找的数据!
                        </td>
                    </tr>
                </table>
            </EmptyDataTemplate>
        </asp:GridView>
        <div class="page">
            <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="txtCalculateUnitNumber" runat="server"></asp:TextBox>(由数字组成)
                </td>
            </tr>
            <tr>
                <td class="ltd">
                    名称 ：
                </td>
                <td class="rtd">
                    <asp:TextBox ID="txtCalculateUnitName" runat="server"></asp:TextBox>(名称不能重复)
                </td>
            </tr>
            <tr>
                <td class="ltd">
                    备注 ：
                </td>
                <td class="rtd">
                    <asp:TextBox ID="txtRemark" runat="server" TextMode="MultiLine" Rows="5" Columns="30"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td colspan="2" class="btm">
                    <asp:HiddenField ID="hfUnitName" runat="server" Value="" />
                    <asp:Button ID="btnAdd" runat="server" Text="添 加" OnClientClick="return checkPass()"
                        OnClick="btnAdd_Click" />
                    <input type="button" onclick="location.href='Admin_JXC_CalculateUnitManage.aspx?MenuID=1&MenuName=进销存管理&FileName=计量单位管理'"
                        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 = $("#<%=txtCalculateUnitNumber.ClientID %>"); //编号
            if (txtNumber.val().length == 0) {
                alert("编号不能为空!");
                txtNumber.focus();
                return false;
            }
            return true;
        }
        //名称
        function checkName() {
            var txtName = $("#<%=txtCalculateUnitName.ClientID %>"); //名称
            var ActionTab = "<%=ActionTab %>";
            var hfUnitName = $("#<%=hfUnitName.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>
