1. Obtain a subsidiary of the parent company in accordance with CODE
<Proc ID="M_TCORP_CHILD_COMPANY_BY_P_CODE" Desc=""> <Param Code="P_CODE" ValuePath="@P_CODE"/> <Content Type="Query"> SELECT * FROM TCORP_CHILD_COMPANY WHERE P_CODE=:P_CODE order by to_number(SCGF) desc nulls last </Content> </Proc>
2. Get the code information according to the subject
select * from tcorp where o_code =:o_code
3. Get counterparty
public DataTable GetCorpByCRM(Corp corp) { var sql = SQLHelper.Select("TCORP", "*") .AddCondition("O_CODE", BLL.SQLHelper.Comparison.Equal, corp.O_CODE) .AddOrCondition("CUSTOM_CODE", BLL.SQLHelper.Comparison.Equal, corp.CUSTOM_CODE) .ToSelectSQL(); return BusinessService.ProcService.Query(sql); }