|
|
@ -1,5 +1,6 @@ |
|
|
|
var EditDialog = function (parent) { |
|
|
|
this.Parent = parent; |
|
|
|
this.OrgId = null; |
|
|
|
|
|
|
|
this.Setup = function () { |
|
|
|
$("#sex span").on("click", this.OnSexButtonClick.bind(this)); |
|
|
@ -9,7 +10,8 @@ |
|
|
|
}; |
|
|
|
|
|
|
|
this.Show = function (data) { |
|
|
|
console.log(data) |
|
|
|
console.log(data); |
|
|
|
this.OrgId = data.OrgId; |
|
|
|
$('#edit-dialog').show(); |
|
|
|
$("#username").textbox('setValue', data.RealName); |
|
|
|
$("#account").textbox('setValue', data.LoginName); |
|
|
@ -24,8 +26,9 @@ |
|
|
|
}; |
|
|
|
|
|
|
|
this.OnSureButtonClick = function () { |
|
|
|
this.HideDialog(); |
|
|
|
console.log(this.getUserParams()) |
|
|
|
this.EditUser(); |
|
|
|
this.HideDialog(); |
|
|
|
}; |
|
|
|
|
|
|
|
this.HideDialog = function () { |
|
|
@ -39,15 +42,9 @@ |
|
|
|
type: "POST", |
|
|
|
dataType: 'text', |
|
|
|
url: '/UserManagement/Update', |
|
|
|
data: { |
|
|
|
OrgId: 1, |
|
|
|
Gender: parseInt($('#sex span.active').attr('gender')), |
|
|
|
RealName: $("#username").textbox('getValue'), |
|
|
|
LoginName: $('#account').textbox('getValue'), |
|
|
|
LoginPassword: $('#password').textbox('getValue') |
|
|
|
}, |
|
|
|
data: this.getUserParams(), |
|
|
|
success: function (result) { |
|
|
|
console.log(result) |
|
|
|
console.log(this.getUserParams()) |
|
|
|
this.Parent.ReLoadTableData(); |
|
|
|
}.bind(this) |
|
|
|
}); |
|
|
@ -59,4 +56,14 @@ |
|
|
|
$('#password').textbox('setValue', ''), |
|
|
|
$('#sex span').eq(0).addClass("active"); |
|
|
|
}; |
|
|
|
|
|
|
|
this.getUserParams = function () { |
|
|
|
return { |
|
|
|
OrgId: this.OrgId, |
|
|
|
Gender: parseInt($('#sex span.active').attr('gender')), |
|
|
|
RealName: $("#username").textbox('getValue'), |
|
|
|
LoginName: $('#account').textbox('getValue'), |
|
|
|
LoginPassword: $('#password').textbox('getValue') |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |