function Admin_ListAdd()
{
$('#ListInfo').css({ display: "inherit" });
$("#Department_Name").textbox("setValue", '');
$("#Department_Remark").textbox("setValue", '');
$('#ListInfo input').val('');
$('#ListInfo').dialog({
title: '添加单位',
buttons: [{
text: '确定',
iconCls: 'icon-ok',
handler: function () {
if ($("#Department_Name").val() == "") {
$.messager.alert('提示', '单位名称不能为空!', 'info',function () {
$("#Department_Name").next('span').find('input').focus();
});
return;
}
if ($("#Department_Leval").combobox('getValue') == "") {
$.messager.alert('提示', '单位级别不能为空!', 'info', function () {
$("#Department_Leval").combobox('showPanel');
});
return;
}
$.ajax({
type: "POST",
url: "/Provider/HandlerDepartment.ashx",
async: false,
data: "method=add&Department_Name=" + $("#Department_Name").val() + "&Department_Leval=" + $("#Department_Leval").combobox('getValue') + "&Department_Remark=" + $("#Department_Remark").val(),
success: function (msg) {
if (msg == '1')
{ $('#Admin_List').datagrid("reload");
$('#ListInfo').dialog('close');
}
else
{
$.messager.alert('提示', '该单位已存在!', 'info');
}
}
});
}
}, {
text: '取消',
iconCls: 'icon-cancel',
handler: function () {
$('#ListInfo').dialog('close');
}
}]
});
}