itr = itemLines.keySet().iterator();
while (itr.hasNext()) {
Object obj = itr.next();
ItemElement ILE = (ItemElement) itemLines.get(obj);
IntMember ItemId = (IntMember) ILE.get("ItemId");
Integer currItemId = (Integer) ItemId.getMemberValue();
if (currItemId.intValue() == removeToken) {
String status = ILE.getLineStatus();
if (status.equals("Active")) {
ILE.setLineStatus("Deleted");
} // end of if statement (status.equals("Active"))
else if (status.equals("New")) {
removeKeys.add(obj);
} // end of else if statement (status.equals("New"))
} // end of if statement (currItemId.intValue() == removeToken)
} // end of while loop (itr.hasNext())
} // end of while loop (st.hasMoreTokens())
for (int i = 0; i < removeKeys.size(); i++) {
itemLines.remove(removeKeys.get(i));
} // end of for loop (int i=0; i<removeKeys.size(); i++)
itemLines.calculate();
} // end of if statement (itemLines != null)
proposallistform.setItemLines(itemLines);
OpportunityForm opportunityForm = (OpportunityForm) session.getAttribute("opportunityForm");
request.setAttribute("opportunityForm", opportunityForm);
session.setAttribute("opportunityForm", opportunityForm);
} // end of else if statement
// (viewOperation.equalsIgnoreCase(ProposalConstantKeys.REMOVEITEM))
else if (viewOperation.equalsIgnoreCase(ProposalConstantKeys.ADDITEM)) {
String newItemID = request.getParameter("theitemid");
ItemList IL = null;
ListGenerator lg = ListGenerator.getListGenerator(dataSource);
IL = lg.getItemList(individualID, 1, 10, "", "ItemID");
StringTokenizer st;
String token, nextItr;
if (newItemID != null) {
st = new StringTokenizer(newItemID, ",");
itemLines = proposallistform.getItemLines();
if (itemLines == null)
itemLines = new ItemLines();
counter = itemLines.size();
while (st.hasMoreTokens()) {
token = st.nextToken();
int intToken = Integer.parseInt(token);
Iterator itr = IL.keySet().iterator();
while (itr.hasNext()) {
nextItr = (String) itr.next();
ListElement ile = (ListElement) IL.get(nextItr);
IntMember smid = (IntMember) ile.get("ItemID");
Integer listItemid = (Integer) smid.getMemberValue();
if (listItemid.intValue() == intToken) {
StringMember smName = (StringMember) ile.get("Name"); // name =
// description
String name = (String) smName.getMemberValue();
StringMember smSku = (StringMember) ile.get("SKU");
String sku = (String) smSku.getMemberValue();
FloatMember dmprice = (FloatMember) ile.get("Price");
float price = Float.parseFloat((dmprice.getMemberValue()).toString());
int id = ile.getElementID();
IntMember LineId = new IntMember("LineId", 0, 'D', "", 'T', false, 20);
IntMember ItemId = new IntMember("ItemId", id, 'D', "", 'T', false, 20);
IntMember Quantity = new IntMember("Quantity", 1, 'D', "", 'T', false, 20);
FloatMember PriceEach = new FloatMember("Price", new Float(price), 'D', "", 'T', false, 20);
StringMember SKU = new StringMember("SKU", sku, 'D', "", 'T', false);
StringMember Description = new StringMember("Description", name, 'D', "", 'T', false);
FloatMember PriceExtended = new FloatMember("PriceExtended", new Float(0.0f), 'D', "", 'T', false, 20);
FloatMember TaxAmount = new FloatMember("TaxAmount", new Float(0.0f), 'D', "", 'T', false, 20);