Professional Documents
Culture Documents
findViews();
// checkAvailableJson(lab_code);
btnSync();
textChange();
SQLiteDatabase db = DataBaseSQlite.connectToDb(context);
try {
if (cur.getCount() == 1) {
while (cur.moveToNext()) {
jsonRetrived = cur.getString(cur.getColumnIndex("lab_certifications_info"));
} else {
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(this, "Exception: " + e.getCause(), Toast.LENGTH_LONG).show();
} finally {
db.close();
helper.TextChangeListenerLooper(extra_staff_container);
try {
toolbar.setTitle("Certifications");
// toolbar.setSubtitle(lab_code+" ("+lab_name+")");
setSupportActionBar(toolbar);
} catch (Exception e) {
e.printStackTrace();
sendSave.setOnClickListener(this);
}
public void btnSync() {
try {
fetchMISdata();
} catch (Exception e) {
e.printStackTrace();
SQLiteDatabase db = DataBaseSQlite.connectToDb(context);
try {
String query = "SELECT distinct lab_certifications_info from tbl_lab_details where lab_code = '" +
lab_code + "'";
if (count == 1) {
while (cur.moveToNext()) {
stringArrayList.add(cur.getString(cur.getColumnIndex("lab_certifications_info")));
} else {
arrSyncData.clear();
for (int i3 = 0; i3 < stringArrayList.size(); i3++) {
try {
if (jsonResponse.getString("response").equalsIgnoreCase("true")) {
verticalData.setCategory(jsonObject.getString("category"));
verticalData.setScore(jsonObject.getInt("score"));
usersModel.setCertification_lab_code(jsonDetailedObject.getString("certification_lab_code"));
usersModel.setUser_login(jsonDetailedObject.getString("user_login"));
usersModel.setCertification_type(jsonDetailedObject.getString("certification_type"));
usersModel.setOther_certification(jsonDetailedObject.getString("other_certification"));
usersModel.setCategory(jsonDetailedObject.getString("category"));
usersModel.setIssuance_date(jsonDetailedObject.getString("issuance_date"));
usersModel.setExpiry_date(jsonDetailedObject.getString("expiry_date"));
rPData.add(usersModel);
verticalData.setPublicationDetail(rPData);
arrSyncData.add(verticalData);
} else {
hidepDialogFetch();
} catch (Exception e) {
hidepDialogFetch();
Log.d("touch", "paste");
qualificationHeading.setText(catType.toUpperCase());
String TagString = catType.toLowerCase().replace(" ", "_");
rg_meeting_requirements.setTag("rg_cert_meeting---" + catType);
et_comment.setTag("et_cert_comment---" + catType);
et_score.setTag("et_cert_score---" + catType);
// rg_meeting_requirements.setTag("rg_cert_meeting_" + TagString);
// et_comment.setTag("et_cert_comment_" + TagString);
// et_score.setTag("et_cert_score_" + TagString);
package com.uu.epd_lir;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.design.widget.TextInputLayout;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import com.uu.epd_lir.database.DataBaseSQlite;
import com.uu.epd_lir.database.Querries;
import com.uu.epd_lir.helper.Helper;
import com.uu.epd_lir.helper.SeterGeter;
import com.uu.epd_lir.model.DataModels.CertificationsData;
import com.uu.epd_lir.model.ReceivedDetails.receivedCertificationsDetails;
import org.apache.http.conn.HttpHostConnectException;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.Iterator;
LayoutInflater inflater;
@Override
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_lir_certifications);
context = this;
helper = new Helper(context);
lab_code = intent.getExtras().getString("lab_code");
lab_name = intent.getExtras().getString("lab_name");
pk_id = intent.getExtras().getInt("pk_id");
progressDialog.setCancelable(false);
findViews();
// checkAvailableJson(lab_code);
btnSync();
textChange();
SQLiteDatabase db = DataBaseSQlite.connectToDb(context);
try {
if (cur.getCount() == 1) {
while (cur.moveToNext()) {
jsonRetrived = cur.getString(cur.getColumnIndex("lab_certifications_info"));
} else {
} catch (Exception e) {
e.printStackTrace();
} finally {
db.close();
helper.TextChangeListenerLooper(extra_staff_container);
try {
toolbar.setTitle("Certifications");
// toolbar.setSubtitle(lab_code+" ("+lab_name+")");
setSupportActionBar(toolbar);
} catch (Exception e) {
e.printStackTrace();
sendSave.setOnClickListener(this);
try {
fetchMISdata();
} catch (Exception e) {
e.printStackTrace();
SQLiteDatabase db = DataBaseSQlite.connectToDb(context);
try {
String query = "SELECT distinct lab_certifications_info from tbl_lab_details where lab_code = '" +
lab_code + "'";
if (count == 1) {
while (cur.moveToNext()) {
stringArrayList.add(cur.getString(cur.getColumnIndex("lab_certifications_info")));
} else {
arrSyncData.clear();
try {
if (jsonResponse.getString("response").equalsIgnoreCase("true")) {
verticalData.setCategory(jsonObject.getString("category"));
verticalData.setScore(jsonObject.getInt("score"));
usersModel.setId(jsonDetailedObject.getInt("id"));
Iterator a = gsonObject.keys();
while (a.hasNext()) {
try {
} catch (JSONException e) {
e.printStackTrace();
}
part1 = parts[0];
part2 = parts[1];
if (part2.equalsIgnoreCase(catType)) {
String[] a1 = part1.split("_");
if (subPart1.equalsIgnoreCase("rg")) {
if (subPart3.equalsIgnoreCase("meeting")) {
if(value.equalsIgnoreCase("Yes")){
rg_meeting_requirements.check(R.id.rb_yes_meeting_requirements);
}else if(value.equalsIgnoreCase("No")){
rg_meeting_requirements.check(R.id.rb_no_meeting_requirements);
} else if (subPart1.equalsIgnoreCase("et")) {
if (subPart3.equalsIgnoreCase("comment")) {
et_comment.setText(value);
}else if (subPart3.equalsIgnoreCase("score")) {
et_score.setText(value);
}
Log.d("touch", "key :" + key);
rg_meeting_requirements.setOnCheckedChangeListener(new
RadioGroup.OnCheckedChangeListener() {
@Override
rbb.setError(null);
});
LayoutInflater layoutInflater2;
View subView;
Log.d("touch", "inner");
layoutInflater2 = (LayoutInflater)
context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// if (catType.equalsIgnoreCase("Other")) {
// title.setVisibility(View.VISIBLE);
// titleValue.setVisibility(View.VISIBLE);
titleValue.setText(staffDetails.get(j).getOther_certification().toString());
// } else {
//
// title.setVisibility(View.GONE);
// titleValue.setVisibility(View.GONE);
// }
categoryValue.setText(staffDetails.get(j).getCategory().toString());
issueValue.setText(staffDetails.get(j).getIssuance_date().toString());
expiryValue.setText(staffDetails.get(j).getExpiry_date().toString());
staffDetailedContainer.addView(subView);
}
extra_staff_container.addView(addView);
hidepDialogFetch();
} catch (Exception e) {
e.printStackTrace();
} finally {
db.close();
if (!progressDialog.isShowing())
progressDialog.show();
if (progressDialog.isShowing())
progressDialog.dismiss();
edEmptyCheck = true;
for (int j = 0; j < extra_staff_container.getChildCount(); j++) {
getAllLayouts(r1);
EditText et = til.getEditText();
if (et.getVisibility() == VISIBLE) {
if (!(et.getId() == R.id.et_remarks)) {
if (helper.isEmpty(et)) {
edEmptyCheck = false;
til.setErrorEnabled(true);
} else {
try {
json.put(et.getTag().toString(), et.getText().toString());
til.setErrorEnabled(false);
til.setError(null);
} catch (JSONException e) {
e.printStackTrace();
} else {
try {
if (helper.isEmpty(et)) {
json.put(et.getTag().toString(), "NA");
} else {
json.put(et.getTag().toString(), et.getText().toString());
} catch (JSONException e) {
e.printStackTrace();
} else {
try {
json.put(et.getTag().toString(), "NA");
} catch (JSONException e) {
e.printStackTrace();
if (!(chk.getCheckedRadioButtonId() == -1)) {
try {
json.put(chk.getTag().toString(), rb.getText().toString());
} catch (Exception e) {
e.printStackTrace();
} else {
rbb.setError("Check Anyone");
radioOk = false;
} else {
try {
json.put(chk.getTag().toString(), "NA");
} catch (Exception e) {
e.printStackTrace();
@Override
getMenuInflater().inflate(R.menu.save_report, menu);
return true;
@Override
if (item.getItemId() == R.id.save) {
functionSendDataFinal();
return super.onOptionsItemSelected(item);
@Override
if (v.getId() == sendSave.getId()) {
functionSendDataFinal();
try {
radioOk = true;
getdata();
if (edEmptyCheck) {
if (radioOk) {
send();
} else {
}
} else {
} catch (Exception e) {
e.printStackTrace();
@Override
new AlertDialog.Builder(this)
.setTitle("Exit!")
.setCancelable(false)
@Override
LabCertificationsInfo.super.onBackPressed();
})
.setNegativeButton("No", null)
.show();
try {
SeterGeter.setCertificationJson(json.toString());
Log.d("touch", json.toString());
if (!(json.toString().length() == 0)) {
if (id) {
imm.hideSoftInputFromWindow(surveyForm.getWindowToken(), 0);
LabCertificationsInfo.super.onBackPressed();
} else {
} else {
} catch (Exception e) {