国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

LigerUI一個前臺框架增、刪、改asp.net代碼的實現

2019-11-17 03:02:07
字體:
來源:轉載
供稿:網友

LigerUI一個前臺框架增、刪、改asp.net代碼的實現

先上代碼:前臺代碼

<!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 runat="server">    <title>管理員管理</title>    <link href="../ligerUI/skins/Aqua/CSS/ligerui-all.css" rel="stylesheet" type="text/css" />    <script src="../js/jquery-1.5.2.min.js" type="text/javascript"></script>    <script src="../ligerUI/json2.js" type="text/Javascript"></script>    <script src="../ligerUI/js/core/base.js" type="text/javascript"></script>    <script src="../ligerUI/js/plugins/ligerForm.js" type="text/javascript"></script>    <script src="../ligerUI/js/plugins/ligerDrag.js" type="text/javascript"></script>    <script src="../ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>    <script src="../ligerUI/js/plugins/ligerTextBox.js" type="text/javascript"></script>    <script src="../ligerUI/js/plugins/ligerCheckBox.js" type="text/javascript"></script>    <script src="../ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>    <script src="../ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>    <script src="../ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>    <script src="../ligerUI/js/plugins/ligerSpinner.js" type="text/javascript"></script>    <script src="../ligerUI/js/plugins/ligerResizable.js" type="text/javascript"></script>    <script src="../js/LG.js" type="text/javascript"></script>    <script type="text/javascript">        var manager, g;        var detailWin;        $(function () {            g = manager = $("#maingrid").ligerGrid({                //title : 'gg',                columns: [                { display: 'ID編號', name: 'id', width: 50, type: 'int', frozen: true },                { display: '名字', name: 'Name', width: 100, editor: { type: 'text'} },                { display: '密碼', name: 'PassWord', width: 260, type: 'text', editor: { type: 'text'} },                { display: '登錄IP', name: 'Loginip', type: 'text', width: 100, editor: { type: 'text'} }                ],                //                onSelectRow: function (data, rowindex, rowobj) {                //                    $("#Name").html(data.Name);                //                    $("#Password").html(data.Password);                //                },                dataAction: 'local',                pageSize: 10,                pageSizeOptions: [10, 20, 30],                url: "ManagerData.ashx?action=managerlist",                isScroll: false,                // checkbox: true,                rownumbers: true,                width: '100%',                heightDiff: -1,                onRClickToSelect: true,                onContextmenu: function (parm, e) {                    actionCustomerID = parm.data.id;                    menu.show({ top: e.pageY, left: e.pageX });                    return false;                }            });            $("#maingrid").width($("#maingrid").width() - 16);            $("#grid").height(document.documentElement.clientHeight - $(".toolbar").height());            //創建表單結構             $("#form2").ligerForm({                inputWidth: 170,                labelWidth: 90,                space: 40,                validate: true,                fields: [                { name: "id", newline: true, type: "hidden" },                { display: "用戶名稱", name: "UserName", newline: true, type: "text", validate: { required: true, minlength: 2} },                { display: "密   碼", name: "Password1", newline: true, type: "text", validate: { required: true, minlength: 6} },                { display: "重復密碼", name: "Password2", newline: true, type: "text", validate: { required: true, minlength: 6} }                ]            });        });        function Addadmin() {            $('input[name="id"]').val("");            $('input[name="UserName"]').val("");            $('input[name="Password1"]').val("");            $('input[name="Password2"]').val("");            detailWin = $.ligerDialog.open({                height: 200,                target: $("#form2"),                width: null,                height: 'auto',                //showMax: true,                //showToggle: true,                //showMin: true,                //isResize: true,                modal: false,                title: "新增",                buttons: [                { text: '確定', onclick: function () { addNewRow(); detailWin.hide(); manager.loadData() } },                { text: '取消', onclick: function () { detailWin.hide(); } }            ]            });        }        function beginEdit() {            $('input[name="id"]').val("");            $('input[name="UserName"]').val("");            $('input[name="Password1"]').val("");            $('input[name="Password2"]').val("");            var row = manager.getSelectedRow();            if (!row) { alert('請選擇行'); return; }            detailWin = $.ligerDialog.open({                height: 200,                target: $("#form2"),                width: null,                height: 'auto',                modal: false,                title: "新增",                buttons: [                { text: '確定', onclick: function () { UpdateRow(); detailWin.hide(); manager.loadData() } },                { text: '取消', onclick: function () { detailWin.hide(); } }            ]            });            $('input[name="id"]').val(row.id);            $('input[name="UserName"]').val(row.Name);            $('input[name="Password1"]').val(row.Password);            $('input[name="Password2"]').val(row.Password);        }        function deleteRow() {            var row = manager.getSelectedRow();            if (!row) { alert('請選擇行'); return; }            $.Ajax({                type: "get",                url: 'ManagerData.ashx?action=delmanager',                data: { id: row.id },                cache: false,                async: false,                success: function (result) {                    var obj_result = eval('(' + result + ')');   //返回信息 {'success':true}                    if (obj_result.success == true) {                        LG.showSuccess('刪除管理員成功');                    }                    else {                        LG.showError('刪除失敗!');                    }                }            });        }        function addNewRow() {            if (liger.get("UserName").getValue() == "") {                LG.tip('用戶名不能為空?');                return;            }            if (liger.get("Password1").getValue() != liger.get("Password2").getValue()) {                LG.tip('兩次輸入的密碼不相等?');                return;            }            $.ajax({                type: "get",                url: 'ManagerData.ashx?action=addmanager',                data: { UserName: liger.get("UserName").getValue(), Password: liger.get("Password1").getValue() },                cache: false,                async: false,                success: function (result) {                    var obj_result = eval('(' + result + ')');   //返回信息 {'success':true}                    if (obj_result.success == true) {                        LG.showSuccess('管理員添加成功');                        manager.loadData();                    }                    else {                        LG.showError('添加失敗!');                        manager.loadData();                    }                }            });        }        function UpdateRow() {            if ($("#id").val() == "") {                LG.tip('編輯信息可能丟失?');                return;            }            if (liger.get("UserName").getValue() == "") {                LG.tip('用戶名不能為空?');                return;            }            if (liger.get("Password1").getValue() != liger.get("Password2").getValue()) {                LG.tip('兩次輸入的密碼不相等?');                return;            }            $.ajax({                type: "get",                url: 'ManagerData.
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 呼伦贝尔市| 行唐县| 高尔夫| 右玉县| 和平县| 光泽县| 屏东县| 阳城县| 武邑县| 巴里| 锡林郭勒盟| 阳江市| 阳东县| 耒阳市| 常德市| 怀来县| 永登县| 孟津县| 安达市| 宜宾县| 琼中| 文成县| 油尖旺区| 铜梁县| 曲靖市| 洱源县| 会泽县| 眉山市| 仙桃市| 蕉岭县| 嵊泗县| 镇江市| 福海县| 浪卡子县| 东乌珠穆沁旗| 开化县| 通州区| 莆田市| 韩城市| 江油市| 綦江县|