Exemplo n.º 1
0
        /// <summary>
        /// Returns FileCacheProvider or  MemoryCacheProvider object as per settings from config file.
        /// </summary>
        /// <returns></returns>
        ///
        public static ICacheProvider GetCacheProvoder()//System.Web.HttpContext oContext
        {
            FPCommon _oGspCommon = new FPCommon();
            //_oGspCommon = (CommonSettings)System.Configuration.ConfigurationManager.GetSection("GSPCommon");
            //string cacheProviderName = _oGspCommon.CommonSettings.TypeOfCaching.ToString();

            ICacheProvider cacheProvider = null;

            //try
            //{
            //    if (cacheProviderName == "FileCacheProvider")
            //    {
            //        cacheProvider = FileCacheProvider.GetCacheProvider();
            //    }
            //    else if (cacheProviderName == "MemoryCacheProvider")
            //    {
            //        cacheProvider = MemoryCacheProvider.GetCacheProvider();//oContext
            //    }
            //}
            //catch (Exception ex)
            //{
            //    throw ex;
            //}

            return(cacheProvider);
        }
Exemplo n.º 2
0
        public ConfigHandler()
        {
            FPCommon oGspCommon = new FPCommon();

            oGspCommon = (FPCommon)System.Configuration.ConfigurationManager.GetSection("GSPCommon");
            //string sEncryptionDecryptionAlgorithm = oGspCommon.CommonSettings.EncryptionDecryptionAlgorithm.ToString().ToUpper();
            CryptographyAlgorithm algorithm = new CryptographyAlgorithm();

            /*  switch (sEncryptionDecryptionAlgorithm)
             *                                {
             *                                        case "DES":
             *                                                algorithm = CryptographyAlgorithm.Des;
             *                                                break;
             *                                        case "MACHINEDPAPI":
             *                                                algorithm = CryptographyAlgorithm.MachineDpApi;
             *                                                break;
             *                                        case "RC2":
             *                                                algorithm = CryptographyAlgorithm.Rc2;
             *                                                break;
             *                                        case "RIJNDAEL":
             *                                                algorithm = CryptographyAlgorithm.Rijndael;
             *                                                break;
             *                                        case "TRIPLEDES":
             *                                                algorithm = CryptographyAlgorithm.TripleDes;
             *                                                break;
             *                                        case "USERDPAPI":
             *                                                algorithm = CryptographyAlgorithm.UserDpApi;
             *                                                break;
             *                                }*/
            CreateHelper(algorithm);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Returns the active open connection
        /// </summary>
        /// <returns>SQLConnection</returns>
        private SqlConnection GetConnection()
        {
            try
            {
                FPCommon oFPCommon = new FPCommon();
                oFPCommon = (FPCommon)ConfigurationManager.GetSection("FPCommon");
                string sConnectString = oFPCommon.CommonSettings.ConnectionStringDailer;

                // string sConnectString = ConfigurationSettings.AppSettings["ConnectionString"].ToString();

                SqlConnection conObjConnect = new SqlConnection(sConnectString);
                conObjConnect.Open();
                return(conObjConnect);
            }
            catch (Exception ex)
            {
                oCommon.IsDBConnectionError = true;
                throw ex;
            }
        }
Exemplo n.º 4
0
 public Logger()
 {
     //oGspCommon = (CommonSettings)System.Configuration.ConfigurationManager.GetSection("FPCommon");
     this.oFpCommon = new FPCommon();
     this.oFpCommon = (FPCommon)ConfigurationManager.GetSection("FPCommon");
 }