Index: trunk/ver3/finalizeShowCase.jsp =================================================================== diff -u -r208 -r224 --- trunk/ver3/finalizeShowCase.jsp (.../finalizeShowCase.jsp) (revision 208) +++ trunk/ver3/finalizeShowCase.jsp (.../finalizeShowCase.jsp) (revision 224) @@ -3,130 +3,120 @@ * version 3.0 * ------------------------------------------------------------%> - -<%@include file="/common/header.jsp"%> + +<%@include file="/common/header.jsp" %> - - - - - + + + + +
- - - - - - - - - - - -
Edit ShowcaseAttendance RegistrationSummary ReportComplete Reportper Rep ReportFinalize Showcase
-
+ + + + + + + + + + + +
Edit ShowcaseAttendance RegistrationSummary ReportComplete Reportper Rep ReportFinalize Showcase
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + Sorry hospitalities cannot be finalized + +
 
 
 
  +

+ + + + + + + +
- - - - - - - FINALIZE SHOWCASE - - - - - - -
- - - -
-

+

+ + + + + + + FINALIZE SHOWCASE + + + + + + +
+ -
+

+ + dealers will be sent to the mainframe.
+ + + - - - dealers will be sent to the mainframe.
- - - - - -
- - - Sorry hospitalities cannot be finalized - -
 
 
 
  - -

- -
Index: trunk/WEB-INF/src/com/showcase/actions/UpdateDealerAttendeesAction.java =================================================================== diff -u -r223 -r224 --- trunk/WEB-INF/src/com/showcase/actions/UpdateDealerAttendeesAction.java (.../UpdateDealerAttendeesAction.java) (revision 223) +++ trunk/WEB-INF/src/com/showcase/actions/UpdateDealerAttendeesAction.java (.../UpdateDealerAttendeesAction.java) (revision 224) @@ -82,6 +82,7 @@ else showCaseDelegate.updateDealerAttendee(da[i]); } + submitToMainframeAsAttended(dealerForm, showCaseDelegate, showCaseDetailObject, dealer_id, event_id); attendanceRegistrationForward = statusUtil.getAttendanceRegistrationForward(showCaseDetailObject); log.info("attendanceRegistrationForward =>" + attendanceRegistrationForward); return mapping.findForward(attendanceRegistrationForward); @@ -180,45 +181,8 @@ } dealerForm.setDealerItems(de); dealerForm.setRoles(showCaseDelegate.getRoles()); - - } else if (dealerForm.getSubmitToMainframeAsAttended().isSelected()) { - - DealerEvent dealerEvent = showCaseDelegate.getDealerEvent(event_id, dealer_id); - - SimpleDateFormat formatter = new SimpleDateFormat("MM-dd-yyyy"); - - JMainframeImpl mf = new JMainframeImpl(); - Transaction transaction = new SingleDealerAttended( - showCaseDetailObject.getEventCode(), - formatter.parse(showCaseDetailObject.getStartDate()), - formatter.parse(showCaseDetailObject.getEndDate()), - dealer_id, - dealerEvent.isTicketBuyIn() - ); - String responseFromMF = mf.getData(transaction.getMID()); - CustomVector cvec = null; - try { - transaction.parseMOD(responseFromMF); - cvec = transaction.getMODDefinition(); - } catch (Exception e) { - e.printStackTrace(); - } - - if (!cvec.get("Message").equals("ERROR") && !cvec.get("Message").toString().equalsIgnoreCase("bad show code")) { - Integer submittedCount = Integer.parseInt((String) cvec.get("DealersInserted")); - if (submittedCount != null && submittedCount == 1) { - dealerForm.setSubmittedToMainframe(true); - showCaseDelegate.setDealerSubmittedToMainframe(event_id, dealer_id); - } - } else { - log.error("Mainframe dealer insert failed" + cvec.get("Message")); - } - - DealerAttendee[] de = showCaseDelegate.dealerAttendeesRoles(event_id, dealer_id); - addBlankDealers(dealerForm, de); - dealerAttendeesForward = statusUtil.getDealerAttendeesForward(showCaseDetailObject); - return mapping.findForward(dealerAttendeesForward); - } else { + submitToMainframeAsAttended(dealerForm, showCaseDelegate, showCaseDetailObject, dealer_id, event_id); + } else { /* if(request.getParameter("attendee_id")==null || request.getParameter("attendee_id").isEmpty()) { @@ -274,6 +238,43 @@ return mapping.findForward(dealerAttendeesForward); } + private void submitToMainframeAsAttended(DealerAttendeesForm dealerForm, ShowCaseDelegate showCaseDelegate, + ShowCaseDetailObject showCaseDetailObject, String dealer_id, int event_id) throws Exception { + DealerEvent dealerEvent = showCaseDelegate.getDealerEvent(event_id, dealer_id); + + if (dealerEvent.isSubmittedToMainframe() != true) { + + SimpleDateFormat formatter = new SimpleDateFormat("MM-dd-yyyy"); + + JMainframeImpl mf = new JMainframeImpl(); + Transaction transaction = new SingleDealerAttended( + showCaseDetailObject.getEventCode(), + formatter.parse(showCaseDetailObject.getStartDate()), + formatter.parse(showCaseDetailObject.getEndDate()), + dealer_id, + dealerEvent.isTicketBuyIn() + ); + String responseFromMF = mf.getData(transaction.getMID()); + CustomVector cvec = null; + try { + transaction.parseMOD(responseFromMF); + cvec = transaction.getMODDefinition(); + } catch (Exception e) { + e.printStackTrace(); + } + + if (!cvec.get("Message").equals("ERROR") && !cvec.get("Message").toString().equalsIgnoreCase("bad show code")) { + Integer submittedCount = Integer.parseInt((String) cvec.get("DealersInserted")); + if (submittedCount != null && submittedCount == 1) { + dealerForm.setSubmittedToMainframe(true); + showCaseDelegate.setDealerSubmittedToMainframe(event_id, dealer_id); + } + } else { + log.error("Mainframe dealer insert failed" + cvec.get("Message")); + } + } + } + private void addBlankDealers(DealerAttendeesForm dealerForm, DealerAttendee[] de) throws Exception { DealerAttendee[] blankDealers = null; if (de != null && de.length <= 4) { Index: trunk/WEB-INF/src/com/showcase/actions/FinalizeAction.java =================================================================== diff -u -r223 -r224 --- trunk/WEB-INF/src/com/showcase/actions/FinalizeAction.java (.../FinalizeAction.java) (revision 223) +++ trunk/WEB-INF/src/com/showcase/actions/FinalizeAction.java (.../FinalizeAction.java) (revision 224) @@ -1,34 +1,25 @@ package com.showcase.actions; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import com.showcase.delegate.ShowCaseDelegate; +import com.showcase.util.ShowCaseBaseAction; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; -import com.showcase.delegate.ShowCaseDelegate; -import com.showcase.email.SendShowCaseEmail; -import com.showcase.util.ShowCaseBaseAction; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + public class FinalizeAction extends ShowCaseBaseAction { - public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { - int event_id = Integer.parseInt(request.getParameter("event_id")); - - // ************ FINALIZE ************************* - - ShowCaseDelegate showCaseDelegate = new ShowCaseDelegate(); - request.setAttribute("showcaseinfo", showCaseDelegate.getShowCaseInfo(event_id)); - request.setAttribute("showtotals", showCaseDelegate.getSummaryReport(event_id)); -// request.setAttribute("totalAccepted", "" + showCaseDelegate.finalizeShowCase(event_id)); - - - // ************* SEND EMAIL *********************** - //SendRepsEmail sendRepsEmail = new SendRepsEmail(); - //sendRepsEmail.sendMail(event_id); - SendShowCaseEmail sendShowCaseEmail = new SendShowCaseEmail(); - sendShowCaseEmail.sendMail(event_id); - - return mapping.findForward("finalize"); - } + int event_id = Integer.parseInt(request.getParameter("event_id")); + + ShowCaseDelegate showCaseDelegate = new ShowCaseDelegate(); + request.setAttribute("showcaseinfo", showCaseDelegate.getShowCaseInfo(event_id)); + request.setAttribute("showtotals", showCaseDelegate.getSummaryReport(event_id)); + request.setAttribute("totalAccepted", "" + showCaseDelegate.finalizeShowCase(event_id)); + + return mapping.findForward("finalize"); + } } Index: trunk/ver3/dealerAttendeesShowcase.jsp =================================================================== diff -u -r223 -r224 --- trunk/ver3/dealerAttendeesShowcase.jsp (.../dealerAttendeesShowcase.jsp) (revision 223) +++ trunk/ver3/dealerAttendeesShowcase.jsp (.../dealerAttendeesShowcase.jsp) (revision 224) @@ -98,6 +98,24 @@ Zip: Program: Tickets: + + + + + + + + + + + + <%-- update notes form --%> @@ -146,9 +164,6 @@
- - -
Index: trunk/WEB-INF/src/com/showcase/actions/EmailRepsAction.java =================================================================== diff -u -r208 -r224 --- trunk/WEB-INF/src/com/showcase/actions/EmailRepsAction.java (.../EmailRepsAction.java) (revision 208) +++ trunk/WEB-INF/src/com/showcase/actions/EmailRepsAction.java (.../EmailRepsAction.java) (revision 224) @@ -1,33 +1,31 @@ package com.showcase.actions; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - +import com.showcase.delegate.ShowCaseDelegate; +import com.showcase.email.SendShowCaseEmail; +import com.showcase.util.ShowCaseBaseAction; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; -import com.showcase.delegate.ShowCaseDelegate; -import com.showcase.email.SendShowCaseEmail; -import com.showcase.util.ShowCaseBaseAction; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; public class EmailRepsAction extends ShowCaseBaseAction { - private static final Log log = LogFactory.getLog(EmailRepsAction.class); - - public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { - log.info("EmailRepsAction"); - int event_id = Integer.parseInt(request.getParameter("event_id")); - //SendRepsEmail sendRepsEmail = new SendRepsEmail(); - //sendRepsEmail.sendMail(event_id); - SendShowCaseEmail sendShowCaseEmail = new SendShowCaseEmail(); - sendShowCaseEmail.sendMail(event_id); - - ShowCaseDelegate showCaseDelegate = new ShowCaseDelegate(); - request.setAttribute("showcaseinfo", showCaseDelegate.getShowCaseInfo(event_id)); - request.setAttribute("showtotals", showCaseDelegate.getSummaryReport(event_id)); - - return mapping.findForward("emailed"); - } -} \ No newline at end of file + + private static final Log log = LogFactory.getLog(EmailRepsAction.class); + + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { + int event_id = Integer.parseInt(request.getParameter("event_id")); + + SendShowCaseEmail sendShowCaseEmail = new SendShowCaseEmail(); + sendShowCaseEmail.sendMail(event_id); + + ShowCaseDelegate showCaseDelegate = new ShowCaseDelegate(); + request.setAttribute("showcaseinfo", showCaseDelegate.getShowCaseInfo(event_id)); + request.setAttribute("showtotals", showCaseDelegate.getSummaryReport(event_id)); + + return mapping.findForward("emailed"); + } +}