Exemplo n.º 1
0
 private void delete() {
   EmailLoggerDM emaillogDM = new EmailLoggerDM();
   tblMstScrSrchRslt.setSelectable(true);
   if (tblMstScrSrchRslt.getValue() != null) {
     emaillogDM = beanEmailLoggerDM.getItem(tblMstScrSrchRslt.getValue()).getBean();
     Long logid = emaillogDM.getEmaillogId();
     serviceemailLogger.delete(logid);
     resetFields();
     loadSrchRslt();
   }
 }
Exemplo n.º 2
0
 // get the search result from DB based on the search parameters
 public void loadSrchRslt() {
   logger.info(
       "Company ID : " + companyid + " | User Name : " + username + " > " + "Loading Search...");
   tblMstScrSrchRslt.removeAllItems();
   Long prodname = null;
   if (cbproduct.getValue() != null) {
     prodname = ((Long) cbproduct.getValue());
   }
   String stdate = null;
   if (dfemailStartdate.getValue() != null) {
     stdate = (DateUtils.datetostring(dfemailStartdate.getValue()));
   }
   String enddate = null;
   if (dfemailEndDate.getValue() != null) {
     enddate = (DateUtils.datetostring(dfemailEndDate.getValue()));
   }
   emailList =
       serviceemailLogger.getEmailLoggerList(
           companyid, userId, prodname, tfemailid.getValue(), stdate, enddate);
   recordCnt = emailList.size();
   if (cockeckall.getValue().equals(true)) {
     List<EmailLoggerDM> mylist = new ArrayList<EmailLoggerDM>();
     for (EmailLoggerDM obj : emailList) {
       obj.setSelected(true);
       mylist.add(obj);
     }
     beanEmailLoggerDM = new BeanItemContainer<EmailLoggerDM>(EmailLoggerDM.class);
     beanEmailLoggerDM.addAll(mylist);
   } else {
     List<EmailLoggerDM> mylist = new ArrayList<EmailLoggerDM>();
     for (EmailLoggerDM obj : emailList) {
       obj.setSelected(false);
       mylist.add(obj);
     }
     beanEmailLoggerDM = new BeanItemContainer<EmailLoggerDM>(EmailLoggerDM.class);
     beanEmailLoggerDM.addAll(mylist);
   }
   tblMstScrSrchRslt.setContainerDataSource(beanEmailLoggerDM);
   tblMstScrSrchRslt.setSelectable(true);
   logger.info(
       "Company ID : "
           + companyid
           + " | User Name : "
           + username
           + " > "
           + "Got the UserFav result set");
   tblMstScrSrchRslt.setContainerDataSource(beanEmailLoggerDM);
   tblMstScrSrchRslt.setVisibleColumns(
       new Object[] {
         "emaillogId",
         "productName",
         "clintnam",
         "emailid",
         "emailDate",
         "emailSubject",
         "quoteRef",
       });
   tblMstScrSrchRslt.setColumnHeaders(
       new String[] {
         "Ref.Id",
         "Product Name",
         "Client Name",
         "Email Id",
         "Email Date",
         "Email Subject",
         "Quote Ref.No"
       });
   tblMstScrSrchRslt.setColumnAlignment("emailid", Align.LEFT);
   tblMstScrSrchRslt.setColumnFooter("quoteRef", "No.of Records : " + recordCnt);
 }