private boolean isTermsCheck() {
   if (su_terms_checkbox.isChecked()) {
     return true;
   } else {
     AlertDialogHelper.showAlert(context, "PLease Check Terms And Condition");
     return false;
   }
 }
  private boolean isPasswodOK() {
    if (su_password
        .getText()
        .toString()
        .trim()
        .equalsIgnoreCase(su_confirmpassword.getText().toString().trim())) {

      return true;
    } else {
      AlertDialogHelper.showAlert(context, "Password Not Match");
      return false;
    }
  }
 @Override
 protected void onPostExecute(String result) {
   super.onPostExecute(result);
   try {
     JSONObject jsonObject = new JSONObject(results);
     if (jsonObject.getString("status").equalsIgnoreCase("true")) {
       progressDialog.dismiss();
       finish();
       Toast.makeText(context, jsonObject.getString("message"), Toast.LENGTH_SHORT).show();
       Intent intent = new Intent(RegistgrationActivity.this, LoginActivity.class);
       startActivity(intent);
     } else {
       progressDialog.dismiss();
       AlertDialogHelper.showAlert(context, jsonObject.getString("message"));
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
  public boolean isRequired() {

    if (su_email.getText().toString().trim().length() == 0) {
      AlertDialogHelper.showAlert(context, getResources().getString(R.string.req_email));
      su_email.setError(getResources().getString(R.string.req_email));
      return false;
    }
    su_email.setError(null);
    if (su_password.getText().toString().trim().length() == 0) {
      AlertDialogHelper.showAlert(context, getResources().getString(R.string.req_password));
      su_password.setError(getResources().getString(R.string.req_password));
      return false;
    }
    su_password.setError(null);
    if (su_confirmpassword.getText().toString().trim().length() == 0) {
      AlertDialogHelper.showAlert(context, getResources().getString(R.string.req_confirm_password));
      su_confirmpassword.setError(getResources().getString(R.string.req_confirm_password));
      return false;
    }
    su_confirmpassword.setError(null);
    if (su_firstname.getText().toString().trim().length() == 0) {
      AlertDialogHelper.showAlert(
          context, getResources().getString(R.string.req_firstname).toString());
      su_firstname.setError(getResources().getString(R.string.req_firstname).toString());
      return false;
    }
    su_firstname.setError(null);
    if (su_lastname.getText().toString().trim().length() == 0) {
      AlertDialogHelper.showAlert(context, getResources().getString(R.string.req_lastname));
      su_lastname.setError(getResources().getString(R.string.req_lastname));
      return false;
    }
    su_lastname.setError(null);
    if (su_courses.getText().toString().trim().length() == 0) {
      AlertDialogHelper.showAlert(context, getResources().getString(R.string.req_course));
      su_courses.setError(getResources().getString(R.string.req_course));
      return false;
    }
    su_courses.setError(null);

    if (su_sex.getText().toString().trim().length() == 0) {
      AlertDialogHelper.showAlert(context, "Mention Sex");
      su_sex.setError("Mention Sex");
      return false;
    }
    su_sex.setError(null);

    if (su_birthday.getText().toString().trim().length() == 0) {
      AlertDialogHelper.showAlert(context, "Date of birth Required");
      su_birthday.setError("Date of birth Required");
      return false;
    }
    su_birthday.setError(null);

    if (su_city.getText().toString().trim().length() == 0) {
      AlertDialogHelper.showAlert(context, "City Required");
      su_city.setError("City Required");
      return false;
    }
    su_city.setError(null);
    if (su_postcode.getText().toString().trim().length() == 0) {
      AlertDialogHelper.showAlert(context, "Post Code Required");
      su_postcode.setError("Post Code Required");
      return false;
    }
    su_postcode.setError(null);
    if (su_country.getText().toString().trim().length() == 0) {
      AlertDialogHelper.showAlert(context, "Country Required");
      su_country.setError("Country Required");
      return false;
    }
    su_country.setError(null);
    if (su_address.getText().toString().trim().length() == 0) {
      AlertDialogHelper.showAlert(context, "Address required");
      su_address.setError("Address required");
      return false;
    }
    su_address.setError(null);

    if (su_phone.getText().toString().trim().length() == 0) {
      AlertDialogHelper.showAlert(context, "Phone required");
      su_phone.setError("Phone required");
      return false;
    }
    su_phone.setError(null);

    return true;
  }