<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProductsType_List.aspx.cs" Inherits="RM.Web.Warehouse.ProductsType_List" %>
<%@ Register Src="/UserControl/LoadButton.ascx" TagName="LoadButton" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>产品种类管理</title>
<link href="/Themes/Styles/Site.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div class="btnbartitle">
        <div>
            产品种类管理
        </div>
    </div>
    <div class="btnbarcontetn">
        <div style="float: left;">
        </div>
        <div style="text-align: right">
            <uc1:LoadButton ID="LoadButton1" runat="server" />
        </div>
    </div>
    <div class="div-body">
        <table class="example" id="dnd-example">
            <thead>
                <tr>
                    <td style="width: 230px; padding-left: 20px;">
                        种类代码
                    </td>
                    <td>
                       种类名
                    </td>
                </tr>
            </thead>
            <tbody>
                <%=TableTree_PetType.ToString()%>
            </tbody>
        </table>
    </div>
    </form>
    <script src="/Themes/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/TreeTable/jquery.treeTable.js" type="text/javascript"></script>
    <link href="/Themes/Scripts/TreeTable/css/jquery.treeTable.css" rel="stylesheet"
        type="text/css" />
    <script src="/Themes/Scripts/FunctionJS.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            divresize(63);
            FixedTableHeader("#dnd-example", $(window).height() - 91);
            GetClickTableValue();
        })
        /**
        获取table TD值
        主键ID
        column:列名
        **/
        var Menu_Id = '';
        function GetClickTableValue() {
            $('table tr').not('#td').click(function () {
                $(this).find('td').each(function (i) {
                    if (i == 2) {
                        Menu_Id = $(this).text();
                    }
                });
            });
            $("#dnd-example").treeTable({
                initialState: "collapsed" //collapsed 收缩 expanded展开的
            });
        }
        //新增
        function add() {
            //alert(Menu_Id);
            var url = "/Warehouse/ProductsType_Form.aspx?FID=" + Menu_Id;
            top.openDialog(url, 'Warehouse_ProductsType', '产品种类 - 添加', 450, 305, 50, 50);
        }
        //编辑
        function edit() {
            var key = Menu_Id;
            if (IsEditdata(key)) {
                var url = "/Warehouse/ProductsType_Form.aspx?key=" + key;
                top.openDialog(url, 'Warehouse_ProductsType', '产品种类 - 编辑', 450, 305, 50, 50);
            }
        }
        //删除
        function Delete() {
            var key = Menu_Id;
            if (IsDelData(key)) {
                var isExistparm = 'action=IsExist&tableName=Warehouse_ProductsType&pkName=PT_FID&pkVal=' + key;
                if (IsExist_Data('/Ajax/Common_Ajax.ashx', isExistparm) > 0) {
                    showWarningMsg("该数据被关联,0 行受影响！");
                    return false;
                }
                var delparm = 'action=Virtualdelete&module=产品种类&tableName=Warehouse_ProductsType&pkName=PT_ID&pkVal=' + key;
                delConfig('/Ajax/Common_Ajax.ashx', delparm)
            }
        }
    </script>
</body>
</html>
