예제 #1
0
 public void SaveUser()
 {
     string _userid = Parameters["puserid"];
     string _username = Parameters["pusername"];
     string _userdesc = Parameters["puserdesc"];
     string _email = Parameters["pemail"];
     string _mobile = Parameters["pmobile"];
     string _tel = Parameters["ptel"];
     SysUser item = new SysUser();
     item.FUserId = Convert.ToInt64(_userid);
     item.FUserName = _username;
     item.FUserDesc = _userdesc;
     item.FContactTel = _tel;
     item.FContactMobile = _mobile;
     item.FEmail = _email;
     ErrorEntity ErrInfo = new ErrorEntity();
     SysUserBiz biz = new SysUserBiz();
     if (item.FUserId == 0)
     {
         Int64 iuserid = biz.Insert(item, out ErrInfo);
         //设置口令
         SysUserCodeBiz codebiz = new SysUserCodeBiz();
         NameValueCollection pa = new NameValueCollection();
         pa.Add("FUserId", iuserid.ToString());
         pa.Add("FUserCode", "3FA0346AF9BE74CBD887D24E1C03057B");
         pa.Add("FCodeStatus", "1");
         codebiz.Insert(pa, out ErrInfo);
     }
     else
     {
         biz.Update(item, out ErrInfo);
     }
     Response.Write(ErrInfo.ToJson());
 }