49 lines
1.7 KiB
C#
49 lines
1.7 KiB
C#
using System;
|
||
using System.Text;
|
||
using System.Web;
|
||
using WX.CRM.BLL.Util;
|
||
using WX.CRM.Common;
|
||
using WX.CRM.DataSynFactory.Templates;
|
||
|
||
namespace WX.CRM.DataSynFactory.Cmd
|
||
{
|
||
public class Client_Soft_User_Bind_IMP : Interfaces.IDataImportSvr<Client_Soft_User_Bind>
|
||
{
|
||
private SecurityHelper sHelper = new SecurityHelper();
|
||
public bool GenerateBusinessOne(Client_Soft_User_Bind t)
|
||
{
|
||
var url = string.Empty;
|
||
try
|
||
{
|
||
url = string.Format("http://localhost:806/ResourceService.svc/BindRegUser?content={0}&clientid={1}&sign={2}", HttpUtility.UrlEncode(t.content), t.clientid, HttpUtility.UrlEncode(t.sign));
|
||
//LogHelper.Info("url:" + url);
|
||
var rep = Utility.PostData(url, Encoding.UTF8);
|
||
//LogHelper.Info("rep:" + rep);
|
||
//var decyptRep = sHelper.decyptData("UPWEBSITE", rep);
|
||
var obj = Utility.JSONToObject<retObj>(rep);
|
||
LogHelper.Info("rep:" + obj.ToJson());
|
||
if (!obj.result)
|
||
{
|
||
//用户名已经存在
|
||
LogHelper.Error("出错url:" + url);
|
||
if (obj.retcode == 10002)
|
||
return true;
|
||
}
|
||
return obj.result;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.Error("soft_user,营业部入库失败:" + ex.ToString());
|
||
LogHelper.Error("异常url:" + url);
|
||
return false;
|
||
}
|
||
}
|
||
|
||
private class retObj
|
||
{
|
||
public bool result { get; set; }
|
||
public int retcode { get; set; }
|
||
}
|
||
}
|
||
}
|