Collection mocList = this.getMOC();
Iterator iterator = mocList.iterator();
int count = 1;
while (iterator.hasNext()) {
MethodOfContactVO moc = (MethodOfContactVO)iterator.next();
// this is for email
if (moc.getMocType() == 1 && moc.getIsPrimary().equalsIgnoreCase("YES")) {
individualForm.set("email", moc.getContent());
individualForm.set("emailId", String.valueOf(moc.getMocID()));
} else if (count < 4 && moc.getMocType() != 1) {
individualForm.set("mocType" + count, String.valueOf(moc.getMocType()));
String mocContent = moc.getContent();
String mocContentValue = "";
String mocContentExt = "";
if (mocContent.indexOf("EXT") != -1) {
String tempContent = mocContent;
mocContentValue = tempContent.substring(0, tempContent.indexOf("EXT"));
mocContentExt = tempContent.substring(tempContent.indexOf("EXT") + 3, tempContent.length());
} else {
mocContentValue = mocContent;
}
individualForm.set("mocContent" + count, mocContentValue);
individualForm.set("mocExt" + count, mocContentExt);
individualForm.set("mocId" + count, String.valueOf(moc.getMocID()));
count++;
}
} // end of while
AddressVO address = this.getPrimaryAddress();