This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal partial class NewCompanyService | |
{ | |
private async Task AddCurrencyAsync() | |
{ | |
// Get data | |
var data = ExcelHelper.GetTableData<CurrencyRow>(Path.Combine(mTemplatePath!, "0017_Currency.xlsx")).ToList(); | |
var dataEntityGLC = ExcelHelper.GetTableData<EntityGLCRow>(Path.Combine(mTemplatePath!, "0017_CurrencyEntityGLC.xlsx")).ToList(); | |
var dataRateGroup = ExcelHelper.GetTableData<CurrConvRuleRow>(Path.Combine(mTemplatePath!, "0018_CurrencyRateGroup.xlsx")).ToList(); | |
var dataExRate = ExcelHelper.GetTableData<CurrExRateRow>(Path.Combine(mTemplatePath!, "0019_CurrencyExchangeRate.xlsx")).ToList(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ExcelHelper | |
{ | |
/// <summary> | |
/// Gets all table data from excel file | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
/// <param name="filePath"></param> | |
/// <returns></returns> | |
public static IEnumerable<T> GetTableData<T>(string filePath) where T : class | |
{ |