public class MergeTwoArrays {
public MergeTwoArrays() {
super();
}
public static void main(String[] args){
int[] i={1,2,3,4,5,3,5,7};
int[] j={6,7,8,9,10,11};
int length = i.length+j.length;
int[] mergeArray = new int[length];
int pos=0;
for(int element:i){
mergeArray[pos]=element;
pos++;
}
for(int element:j){
mergeArray[pos]=element;
pos++;
}
System.out.println(Arrays.toString(mergeArray));
}
}
public Integer checkingMandatoryFieldsOnDtl() {
// ViewObjectImpl voImpl = (ViewObjectImpl)ReusableMethodsClass.getAM().findViewObject("FaAgetransDtlBrsVO1Iterator");
DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dcb = bindings.findIteratorBinding("FaTransDtlVO1Iterator");
ViewObject dtl = dcb.getViewObject();
RowSetIterator rsi = dtl.createRowSetIterator(null);
Integer count = 0;
while (rsi.hasNext()) {
Row r = rsi.next();
String[] reqFields = null;
String[] reqFieldsLabels = null;
String[] reqFieldsId = null;
reqFields =
new String[] { "AcUnitDtl", "MainacCodeDtl", "SubacCodeDtl", "Narration", "TransAmt", "TransDrcrTag"};
reqFieldsLabels =
new String[] { "Location", "Account Code", "Sub Account Code", "Narration", "Trans Amount","Dr/Cr tag"};
reqFieldsId =
new String[] { "acUnitDtlId", "mainacCodeDtlId", "subacCodeDtlId", "it9", "it10", "soc4"};
List<String> rF = new ArrayList<String>();
List<String> rFL = new ArrayList<String>();
List<String> rFI = new ArrayList<String>();
if (!getProjectCodeId().isDisabled()) {
System.out.println("Project id enabled and chk mandatory");
rF.add("ProjectCode");
rFL.add("Project Code");
rFI.add("projectCodeId");
}
if (!getBudgCentreCodeId().isDisabled()) {
System.out.println("Budget id enabled and chk mandatory");
rF.add("BudgCentreCode");
rFL.add("Budget Centre");
rFI.add("budgCentreCodeId");
}
if (!getProdEntityCodeId().isDisabled()) {
System.out.println("Product id enabled and chk mandatory");
rF.add("ProdEntityCode");
rFL.add("Product Entity");
rFI.add("prodEntityCodeId");
}
if (!getCostCentreCodeId().isDisabled()) {
System.out.println("Costcenter id enabled and chk mandatory");
rF.add("CostCentreCode");
rFL.add("Cost Center");
rFI.add("costCentreCodeId");
}
if (!getEmplCodeId().isDisabled()) {
System.out.println("Employee id enabled and chk mandatory");
rF.add("EmplCode");
rFL.add("Employee Code");
rFI.add("emplCodeId");
}
if (!getCashflowCodeId().isDisabled()) {
System.out.println("Cashflow id enabled and chk mandatory");
rF.add("CashflowCode");
rFL.add("Cash Flow");
rFI.add("cashflowCodeId");
}
if (!getAssetCodeId().isDisabled()) {
System.out.println("Asset id enabled and chk mandatory");
rF.add("AssetCode");
rFL.add("Asset");
rFI.add("assetCodeId");
}
String[] rFCombined =(String[])ArrayUtils.addAll(reqFields,rF.toArray());
String[] rFLCombined =(String[])ArrayUtils.addAll(reqFieldsLabels,rFL.toArray());
String[] rFICombined =(String[])ArrayUtils.addAll(reqFieldsId,rFI.toArray());
ReusableMethodsClass rmc = new ReusableMethodsClass();
count = rmc.mandatoryFieldsCheckInGridForAgeing("FaTransDtl7", rFCombined, rFICombined, rFLCombined, t1, r);
//rmc.mandatoryFieldsCheckInGridForAgeing("FaTransDtl7", reqFields, reqFieldsId, reqFieldsLabels, t1, r);
if (count > 0)
break;
}
System.out.println("Count checking :" + count);
return count;
}
public MergeTwoArrays() {
super();
}
public static void main(String[] args){
int[] i={1,2,3,4,5,3,5,7};
int[] j={6,7,8,9,10,11};
int length = i.length+j.length;
int[] mergeArray = new int[length];
int pos=0;
for(int element:i){
mergeArray[pos]=element;
pos++;
}
for(int element:j){
mergeArray[pos]=element;
pos++;
}
System.out.println(Arrays.toString(mergeArray));
}
}
public Integer checkingMandatoryFieldsOnDtl() {
// ViewObjectImpl voImpl = (ViewObjectImpl)ReusableMethodsClass.getAM().findViewObject("FaAgetransDtlBrsVO1Iterator");
DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dcb = bindings.findIteratorBinding("FaTransDtlVO1Iterator");
ViewObject dtl = dcb.getViewObject();
RowSetIterator rsi = dtl.createRowSetIterator(null);
Integer count = 0;
while (rsi.hasNext()) {
Row r = rsi.next();
String[] reqFields = null;
String[] reqFieldsLabels = null;
String[] reqFieldsId = null;
reqFields =
new String[] { "AcUnitDtl", "MainacCodeDtl", "SubacCodeDtl", "Narration", "TransAmt", "TransDrcrTag"};
reqFieldsLabels =
new String[] { "Location", "Account Code", "Sub Account Code", "Narration", "Trans Amount","Dr/Cr tag"};
reqFieldsId =
new String[] { "acUnitDtlId", "mainacCodeDtlId", "subacCodeDtlId", "it9", "it10", "soc4"};
List<String> rF = new ArrayList<String>();
List<String> rFL = new ArrayList<String>();
List<String> rFI = new ArrayList<String>();
if (!getProjectCodeId().isDisabled()) {
System.out.println("Project id enabled and chk mandatory");
rF.add("ProjectCode");
rFL.add("Project Code");
rFI.add("projectCodeId");
}
if (!getBudgCentreCodeId().isDisabled()) {
System.out.println("Budget id enabled and chk mandatory");
rF.add("BudgCentreCode");
rFL.add("Budget Centre");
rFI.add("budgCentreCodeId");
}
if (!getProdEntityCodeId().isDisabled()) {
System.out.println("Product id enabled and chk mandatory");
rF.add("ProdEntityCode");
rFL.add("Product Entity");
rFI.add("prodEntityCodeId");
}
if (!getCostCentreCodeId().isDisabled()) {
System.out.println("Costcenter id enabled and chk mandatory");
rF.add("CostCentreCode");
rFL.add("Cost Center");
rFI.add("costCentreCodeId");
}
if (!getEmplCodeId().isDisabled()) {
System.out.println("Employee id enabled and chk mandatory");
rF.add("EmplCode");
rFL.add("Employee Code");
rFI.add("emplCodeId");
}
if (!getCashflowCodeId().isDisabled()) {
System.out.println("Cashflow id enabled and chk mandatory");
rF.add("CashflowCode");
rFL.add("Cash Flow");
rFI.add("cashflowCodeId");
}
if (!getAssetCodeId().isDisabled()) {
System.out.println("Asset id enabled and chk mandatory");
rF.add("AssetCode");
rFL.add("Asset");
rFI.add("assetCodeId");
}
String[] rFCombined =(String[])ArrayUtils.addAll(reqFields,rF.toArray());
String[] rFLCombined =(String[])ArrayUtils.addAll(reqFieldsLabels,rFL.toArray());
String[] rFICombined =(String[])ArrayUtils.addAll(reqFieldsId,rFI.toArray());
ReusableMethodsClass rmc = new ReusableMethodsClass();
count = rmc.mandatoryFieldsCheckInGridForAgeing("FaTransDtl7", rFCombined, rFICombined, rFLCombined, t1, r);
//rmc.mandatoryFieldsCheckInGridForAgeing("FaTransDtl7", reqFields, reqFieldsId, reqFieldsLabels, t1, r);
if (count > 0)
break;
}
System.out.println("Count checking :" + count);
return count;
}
Comments
Post a Comment