Package com.agendabeleza.models

Examples of com.agendabeleza.models.CompanyModel


    System.out.println("Agent started");

    // load all az_data
    System.out.println("Loading all AZ DATA");

    company = new CompanyModel();
    company.setAzId("C81E0CAC-90C8-4D14-9B66-F2D8A6DF3083");
    company.setAzCalendarInterval(30);
    company.setName("Empresa teste");
    company.setAddress("Rua: nome da rua");
    company.setAddressNumber("numero");
View Full Code Here


public class SyncController {

  public boolean existsOnHeroku(CompanyModel pCompanyModel) {

    HerokuClient client = new HerokuClient(Heroku.HOST + Heroku.COMPANY_SERVICES + pCompanyModel.getAzId());
    CompanyModel tCompany;

    try {
      tCompany = (CompanyModel) client.request(CompanyModel.class);
      if (tCompany.getId() == null) {
        return false;
      } else {
        pCompanyModel.setId(tCompany.getId());
        return true;
      }
    } catch (HerokuException e) {
      System.err.println("resposta nula");
      return false;
View Full Code Here

  }

  public boolean createOnHeroku(CompanyModel pCompanyModel) {

    HerokuClient client = new HerokuClient(Heroku.HOST + Heroku.COMPANY_SERVICES);
    CompanyModel tCompany;

    try {
      client.setMethod(HerokuClient.POST);
      client.setParamsFromObject(pCompanyModel);
      tCompany = (CompanyModel) client.request(CompanyModel.class);

      if (tCompany.getId() == null) {
        return false;
      } else {
        pCompanyModel.setId(tCompany.getId());
        return true;
      }
    } catch (HerokuException e) {
      System.err.println("resposta nula");
      return false;
View Full Code Here

TOP

Related Classes of com.agendabeleza.models.CompanyModel

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.