Example #1
0
        /// <summary>
        /// Get the list of registered services
        /// </summary>
        /// <returns></returns>
        public Dictionary <string, JToken> getServices()
        {
            if (this.configuration["services"] == null)
            {
                return(new Dictionary <string, JToken>());
            }

            // Para que haya BWC con implementación original basada en arrays
            return(UtilsJson.keyedFromArrayOrObject(this.configuration["services"]));
        }
Example #2
0
        /// <summary>
        /// 取得登录校验用信息(Json格式).
        /// </summary>
        /// <returns>登录校验用信息(Json格式).</returns>
        /// <param name="iUserInfo">易接用户信息.</param>
        private string GetLoginCheckInfoJson(OneSdkUserInfo iUserInfo)
        {
            var checkInfo = new OneSdkLoginCheckInfo();

            checkInfo.Apply(iUserInfo);

            // 详细数据
            var jsonData = UtilsJson <OneSdkLoginCheckInfo> .ConvertToJsonString(checkInfo);

            if (!string.IsNullOrEmpty(jsonData))
            {
                return(jsonData);
            }
            Error("createLoginCheckURL():JsonConvert Failed!!!(Data:{0})",
                  checkInfo.ToString());
            UpdateStatus(SdkStatus.LoginCheckFailed);
            return(null);
        }
Example #3
0
        /// <summary>
        /// 解析支付信息.
        /// </summary>
        /// <returns>支付信息.</returns>
        /// <param name="iPayInfo">支付信息(Json格式数据).</param>
        /// <param name="iOnPaymentSucceeded">支付成功回调函数.</param>
        protected override SdkPaymentBaseInfo SdkParserPaymentInfo(
            string iPayInfo,
            Action <SdkAccountBaseInfo, string> iOnPaymentSucceeded)
        {
            Info("SdkParserPaymentInfo()");

#if IAP_UI_TEST
            iOnPaymentSucceeded(null, null);
            return(null);
#else
            if (null == iOnPaymentSucceeded)
            {
                Warning("SDKParserPaymentInfo()::OnPaymentSucceeded is null!!!");
            }

            // 接入易接SDK的场合
            return(SysSettings.GetInstance().data.Options.IsOptionValid(SDKOptions.OneSDK) ?
                   OneSdkLibs.Instance.ParserPayResponseInfo(iPayInfo, iOnPaymentSucceeded) :
                   UtilsJson <TiangePaymentInfo> .ConvertFromJsonString(iPayInfo));
#endif
        }
Example #4
0
        /// <summary>
        /// 取得登录校验用信息(Json格式).
        /// </summary>
        /// <returns>登录校验用信息(Json格式).</returns>
        /// <param name="iUserInfo">易接用户信息.</param>
        private string GetLoginCheckInfoJson(OneSDKUserInfo iUserInfo)
        {
            OneSDKLoginCheckInfo _checkInfo = new OneSDKLoginCheckInfo();

            if (null == _checkInfo)
            {
                this.UpdateStatus(SDKStatus.LoginCheckFailed);
                return(null);
            }
            _checkInfo.Apply(iUserInfo);

            // 详细数据
            string _jsonData = UtilsJson <OneSDKLoginCheckInfo> .ConvertToJsonString(_checkInfo);

            if (true == string.IsNullOrEmpty(_jsonData))
            {
                this.Error("createLoginCheckURL():JsonConvert Failed!!!(Data:{0})",
                           _checkInfo.ToString());
                this.UpdateStatus(SDKStatus.LoginCheckFailed);
                return(null);
            }
            return(_jsonData);
        }
Example #5
0
 /// <summary>
 /// 当前对象的字符串化文字
 /// </summary>
 /// <returns>字符串化文字</returns>
 public override string ToString()
 {
     return(UtilsJson <JsonDataBase> .ConvertToJsonString(this));
 }
Example #6
0
 /// <summary>
 /// 当前对象的字符串化文字
 /// </summary>
 /// <returns>字符串化文字</returns>
 public override string ToString()
 {
     return(UtilsJson <OptionsDataBase <T1, T2> > .ConvertToJsonString(this));
 }
        /// <summary>
        /// Convierte unalista de tipo Abiotecnologia a tipo biotecnologia.
        /// </summary>
        /// <param name="biotec">The biotec.</param>
        /// <returns>List&lt;TipoBiotecnologia&gt;.</returns>
        private List<TipoBiotecnologia> convertToTipoBiotecnologia(UtilsJson.ATipoBiotecnologia[] biotec)
        {
            if (biotec != null)
            {
                List<TipoBiotecnologia> listado = new List<TipoBiotecnologia>();
                foreach (UtilsJson.ATipoBiotecnologia aux in biotec)
                {
                    Expression<Func<TipoBiotecnologia, bool>> query = (u => u.id == aux.id);
                    List<TipoBiotecnologia> sec_aux = _repositorio.Filter<TipoBiotecnologia>(query);
                    if (sec_aux != null)
                    {
                        if (sec_aux.Count > 0)
                        {
                            listado.Add(sec_aux[0]);
                        }
                    }
                }
                return listado;
            }

            return null;
        }
        /// <summary>
        /// Convierte una lista de Asector a tipo Sector.
        /// </summary>
        /// <param name="sectores">The sectores.</param>
        /// <returns>List&lt;Sector&gt;.</returns>
        private List<Sector> convertToSector(UtilsJson.ASector[] sectores)
        {
            if (sectores != null)
            {
                List<Sector> listado = new List<Sector>();
                foreach (UtilsJson.ASector aux in sectores)
                {
                    Expression<Func<Sector, bool>> query = (u => u.id == aux.id);
                    List<Sector> sec_aux = _repositorio.Filter<Sector>(query);
                    if (sec_aux != null)
                    {
                        if (sec_aux.Count > 0)
                        {
                            listado.Add(sec_aux[0]);
                        }
                    }
                }
                return listado;
            }

            return null;
        }