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. css伪类选择器及伪元素选择器

    1.类选择器 在css中可以使用类选择器把相同的元素定义成不同的样式.比如: 结果如下: 标题背景未变 2.伪类选择器 类选择器和伪类选择器的区别在于,类选择器我们定义的,而伪类选择器是CSS中已经定 ...

  2. 听桶哥讲session和cookie

    首先,cookie和session是什么关系? 他们的关系很简单,利用和被利用的关系. 话说,由于http协议的无状态特性,同一client两个不同的请求之间完全独立,没有很好的办法进行一些数据共享, ...

  3. 关于flume配置加载(二)

    为什么翻flume的代码,一方面是确实遇到了问题,另一方面是想翻一下flume的源码,看看有什么收获,现在收获还谈不上,因为要继续总结.不够已经够解决问题了,而且确实有好的代码,后续会继续慢慢分享,这 ...

  4. DataSet,DataTable与DataRow的复制方法

    DataSet 对象是支持 ADO.NET的断开式.分布式数据方案的核心对象 ,用途非常广泛.我们很多时候需要使用其中的数据,比如取得一个DataTable的数据或者复制另一个DataTabe中的数据 ...

  5. 罗辑思维(罗胖)阿瑟·黑利书:《大饭店》、《晚间新闻》、《超载》、《最后诊断》、《钱商》、《身高居位》电子书 pdf和mobi格式得到下载

    阿瑟黑利 mobi kindle mobi/txt 1.[智读]_超载.txt 2.[智读]_大饭店 - 阿瑟·黑利.mobi 3.[智读]_钱商 - [加拿大]阿瑟·黑利.mobi 4.[智读]_身 ...

  6. 初转java随感(一)程序=数据结构+算法

    大学刚学编程的时候,有一句很经典的话程序=数据结构+算法 今天有了进一步认识. 场景: 1.当前局面 (1)有现成的封装好的分页组件 返回结果是page.类型为:Page.包括 page 分页信息,d ...

  7. dvwa第一次接触

    DVWA (Damn Vulnerable Web Application)DVWA是用PHP+Mysql编写的一套用于常规WEB漏洞教学和检测的WEB脆弱性测试程序.包含了SQL注入.XSS.盲注等 ...

  8. Ninject使用介绍

    #region 第二种写法 /// <summary> /// using(IKernel tKernel=new StandardKernel(new PeoKernelServer() ...

  9. oracle for循环查找结果

    -- Call the procedure begin ' ) loop dbms_output.put_line('v_rlt = '||v_rlt.ID||v_rlt.inspection_no) ...

  10. Shell编程菜鸟基础入门笔记

    Shell编程基础入门     1.shell格式:例 shell脚本开发习惯 1.指定解释器 #!/bin/bash 2.脚本开头加版权等信息如:#DATE:时间,#author(作者)#mail: ...