
var cst=2293;var oxe="DefaultF_";var emailObj=null;$(window).load(function(){scw();var f=function(a){var v=$(a).val();var k=v.indexOf("@");if(k>=0){var b=v.substr(0,k);var c=v.substr(k+1,v.length-k-1);$("#d2293_Nickname").val(b);$("#d2293_Smtp").val("smtp."+c)}};$("#d2293_Email").unbind("keyup").bind("keyup",function(){f(this)}).unbind("change").bind("change",function(){f(this)});$("#btn_updateUserMsg").unbind("click").bind("click",function(){pjx()})});function scw(){}
function scw(){var c="/WebServices/System/System.asmx/scw";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:c,data:"{}",dataType:'json',success:function(a){a=hmy(a);if(!ymr(a)){var b={"Smtp":a.Smtp,"Port":a.Port,"Email":a.Sysemail,"Nickname":a.Username,"Pwd":""};pet(cst,oxe,2);lwg(cst,oxe,b,null,false)}else pet(cst,oxe,1)},beforeSend:function(a){},complete:function(a,b){},error:function(a){var b=JSON2.stringify(a);if(b.length>600)b=b.substr(0,600);alert("操作失败。详情："+b)}})}
function pjx(){var c=yci(cst,oxe);var d=null;var e=col(cst,oxe);d=e.$form;if(d==null){art.VLdialog.alert("获取表单的HTML对象失败。请确认代码正确。",function(){},4,"提示");return}
var f=sme(d,false,cst,oxe,true,cst,c,true);if(ymr(f)||f==false){art.VLdialog.alert("获取表单数据失败。请确认输入是否正确。",function(){},4,"提示");return}
var g=f;var h={"Smtp":g.Smtp,"Port":g.Port,"Sysemail":g.Email,"Username":g.Nickname,"Password":g.Pwd,"Emailcontent":"","PluginNameSpace":"","DllFileName":""};$("#btn_updateUserMsg").html("正在保存...");var i="/WebServices/System/System.asmx/SetSystemEmail";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:i,data:"{obj:"+JSON2.stringify(h)+"}",dataType:'json',beforeSend:function(a){},complete:function(a,b){$("#btn_updateUserMsg").html("保存")},error:function(a){var b=JSON2.stringify(a);if(b.length>600)b=b.substr(0,600);alert("操作失败。详情："+b);return false},success:function(b){b=hmy(b);if(b.IsOK){art.VLdialog.Succeed("<span style='font-size:18px;'>保存成功！</span><br/><br/>将进入首页。",function(){},20,"提示");setTimeout(function(){var a=tzm("gotoMainPage");if(!ymr(a)&&!isNaN(a))a=parseInt(a,10);else a=-1;if(a>0)window.top.location.href="/main.html"},1000)}else art.VLdialog.alert("保存失败。原因："+b.ErrorMsg,function(){},8,"提示")}})}