Android Open Source - chat.android C H A Accessed






From Project

Back to project page chat.android.

License

The source code is released under:

GNU General Public License

If you think the Android project chat.android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.chat.android.models;
/*  w  w  w .  j  a v a  2  s.  c  om*/
import java.util.Date;

import org.chat.android.DatabaseHelper;
import org.chat.android.ModelHelper;
import org.chat.android.MyApplication;

import android.content.Context;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

/**
 * Created by colin
 */
@DatabaseTable(tableName = "cha_accessed")
public class CHAAccessed {
  @DatabaseField(id = true)
  private int id;
    @DatabaseField
    private int client_id;
    @DatabaseField
    private int visit_id;
    @DatabaseField
    private String type;              // will be either health or immunization
    @DatabaseField
    private Date start_time;
    @DatabaseField
    private Date end_time;

    /**
     * Default Constructor needed by ormlite
     */
    public CHAAccessed() {
    }

    /**
     * Constructor that instantiates the private member variable(s)
     * @param client_id
     * @param visit_id
     * @param type
     * @param start_time
     * 
     */
    public CHAAccessed(int client_id, int visit_id, String type, Date start_time, DatabaseHelper dbHelper) {
      Context myContext = MyApplication.getAppContext();
        Visit v = ModelHelper.getVisitForId(dbHelper, visit_id);
        ModelHelper.setVisitToDirtyAndSave(dbHelper, v);
        this.id = ModelHelper.generateId(myContext);
        this.client_id = client_id;
      this.visit_id = visit_id;
      this.visit_id = visit_id;
      this.type = type;
      this.start_time = start_time;
    }
    
    /**
     * Copy constructor
     * @param existingListModel - List model instance that is copied to new instance
     */
    public CHAAccessed(CHAAccessed existingServicesAccessedModel) {
        this.client_id = existingServicesAccessedModel.client_id;
        this.visit_id = existingServicesAccessedModel.visit_id;
        this.type = existingServicesAccessedModel.type;
        this.start_time = existingServicesAccessedModel.start_time;
        this.end_time = existingServicesAccessedModel.end_time;
    }

  public int getClientId() {
    return client_id;
  }
  
  public void setClientId(int client_id) {
    this.client_id = client_id;
  }  
  
  public int getVisitId() {
    return visit_id;
  }
  
  public void setVisitId(int visit_id) {
    this.visit_id = visit_id;
  }
  
  public String getType() {
    return type;
  }
  
  public void setType(String type) {
    this.type = type;
  }
  
  public Date getStartTime() {
    return start_time;
  }

  public void setStartTime(Date start_time) {
    this.start_time = start_time;
  }
  
  public Date getEndTime() {
    return end_time;
  }

  public void setEndTime(Date end_time, DatabaseHelper databaseHelper) {
    this.end_time = end_time;
//    Context myContext = MyApplication.getAppContext();
        Visit v = ModelHelper.getVisitForId(databaseHelper, this.visit_id);
        ModelHelper.setVisitToDirtyAndSave(databaseHelper, v);
  }
  
}




Java Source Code List

org.chat.android.BaseActivity.java
org.chat.android.CHADelivery.java
org.chat.android.CHAOverviewActivity.java
org.chat.android.CHASelectChildActivity.java
org.chat.android.CHASelectChildAdapter.java
org.chat.android.ChatUtil.java
org.chat.android.ClientsAdapter.java
org.chat.android.DatabaseHelper.java
org.chat.android.GPSTracker.java
org.chat.android.HealthDeliveryActivity.java
org.chat.android.HealthDetailsActivity.java
org.chat.android.HealthOverviewActivity.java
org.chat.android.HealthOverviewRecordActivity.java
org.chat.android.HomeActivity.java
org.chat.android.ImmunizationsReceivedActivity.java
org.chat.android.ImmunizationsSummaryActivity.java
org.chat.android.LoginActivity.java
org.chat.android.Mail.java
org.chat.android.ModelHelper.java
org.chat.android.MyApplication.java
org.chat.android.ResourcesActivity.java
org.chat.android.RestoreVisitActivity.java
org.chat.android.ServiceDeliveryActivity.java
org.chat.android.ServiceDeliveryAdapter.java
org.chat.android.ServiceDetailsActivity.java
org.chat.android.ServiceOtherActivity.java
org.chat.android.ServiceOverviewActivity.java
org.chat.android.ServicesAdapter.java
org.chat.android.SetupDB.java
org.chat.android.SetupVisitActivity.java
org.chat.android.SyncResourcesActivity.java
org.chat.android.Auth.AccountGeneral.java
org.chat.android.Auth.AuthenticatorService.java
org.chat.android.Auth.Authenticator.java
org.chat.android.Auth.ChatAuthServerAuthenticate.java
org.chat.android.Auth.MainActivity.java
org.chat.android.Auth.ServerAuthenticate.java
org.chat.android.Sync.StubProvider.java
org.chat.android.Sync.SyncAdapter.java
org.chat.android.Sync.SyncService.java
org.chat.android.Sync.provider.ChatContentProvider.java
org.chat.android.models.Attendance.java
org.chat.android.models.CHAAccessed.java
org.chat.android.models.Client.java
org.chat.android.models.HealthPage.java
org.chat.android.models.HealthSelectRecorded.java
org.chat.android.models.HealthSelect.java
org.chat.android.models.HealthTheme.java
org.chat.android.models.HealthTopicAccessed.java
org.chat.android.models.HealthTopic.java
org.chat.android.models.Household.java
org.chat.android.models.PageAssessment1.java
org.chat.android.models.PageSelect1.java
org.chat.android.models.PageText1.java
org.chat.android.models.PageVideo1.java
org.chat.android.models.ResourceAccessed.java
org.chat.android.models.Resource.java
org.chat.android.models.Role.java
org.chat.android.models.ServiceAccessed.java
org.chat.android.models.Service.java
org.chat.android.models.TopicVideo.java
org.chat.android.models.Util.java
org.chat.android.models.VaccineRecorded.java
org.chat.android.models.Vaccine.java
org.chat.android.models.VideoAccessed.java
org.chat.android.models.Video.java
org.chat.android.models.Visit.java
org.chat.android.models.Worker.java
org.chat.android.pages.Assessment1Fragment.java
org.chat.android.pages.BaseFragment.java
org.chat.android.pages.ReferralFragment.java
org.chat.android.pages.Select1Fragment.java
org.chat.android.pages.Text1Fragment.java
org.chat.android.pages.Video1Fragment.java