static

void LoadMainAccountCSV(Args _args)

{

/*

SysExcelApplication        excel;

SysExcelWorkbooks      workbooks;

SysExcelWorkbook        workbook,_workbook;

SysExcelWorksheets    worksheets,_worksheets;

SysExcelWorksheet      worksheet,_worksheet;

SysExcelCells              cells,_cells;

*/

CommaIo           csvFile;

COMVariantType              type,_type;

;

MainAccount                   _MainAccount;

MainAccountLegalEntity        _MainAccountLegalEntity;

FileName                      fileName;

container                     readCon = conNull();

AccountNum                 mainAccountId;

;

filename =

@'C:\COA_live.csv';

csvFile =

new CommaIo(filename, 'r');

csvFile.inFieldDelimiter(

','); // Delimiter...

/*

#define.filename(@'C:\chartofaccount.xlsx')

excel = SysExcelApplication::construct();

workbooks = excel.workbooks();

try

{

workbooks.open(#filename);

}

catch (Exception::Error)

{

throw error("File cannot be opened");

}

workbook      = workbooks.item(1);

worksheets = workbook.worksheets();

worksheet    = worksheets.itemFromNum(1);

cells            = worksheet.cells();

//row = row + 1;

type = cells.item(row+1, 1).value().variantType();

//通过循环读取导入信息

*/

ttsBegin;

//delete_from _MainAccount;

if (csvFile)

{

readCon = csvFile.read();

while (csvFile.status() == IO_Status::OK)

{

readCon = csvFile.read();

)

{

break;

}

)).RecId)

{

 

_MainAccount.clear();

_MainAccount.MainAccountId =

);

_MainAccount.LedgerChartOfAccounts =

;

))

{

case"Total":

_MainAccount.Type = DimensionLedgerAccountType::Total;

break;

case"Asset":

_MainAccount.Type = DimensionLedgerAccountType::Asset;

break;

case"Liability":

_MainAccount.Type = DimensionLedgerAccountType::Liability;

break;

case"Equity":

_MainAccount.Type = DimensionLedgerAccountType::Equity;

break;

case"BalanceSheet":

_MainAccount.Type = DimensionLedgerAccountType::BalanceSheet;

break;

case"Expense":

_MainAccount.Type = DimensionLedgerAccountType::Expense;

break;

case"Revenue":

_MainAccount.Type = DimensionLedgerAccountType::Revenue;

break;

case"ProfitAndLoss":

_MainAccount.Type = DimensionLedgerAccountType::ProfitAndLoss;

break;

case"Blank":

_MainAccount.Type = DimensionLedgerAccountType::Blank;

break;

case"Reporting":

_MainAccount.Type = DimensionLedgerAccountType::Reporting;

break;

case"Common_CN":

_MainAccount.Type = DimensionLedgerAccountType::Common_CN;

break;

}

_MainAccount.Name =

);

_MainAccount.insert();

}

else

{

mainAccountId =

);

selectforUpdate _MainAccount

where _MainAccount.MainAccountId == mainAccountId;

if(_MainAccount)

{

))

{

case"Total":

_MainAccount.Type = DimensionLedgerAccountType::Total;

break;

case"Asset":

_MainAccount.Type = DimensionLedgerAccountType::Asset;

break;

case"Liability":

_MainAccount.Type = DimensionLedgerAccountType::Liability;

break;

case"Equity":

_MainAccount.Type = DimensionLedgerAccountType::Equity;

break;

case"BalanceSheet":

_MainAccount.Type = DimensionLedgerAccountType::BalanceSheet;

break;

case"Expense":

_MainAccount.Type = DimensionLedgerAccountType::Expense;

break;

case"Revenue":

_MainAccount.Type = DimensionLedgerAccountType::Revenue;

break;

case"ProfitAndLoss":

_MainAccount.Type = DimensionLedgerAccountType::ProfitAndLoss;

break;

case"Blank":

_MainAccount.Type = DimensionLedgerAccountType::Blank;

break;

case"Reporting":

_MainAccount.Type = DimensionLedgerAccountType::Reporting;

break;

case"Common_CN":

_MainAccount.Type = DimensionLedgerAccountType::Common_CN;

break;

}

}

_MainAccount.update();

}

}

 

}

ttsCommit;

 

/*

ttsBegin;

//delete_from _MainAccountLegalEntity;

while select _MainAccount

{

_MainAccountLegalEntity.clear();

_MainAccountLegalEntity.LegalEntity = 5637144577;

_MainAccountLegalEntity.MainAccount = _MainAccount.RecId;

_MainAccountLegalEntity.insert();

}

ttsCommit;

*/

info(

"ok");

}

load mainaccount的更多相关文章

  1. load和initialize方法

      一.load 方法什么时候调用: 在main方法还没执行的时候 就会 加载所有类,调用所有类的load方法. load方法是线程安全的,它使用了锁,我们应该避免线程阻塞在load方法. 在项目中使 ...

  2. "NHibernate.Exceptions.GenericADOException: could not load an entity" 解决方案

     今天,测试一个项目的时候,抛出了这个莫名其妙的异常,然后就开始了一天的调试之旅... 花了很长时间,没有从代码找出任何问题... 那么到底哪里出问题呢? 根据下面那段长长的错误日志: -- ::, ...

  3. hibernate的get和load的区别

    在hibernate中我们知道如果要从数据库中得到一个对象,通常有两种方式,一种是通过session.get()方法,另一种就是通过session.load()方法,然后其实这两种方法在获得一个实体对 ...

  4. DOM加载过程中ready和load的区别

    在浏览器地址栏输入URL地址,浏览器开始加载页面时,有以下几个过程 1.浏览器开始解析HTML文档 2. 浏览器遇到HTML文档中的<script>元素以及CSS样式文件,并且没有asyn ...

  5. Resources.Load加载文件返回null的原因

    1.文件夹都要放在Resources目录下 2.加载时photoName不需要扩展名 Texture2D t = Resources.Load<Texture2D>("Loadi ...

  6. elasticsearch按照配置时遇到的一些坑 [Failed to load settings from [elasticsearch.yml]]

    这里整理几个空格引起的问题. 版本是elasticsearch-2.3.0 或者elasticsearch-rtf-master Exception in thread "main" ...

  7. jq方法中 $(window).load() 与 $(document).ready() 的区别

    通过自学进入了前端的行列,只知道在js中,一开头就写一个: window.onload = function(){ //doing sth} 然后所有的乱七八糟的代码全塞里面,大概知道window.o ...

  8. 事件DOMContentLoaded和load的区别

    1.当 onload 事件触发时,页面上所有的DOM,样式表,脚本,图片,flash都已经加载完成了. 2.当 DOMContentLoaded 事件触发时,仅当DOM加载完成,不包括样式表,图片,f ...

  9. Lazy Load, 延迟加载图片的 jQuery 插件.

    Lazy Load 是一个用 JavaScript 编写的 jQuery 插件. 它可以延迟加载长页面中的图片. 在浏览器可视区域外的图片不会被载入, 直到用户将页面滚动到它们所在的位置. 这与图片预 ...

随机推荐

  1. ArcGIS Earth

    恩,万众瞩目的ArcGIS Earth,现在华丽丽的可以在官网上下载了 满怀希望的心花怒放的我就去下载了...... 然后得然后...... 打开界面简洁的不要不要的,连个Esri的logo都没有.好 ...

  2. C语言中内存的申请函数

    C语言跟内存申请相关的函数主要有 alloca,calloc,malloc,free,realloc,sbrk等. alloca是向栈申请内存,因此无需释放. malloc分配的内存是位于堆中的,并且 ...

  3. python 3 学习笔记(二)

    1.python中的数据类型 python使用对象模型来存储数据,每一个数据类型都有一个内置的类,每新建一个数据,实际就是在初始化生成一个对象,即所有数据都是对象对象三个特性 身份:内存地址,可以用i ...

  4. Python非阻塞网络通信Howto

    在Python中,你使用socket.setblocking(0)使它无阻塞.在C中,它更复杂,(一方面,你需要在BSD风格O_NONBLOCK和几乎不可区分的Posix风味O_NDELAY之间进行选 ...

  5. 视图(View) – ASP.NET MVC 4 系列

           精心编写的整洁代码是开发一个可维护 Web 应用程序的基础.但用户在浏览器中访问时,这些工作他们是看不见的.用户对应用程序的第一印象,以及与应用程序的整个交互过程都是从视图开始的.    ...

  6. node.js环境安装,及连接mongodb测试

    1.node.js环境安装 npm config set python python2.7npm config set msvs_version 2013npm config set registry ...

  7. 安卓,支付宝app登录时,提示 服务器安全证书已过期或不可信任,请问怎么解决

    安卓,支付宝app登录时,提示 服务器安全证书已过期或不可信任,请问怎么解决 请把手机时间调成当前时间.

  8. PADS在注册表中的菜单栏数据

    位于 [HKCU\Software\Mentor Graphics\PADS9_5\PADS Layout\Workspaces\ENU\Default\BCGToolBar-593980] 下的二进 ...

  9. 使用npm安装一些包失败了的看过来(npm国内镜像介绍)

    这个也是网上搜的,亲自试过,非常好用! 镜像使用方法(三种办法任意一种都能解决问题,建议使用第三种,将配置写死,下次用的时候配置还在): 1.通过config命令 npm config set reg ...

  10. Sql Server Analysis Service 转换为UnknownMember的正确设置 (转载)

    转载: http://www.cnblogs.com/OpenCoder/p/4754447.html#commentform 在SSAS中事实表数据被归类到为UnknownMember 的时候分为两 ...