コード例 #1
0
        private void WorkThreadFunction(object data)
        {
            ThreadParameter tp = (ThreadParameter)data;

            var client = ServerEndPoint.GetCloudClient();

            if (client != null)
            {
                int count = Utility.Util.GetValueOfInt(DB.ExecuteScalar(sql + tp.AD_Client_ID));

                client.CreateCustomerUserCompleted += (se, ev) =>
                {
                    client.Close();
                    //VLogger.Get().Info("URL => " + applicationURL);
                    if (ev.Result != null)
                    {
                        log.SaveInfo("UserCloudResult=> ", "Result=> " + ev.Result.ToString());
                    }
                    else
                    {
                        log.SaveInfo("UserCloudResult=> ", "Result => " + "Null");
                    }
                };
                //log.SaveInfo("Url=> ", "Url=> " + Envs.GetApplicationURL());
                //log.SaveInfo("UserID=> ", "UserID=> " + GetAD_User_ID());
                //log.SaveInfo("Name=> ", "Name=> " + GetName());
                //log.SaveInfo("teanant=> ", "teanant=> " + GetAD_Client_ID());
                //log.SaveInfo("Count=> ", "Count=> " + count);
                //log.SaveInfo("isLogin=> ", "isLogin=> " + IsLoginUser());
                try
                {
                    ServicePointManager.Expect100Continue = false;
                    client.CreateCustomerUserAsync(tp.appUrl, tp.AD_User_ID, tp.Name, tp.AD_Client_ID, count, tp.isLoginUser, false,
                                                   ServerEndPoint.GetAccesskey());
                }
                catch
                {
                }

                //try
                //{
                //    string res = client.CreateCustomerUser(appUrl, AD_User_ID, Name, AD_Client_ID, count, isLoginUser, false, ServerEndPoint.GetAccesskey());
                //    if (res != null)
                //    {
                //        log.SaveInfo("UserCloudResult=> ", "Result=> " + res);
                //    }
                //    else
                //    {
                //        log.SaveInfo("UserCloudResult=> ", "Result => " + "Null");
                //    }
                //}
                //catch (Exception ex)
                //{
                //    log.SaveError("UserCloudResult=> ", "Result => " + ex.Message);
                //}
            }
        }