Package com.centraview.account.accountfacade

Examples of com.centraview.account.accountfacade.AccountFacadeHome


    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
    HttpSession session = request.getSession(true);
    int individualId = ((UserObject)session.getAttribute("userobject")).getIndividualID();
    ArrayList deleteLog = new ArrayList();
    String rowId[] = request.getParameterValues("rowId");
    AccountFacadeHome accountFacadeHome = (AccountFacadeHome)CVUtility.getHomeObject("com.centraview.account.accountfacade.AccountFacadeHome","AccountFacade");
    try
    {
      AccountFacade remote = (AccountFacade)accountFacadeHome.create();
      remote.setDataSource(dataSource);
      for (int i=0; i<rowId.length; i++)
      {
        if(rowId[i] != null && !rowId[i].equals(""))
        {
View Full Code Here


    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
    HttpSession session = request.getSession(true);
    int individualId = ((UserObject)session.getAttribute("userobject")).getIndividualID();
    ArrayList deleteLog = new ArrayList();
    String rowId[] = request.getParameterValues("rowId");
    AccountFacadeHome accountFacadeHome = (AccountFacadeHome)CVUtility.getHomeObject("com.centraview.account.accountfacade.AccountFacadeHome","AccountFacade");
    try
    {
      AccountFacade remote = accountFacadeHome.create();
      remote.setDataSource(dataSource);
      for (int i=0; i<rowId.length; i++)
      {
        if(rowId[i] != null && !rowId[i].equals(""))
        {
View Full Code Here

  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException, CommunicationException, NamingException
  {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();

    AccountFacadeHome accountFacadeHome = (AccountFacadeHome)CVUtility.getHomeObject("com.centraview.account.accountfacade.AccountFacadeHome","AccountFacade");
    try
    {
      HttpSession session = request.getSession(true);
      request.setAttribute(AccountConstantKeys.TYPEOFSUBMODULE, AccountConstantKeys.EXPENSE);
      request.setAttribute("body", "EDIT");

      ExpenseForm expenseForm = (ExpenseForm)request.getAttribute("expenseform");
      ItemLines itemLines=null;

      expenseForm.convertItemLines();

      com.centraview.common.UserObject  userobjectd = (com.centraview.common.UserObject)session.getAttribute( "userobject" );//get the user object
      int individualID = userobjectd.getIndividualID();

      int expenseID = 0;

      UserPrefererences userPref = userobjectd.getUserPref();
      String dateFormat  = userPref.getDateFormat();

      dateFormat= "M/d/yyyy";
      String timeZone    = userPref.getTimeZone();
      if(timeZone == null)
        timeZone = "EST";

      GregorianCalendar gCal = new GregorianCalendar(TimeZone.getTimeZone(timeZone));
      SimpleDateFormat dForm = new SimpleDateFormat(dateFormat);
      dForm.setCalendar(gCal);


      if(request.getParameter("rowId") != null)
        expenseID = Integer.parseInt((String)request.getParameter("rowId"));
      else
        expenseID = expenseForm.getExpenseID();

      String typeOfOperation = request.getParameter(AccountConstantKeys.TYPEOFOPERATION);

      /*
      Remove item
      */
      if(typeOfOperation != null &&  typeOfOperation.equals("REMOVEITEM") )
      {
        String removeIDs = request.getParameter("removeID");
        StringTokenizer st;
        Iterator itr;
        Vector removeKeys = new Vector();

        itemLines = expenseForm.getItemLines();
        if (itemLines != null)
        {
          st = new StringTokenizer(removeIDs, ",");
          while (st.hasMoreTokens())
          {
            String str = st.nextToken();
            int removeToken = Integer.parseInt(str);

            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 (status.equals("Active"))
                else  if (status.equals("New"))
                {
                  removeKeys.add(obj);
                }//end of else  if (status.equals("New"))
              }//end of if ( currItemId.intValue() == removeToken)
            }//end of while (itr.hasNext())
          }//end of while (st.hasMoreTokens())

          for(int i=0; i<removeKeys.size(); i++)
          {
            itemLines.remove(removeKeys.get(i));
          }// end of for(int i=0; i<removeKeys.size(); i++)
        }//end of if (itemLines != null)

        expenseForm.setItemLines(itemLines);
        request.setAttribute("expenseform",expenseForm);
      }// end of if(typeOfOperation != null &&  typeOfOperation.equals("REMOVEITEM") )
      /*  ADD item  */
      else if(typeOfOperation != null && typeOfOperation.equals("ADDITEM") )
      {
        String newItemID = request.getParameter("theitemid");
        ItemList IL = null ;
        ListGenerator lg = ListGenerator.getListGenerator(dataSource);//get the List Generator object for Listing
        IL = (ItemList )lg.getItemList( individualID , 1, 10 , "" , "ItemID");//called when the request for the list is for first time

        StringTokenizer st;
        String token, nextItr;
        if (newItemID != null)
        {
          st = new StringTokenizer(newItemID, ",");
          itemLines = (expenseForm).getItemLines();

          if(itemLines == null)
            itemLines = new ItemLines();
          int counter = itemLines.size();
          while (st.hasMoreTokens())
          {
            token   = (String)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);

                ItemElement ie = new ItemElement(0);
                ie.put ("LineId",LineId);
                ie.put ("ItemId",ItemId);
                ie.put ("SKU",SKU);
                ie.put ("Description",Description);
                ie.put ("Quantity",Quantity);
                ie.put ("Price",PriceEach);
                ie.put ("PriceExtended",PriceExtended);

                ie.setLineStatus("New");
                counter += 1;
                itemLines.put(new Integer(counter), ie);
                break;
              }// end of if ( listItemid.intValue() == intToken )
            }// end of while (itr.hasNext())
          }// end of while (st.hasMoreTokens())
          expenseForm.setItemLines(itemLines);
        }// end of if(newItemID != null)
        request.setAttribute("expenseform",expenseForm);
      }// end of else if(typeOfOperation != null && typeOfOperation.equals("ADDITEM") )
      else   if (expenseID == 0)
      {

        expenseForm =  (ExpenseForm) form;

        String projectTitle = (String) request.getParameter("projectTitle");
        String projectID = (String) request.getParameter("projectID");
        if(projectTitle != null && !projectTitle.equals("") && !projectTitle.equals("null")){
          expenseForm.setProject(projectTitle);
        }//end of if(projectTitle != null && !projectTitle.equals("") && !projectTitle.equals("null"))
        if(projectID != null && !projectID.equals("") && !projectID.equals("null")){
          expenseForm.setProjectID(projectID);
        }//end of if(projectID != null && !projectID.equals("") && !projectID.equals("null"))

        String opportunityName = (String) request.getParameter("opportunityName");
        String opportunityID = (String) request.getParameter("opportunityID");
        if(opportunityName != null && !opportunityName.equals("") && !opportunityName.equals("null")){
          expenseForm.setOpportunity(opportunityName);
        }//end of if(opportunityName != null && !opportunityName.equals("") && !opportunityName.equals("null"))
        if(opportunityID != null && !opportunityID.equals("") && !opportunityID.equals("null")){
          expenseForm.setOpportunityID(opportunityID);
        }//end of if(opportunityID != null && !opportunityID.equals("") && !opportunityID.equals("null"))

        expenseForm.convertItemLines();
        request.setAttribute("expenseform", expenseForm);
      }// end of else   if (expenseID == 0)
      else if ((request.getParameter("rowId") != null))
      {

        AccountFacade remote =(AccountFacade)accountFacadeHome.create();
        remote.setDataSource(dataSource);

        ExpenseVO expenseVO = remote.getExpenseVO(expenseID,individualID);

        expenseForm.setExpenseID(expenseID);
View Full Code Here

  public void  deleteElement( int indvID, String key )throws CommunicationException,NamingException
  {
    if (key != null)
    {
      int  paymentID = Integer.parseInt(key);
      AccountFacadeHome accountFacadeHome = (AccountFacadeHome)CVUtility.getHomeObject("com.centraview.account.accountfacade.AccountFacadeHome","AccountFacade");
      try
      {
        AccountFacade remote = (AccountFacade)accountFacadeHome.create();
        remote.setDataSource(this.dataSource);
        remote.deletePayment(paymentID, indvID);
      } catch (Exception e)
      {
        logger.error("[Exception] PaymentList.deleteElement( int indvID, String key )", e);
View Full Code Here

    * @return resultDeleteLog A Collection of the Error Message while deleting a particular record.
    */
  public ArrayList deleteElement(int individualID, String recordID[]) throws CommunicationException,NamingException,RemoteException
  {
    ArrayList resultDeleteLog = new ArrayList();
    AccountFacadeHome accountFacadeHome = (AccountFacadeHome)CVUtility.getHomeObject("com.centraview.account.accountfacade.AccountFacadeHome","AccountFacade");
    try
    {
      //call to EJB server
      AccountFacade remote = (AccountFacade)accountFacadeHome.create();
      remote.setDataSource(this.dataSource);
      for (int i=0; i<recordID.length; i++)
      {
        if(recordID[i] != null && !recordID[i].equals("")){
          int elementID = Integer.parseInt(recordID[i]);
View Full Code Here

    return (mapping.findForward(returnStatus));
  }
 
  public void saveEditOrder(HttpServletRequest req, HttpServletResponse res, OrderForm of, int userId, String dataSource) throws CommunicationException, NamingException
  {
    AccountFacadeHome yy = (AccountFacadeHome)CVUtility.getHomeObject("com.centraview.account.accountfacade.AccountFacadeHome", "AccountFacade");
   
    try {
      AccountFacade remote = (AccountFacade)yy.create();
      remote.setDataSource(dataSource);
     
      int jurisdictionID = 0;
      int billingAddressID = 0;
      if (of.getJurisdictionID() != null && ! ((of.getJurisdictionID()).equals(""))) {
View Full Code Here

  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, CommunicationException, NamingException
  {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
   
    AccountFacadeHome accountFacadeHome = (AccountFacadeHome)CVUtility.getHomeObject("com.centraview.account.accountfacade.AccountFacadeHome", "AccountFacade");
   
    try {
      String listId = (String)request.getAttribute("listId");
      HttpSession session = request.getSession(true);
      UserObject  userobject = (UserObject)session.getAttribute("userobject");
      int individualID = userobject.getIndividualID();
     
      AccountFacade remote = (AccountFacade)accountFacadeHome.create();
      remote.setDataSource(dataSource);
     
      Vector taxJurisdiction = remote.getTaxJurisdiction();
     
      String OrderID = (String)request.getParameter("OrderID");
View Full Code Here

  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, CommunicationException, NamingException
  {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
   
    AccountFacadeHome accountFacadeHome = (AccountFacadeHome)CVUtility.getHomeObject("com.centraview.account.accountfacade.AccountFacadeHome", "AccountFacade");
   
    try {
      HttpSession session = request.getSession(true);
      String orderId = (String)request.getParameter("deleteOrderId");
     
      if (orderId != null || ! orderId.equals("")) {
        UserObject  userobjectd = (UserObject)session.getAttribute( "userobject" );
        int userId = userobjectd.getIndividualID();
        int oid = Integer.parseInt(orderId);
        AccountFacade remote = (AccountFacade)accountFacadeHome.create();
        remote.setDataSource(dataSource);
       
        remote.deleteOrder(oid,userId);
        request.setAttribute(AccountConstantKeys.TYPEOFSUBMODULE, AccountConstantKeys.ORDER);
        request.setAttribute("body", "list");
View Full Code Here

   * @param   key 
   */
  public void  deleteElement( int indvID, String key ) throws CommunicationException,NamingException
  {
    int elementID = Integer.parseInt(key);
    AccountFacadeHome accountFacadeHome=(AccountFacadeHome)CVUtility.getHomeObject("com.centraview.account.accountfacade.AccountFacadeHome","AccountFacade");
    try
    {
      AccountFacade remote =accountFacadeHome.create();
      remote.setDataSource(this.dataSource);
      remote.deleteOrder(elementID,indvID);
    }
    catch(Exception e)
    {
View Full Code Here

    * @return resultDeleteLog A Collection of the Error Message while deleting a particular record.
    */
  public ArrayList deleteElement(int individualID, String recordID[]) throws CommunicationException,NamingException,RemoteException
  {
    ArrayList resultDeleteLog = new ArrayList();
    AccountFacadeHome accountFacadeHome=(AccountFacadeHome)CVUtility.getHomeObject("com.centraview.account.accountfacade.AccountFacadeHome","AccountFacade");
    try
    {
      //call to EJB server
      AccountFacade remote =accountFacadeHome.create();
      remote.setDataSource(this.dataSource);
      for (int i=0; i<recordID.length; i++)
      {
        if(recordID[i] != null && !recordID[i].equals("")){
          int elementID = Integer.parseInt(recordID[i]);
View Full Code Here

TOP

Related Classes of com.centraview.account.accountfacade.AccountFacadeHome

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.