/// <summary> /// Populate class with cookie data /// </summary> /// <param name="portalId"> </param> /// <param name="moduleKey"> </param> /// <param name="storageType"> Select data storgae type "SessionMemory" or "Cookie" (Default Cookie) </param> /// <param name="nameAppendix">specifiy Unique key for search data</param> public NavigationData(int portalId, String moduleKey, string nameAppendix = "") { _storageType = StoreSettings.Current.StorageTypeClient; Exists = false; _portalId = portalId; _cookieName = "NBrightBuyNav" + "_" + moduleKey.Trim() + nameAppendix.Trim(); Get(); }
/// <summary> /// Populate class with cookie data /// </summary> /// <param name="portalId"> </param> /// <param name="moduleKey"> </param> /// <param name="storageType"> Select data storgae type "SessionMemory" or "Cookie" (Default Cookie) </param> /// <param name="nameAppendix">specifiy Unique key for search data</param> public NavigationData(int portalId, String moduleKey, string nameAppendix = "") { _storageType = StoreSettings.Current.StorageTypeClient; Exists = false; _portalId = portalId; _cookieName = "NBrightBuyNav" + "_" + moduleKey.Trim() + nameAppendix.Trim(); Get(); }
/// <summary> /// Populate class with cookie data /// </summary> /// <param name="portalId"> </param> /// <param name="moduleKey"> </param> /// <param name="storageType"> Select data storgae type "SessionMemory" or "Cookie" (Default Cookie) </param> /// <param name="nameAppendix">specifiy Unique key for search data</param> public NavigationData(int portalId, String moduleKey, string nameAppendix = "") { Exists = false; _portalId = portalId; _cookieName = "NBrightBuyNav" + "_" + moduleKey.Trim() + nameAppendix.Trim(); _storageType = DataStorageType.Cookie; // force cookie, some issues with session memory. Get(); }
/// <summary> /// Populate class with cookie data /// </summary> /// <param name="portalId"> </param> /// <param name="moduleKey"> </param> /// <param name="storageType"> Select data storgae type "SessionMemory" or "Cookie" (Default Cookie) </param> /// <param name="nameAppendix">specifiy Unique key for search data</param> public NavigationData(int portalId, String moduleKey, string nameAppendix = "") { _storageType = StoreSettings.Current.StorageTypeClient; Exists = false; _portalId = portalId; _cookieName = "NBrightBuyNav" + "*" + moduleKey + nameAppendix; _cookieNameXml = "NBrightBuyNavXml" + "*" + moduleKey + nameAppendix; _encryptkey = "NBrightBuyNav"; Get(); }
private static bool TestClient(DataStorageType storageType) { var storageFactory = new StorageFactory<IImageSource>(new AutoFacIocContainer()); var storage = storageFactory.Resolve(storageType); var data = File.ReadAllBytes(@"C:\Users\Public\Pictures\Sample Pictures\Koala.jpg"); var imageSource = storage.Save(data, ".png", "Joshs Photos"); var sourceData = storage.Retrieve(imageSource.Source); var thumbnailData = storage.Retrieve(imageSource.Thumbnail); File.WriteAllBytes(@"C:\temp\source.jpg", sourceData); File.WriteAllBytes(@"C:\temp\thumbnail.jpg", thumbnailData); return storage.Delete(imageSource.Source); }
public DataStorageConfigModel(DataStorageType typeParam) { Type = typeParam; if (typeParam == DataStorageType.CSV_FILE) { Name = "CSV Dosyası"; Extension = ".csv"; } else if (typeParam == DataStorageType.EXCEL_FILE) { Name = "Excel Dosyası"; Extension = ".xlsx"; } else if (typeParam == DataStorageType.SQL_DATABASE) { Name = "SQL Veritabanı"; Extension = ".sql"; } }
public static IDataWriter CreateDataWriter(string fileName, DataStorageType typeParam) { IDataWriter retVal = null; if (typeParam == DataStorageType.CSV_FILE) { retVal = new CSVWriter(fileName, ";"); } else if (typeParam == DataStorageType.EXCEL_FILE) { retVal = new ExcelWriter(fileName); } else if (typeParam == DataStorageType.SQL_DATABASE) { throw new NotImplementedException("SQL Database not implemented yet "); } else { throw new NotImplementedException("Unknown DataStorageType received " + typeParam); } return(retVal); }
/// <summary> /// 初始化默认权限表 /// </summary> /// <param name="initType">指定数据库</param> /// <param name="connectionString">连接字符串</param> public static void InitAccessDataTable(DataStorageType initType, string connectionString) { switch (initType) { case DataStorageType.PostgreSQL: { using var npgsqlDapperHelper = NpgsqlDapperHelper.Helper(connectionString); npgsqlDapperHelper.Execute(PostgreSQL.CREATESQL); break; } case DataStorageType.MySQL: break; case DataStorageType.SQLServer: break; default: break; } }
/// <summary> /// NewSQLTextProvider /// </summary> public static IDBProvider NewSQLTextProvider(string sqlText, string connectionString, DataStorageType storageType) { IDBProvider provider = null; switch (storageType) { case DataStorageType.Firebird: provider = FirebirdDBProvider.NewProvider(sqlText, connectionString, CommandType.Text); break; case DataStorageType.SQLServer: provider = SQLServerDBProvider.NewProvider(sqlText, connectionString, CommandType.Text); break; } return provider; }
/// <summary> /// NewRuntimeProjectProvider /// </summary> public static IDBProvider NewProvider(string storedProcedure, string connectionString, DataStorageType storageType) { IDBProvider provider = null; switch (storageType) { case DataStorageType.Firebird: provider = FirebirdDBProvider.NewProvider(storedProcedure, connectionString); break; case DataStorageType.SQLServer: provider = SQLServerDBProvider.NewProvider(storedProcedure, connectionString); break; } return provider; }
/// <summary> /// NewDataSetProvider /// </summary> public static IDBProvider NewDataSetProvider(string deleteStoredProcedureName, string insertStoredProcedureName, string selectStoredProcedureName, string updateStoredProcedureName, string connectionString, DataStorageType storageType) { IDBProvider provider = null; switch (storageType) { case DataStorageType.Firebird: provider = FirebirdDBProvider.NewDataSetProvider(deleteStoredProcedureName, insertStoredProcedureName, selectStoredProcedureName, updateStoredProcedureName, connectionString, false); break; case DataStorageType.SQLServer: provider = SQLServerDBProvider.NewDataSetProvider(deleteStoredProcedureName, insertStoredProcedureName, selectStoredProcedureName, updateStoredProcedureName, connectionString); break; } return provider; }
/// <summary> /// NewDataReader /// </summary> public static IWhizzDataReader NewDataReader(IDataReader reader, string name, DataStorageType storageType) { IWhizzDataReader dataReader = null; switch (storageType) { case DataStorageType.Firebird: dataReader = new FirebirdDataReader(reader, name); break; case DataStorageType.SQLServer: dataReader = new SQLServerDataReader(reader, name); break; } return dataReader; }
/// <summary> /// NewProjectProvider /// </summary> public static IDBProvider NewDatabaseProvider(DataStorageType dataStorageType, CommandType cmdType) { IDBProvider provider = null; switch (dataStorageType) { case DataStorageType.Firebird: provider = FirebirdDBProvider.NewProjectProvider(cmdType); break; case DataStorageType.SQLServer: provider = SQLServerDBProvider.NewProjectProvider(cmdType); break; } return provider; }
/// <summary> /// 初始化默认权限表 /// </summary> /// <param name="initType">指定数据库</param> /// <param name="connectionString">连接字符串</param> public static void InitAccessDataTable(DataStorageType initType, string connectionString) { var npgsqlDapperHelper = NpgsqlDapperHelper.Helper(connectionString); //npgsqlDapperHelper.Execute(); }