zoukankan      html  css  js  c++  java
  • 模态窗口插件之Jbox

    $.jBox.tip("报损数量不能大于库存数!", 'error');
    $.jBox.tip("请选择要报损的产品", "warn");
    $.jBox.tip("报损单创建成功", "success");
    $.jBox.info(result.d, "提示");
    $.jBox.confirm("确定要删除吗?", "提示", submit);
    var AccountSetting = {
        Add: function () {
            var submit = function (v, h, f) {
                if (v == true) {
                    var userCode = h.find("#txtUserCode").val();
                    var userName = h.find("#txtUserName").val();
                    var realName = h.find("#txtRealName").val();
                    var email = h.find("#txtEmail").val();
                    var phone = h.find("#txtPhone").val();
                    var mobile = h.find("#txtMobile").val();
                    var roleNum = h.find("#ddlRole").val();
                    var departNum = h.find("#ddlDepart").val();
                    if (userName == undefined || userName == "") {
                        $.jBox.tip("请输入用户名", "warn");
                        return false;
                    }
                    var param = {};
                    param["UserCode"] = userCode;
                    param["UserName"] = userName;
                    param["RealName"] = realName;
                    param["Email"] = email;
                    param["Phone"] = phone;
                    param["Mobile"] = mobile;
                    param["RoleNum"] = roleNum;
                    param["DepartNum"] = departNum;
                    $.gitAjax({
                        url: "/UserAjax/AddUser", type: "post", data: { "entity": JSON.stringify(param) }, success: function (result) {
                            if (result.d == "success") {
                                $.jBox.tip("编辑成功", "success");
                                User.PageClick(1, 10);
                            } else {
                                $.jBox.tip("编辑失败", "error");
                            }
                        }
                    });
                    return true;
                } else {
                    return true;
                }
            }
            $.jBox.open("get:/Home/AccountSetting", "编辑用户", 500, 270, { buttons: { "确定": true, "关闭": false }, submit: submit });
        },
        Edit: function () {
            var submit = function (v, h, f) {
                if (v == true) {
                    var currentPassword = h.find("#currentPassword").val();
                    var passWord = h.find("#txtPassword").val();
                    var confirm = h.find("#txtConfirm").val();
    
                    if (currentPassword == undefined || currentPassword == "") {
                        $.jBox.tip("请输入当前密码", "warn");
                        return false;
                    }
                    if (passWord == undefined || passWord == "") {
                        $.jBox.tip("请输入密码", "warn");
                        return false;
                    }
                    if (confirm == undefined || confirm == "") {
                        $.jBox.tip("请输入确认密码", "warn");
                        return false;
                    }
                    if (passWord != confirm) {
                        $.jBox.tip("密码和确认密码不一致", "warn");
                        return false;
                    }
                    var param = {};
                    param["currentPassword"] = currentPassword;
                    param["PassWord"] = passWord;
    
                    $.gitAjax({
                        url: "/UserAjax/ChangePwd", type: "post", data: param, success: function (result) {
                            if (result.d == "success") {
                                $.jBox.tip("修改成功", "success");
    
                            } else {
                                $.jBox.tip("修改失败,当前密码不正确!", "error");
    
                            }
                        }
                    });
                    return true;
                } else {
                    return true;
                }
            }
            $.jBox.open("get:/Home/ChangePwd", "修改密码", 350, 200, { buttons: { "确定": true, "关闭": false }, submit: submit });
        }
    };
    
     <li><a href="javascript:void(0)" onclick="AccountSetting.Add();"><i class="icon-user"></i>&nbsp;&nbsp;@ViewBag.CurrentLoginUser.UserName</a></li>
                                <li><a href="javascript:void(0)" onclick="AccountSetting.Edit();"><i class="icon-wrench"></i>&nbsp;&nbsp;修改密码</a></li>
  • 相关阅读:
    c++之运算符
    C++开源库,欢迎补充。
    C++ 图像处理类库
    C++开源代码项目汇总
    视频会议及流媒体十大开源项目
    多媒体的框架
    C++开发资源汇总
    Juce之旅-第一个例子(图形窗口)
    Juce-强大的开源类库
    图像处理库的比较:OpenCV,FreeImage,CImg,CxImage
  • 原文地址:https://www.cnblogs.com/shy1766IT/p/5289796.html
Copyright © 2011-2022 走看看