Example #1
0
 public CreateUserResponse CreateUser(CreateUserRequest model)
 {
     try
     {
         string             url      = string.Format("https://oapi.dingtalk.com/user/create?access_token={0}", DDHelper.GetToken());
         string             response = Infrastructure.Web.WebHelper.HttpWebRequestJson(url, model.GetParametersToJosn());
         CreateUserResponse res      = response.ToObject <CreateUserResponse>();
         if (res.Errcode == 0)
         {
             _OtherUserApp.SetStatus(res.Userid, res.Userid, true);
         }
         else
         {
             _OtherUserApp.SetStatus(model.Userid, res.Errmsg, false);
         }
         return(res);
     }
     catch (Exception ex)
     {
         _OtherUserApp.SetStatus("", ex.Message, false);
         return(null);
     }
 }