Examples of Center


Examples of gwtappcontainer.shared.apps.insight.Center

        if (centerId == 0)
          sql = "select center_id, center from centers where center = ?";
        else
          sql = "select center_id, center from centers where center_id = ?";
          
            Center center = null;
          
            try (Connection connection = DriverManager.getConnection(Utils.getCloudSqlURL())) {
                  
                try (PreparedStatement ps = connection.prepareStatement(sql)) {
                   
                  if (centerId == 0)
                    ps.setString(1, centerName.toLowerCase());
                  else
                    ps.setLong(1, centerId);
                  
                    try (ResultSet resultSet = ps.executeQuery()) {                                       
                        while (resultSet.next()) {
                            center = new Center();
                            center.id = resultSet.getInt(1);
                            center.name = resultSet.getString(2);
                        }
                    }
                }
View Full Code Here

Examples of gwtappcontainer.shared.apps.insight.Center

               
                 ps.executeUpdate();                                   
             }
         }
       
         Center center = get(centerName);       
         return center;
           
     } catch (Exception ex) {
         throw new RuntimeException(ex);
     }             
View Full Code Here

Examples of gwtappcontainer.shared.apps.insight.Center

     }             
   }

  public static void delete(String centerName) {
        
       Center center = get(centerName);
     
       if (null == center)
           throw new APIException(Status.ERROR_RESOURCE_DOES_NOT_EXIST,
                           "Center [" + centerName + "] does not exist");
                                             
View Full Code Here

Examples of gwtappcontainer.shared.apps.insight.Center

                            
              try (PreparedStatement ps = connection.prepareStatement(sql)) {                                     
                
                  try (ResultSet resultSet = ps.executeQuery()) {                                       
                      while (resultSet.next()) {
                          Center center = new Center();
                          center.id = resultSet.getInt(1);
                          center.name = resultSet.getString(2);
                         
                          centers.add(center);
                      }
View Full Code Here

Examples of gwtappcontainer.shared.apps.insight.Center

            try (PreparedStatement ps = connection.prepareStatement(sql)) {  
              ps.setLong(1, member.id);
              
                try (ResultSet resultSet = ps.executeQuery()) {                                       
                    while (resultSet.next()) {
                       Center center = new Center();
                       center.id = resultSet.getInt(1);
                       center.name = resultSet.getString(2);
                      
                       boolean owningCenter = resultSet.getBoolean(3);
                       if (owningCenter)
View Full Code Here

Examples of gwtappcontainer.shared.apps.insight.Center

    helper.tearDown();
  }
 
  @Test
  public void getTest() {
    Center sgp = CenterRepository.add("singapore");
   
    ContactDetails contactDetails = new ContactDetails();
    contactDetails.firstName = "sathya";
    contactDetails.email = "sathya.t@ishafoundation.org";
   
    MemberRepository.add(contactDetails, sgp.id, SUPER_USER);
   
    Member member = MemberRepository.get("sathya.t@ishafoundation.org", "sathya.t@ishafoundation.org");
       
    assertTrue(member != null);
    assertTrue(member.id != 0);
    assertTrue(member.contactDetails.firstName.equals("sathya"));
    assertTrue(member.contactDetails.email.equals("sathya.t@ishafoundation.org"));
    assertTrue(member.owningCenter.id == sgp.id);
    assertTrue(member.owningCenter.name.equals("singapore"));
   
    //cannot get by non existant email or id
    assertTrue(null == MemberRepository.get("nonexistant@email.com", SUPER_USER));
    assertTrue(null == MemberRepository.get(1093890, SUPER_USER));
   
    Center penang = CenterRepository.add("penang");
    Center kl = CenterRepository.add("kl");
    MemberRepository.addCenter(member.id, penang.id, USER_WITH_EDITMEMBER_PRIVILEGE);
    MemberRepository.addCenter(member.id, kl.id, USER_WITH_EDITMEMBER_PRIVILEGE);
   
    member = MemberRepository.get(member.id, SUPER_USER);
    assertTrue(member.id != 0);
View Full Code Here

Examples of gwtappcontainer.shared.apps.insight.Center

    member = MemberRepository.get("sathya.t@ishafoundation.org", "sathya.t@ishafoundation.org");
  }
 
  @Test
  public void addTest() {
    Center sgp = CenterRepository.add("singapore");
   
    ContactDetails contactDetails = new ContactDetails();
    contactDetails.firstName = "sathya";   
    contactDetails.email = "invalid email";
   
View Full Code Here

Examples of gwtappcontainer.shared.apps.insight.Center

    //no exception
  }
 
  @Test
  public void updateContactDetailsTest() {
    Center sgp = CenterRepository.add("singapore");
   
    ContactDetails contactDetails = new ContactDetails();
    contactDetails.firstName = "sathya";
    contactDetails.email = "sathya.isha@gmail.com";       
   
View Full Code Here

Examples of gwtappcontainer.shared.apps.insight.Center

  }
 
  @Test
  public void addCenterTest() {
    CenterRepository.add("sgp");
    Center sgp = CenterRepository.get("sgp");
    CenterRepository.add("kl");
    Center kl = CenterRepository.get("kl");
    CenterRepository.add("penang");
    Center penang = CenterRepository.get("penang");
   
    ContactDetails contactDetails = new ContactDetails();
    contactDetails.firstName = "sathya";
    contactDetails.email = "sathya.t@ishafoundation.org";
   
View Full Code Here

Examples of gwtappcontainer.shared.apps.insight.Center

 
  @Test
  public void deleteCenterTest() {

    CenterRepository.add("singapore");
    Center sgp = CenterRepository.get("singapore");
    CenterRepository.add("kl");
    Center kl = CenterRepository.get("kl");
    CenterRepository.add("penang");
    Center penang = CenterRepository.get("penang");
   
    ContactDetails contactDetails = new ContactDetails();
    contactDetails.firstName = "sathya";   
    contactDetails.email = "sathya.t@ishafoundation.org";
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.