Compare commits
No commits in common. "3808f3daf077d38a9547e05a1d4740421f42a541" and "dedd0dd7835ec8b9e52010a68d532c549d9211d1" have entirely different histories.
3808f3daf0
...
dedd0dd783
@ -1,26 +0,0 @@
|
|||||||
package ru.visionlab.femdemo;
|
|
||||||
|
|
||||||
public class PermissionModel {
|
|
||||||
public String getPermission_code() {
|
|
||||||
return Permission_code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPermission_code(String permission_code) {
|
|
||||||
Permission_code = permission_code;
|
|
||||||
}
|
|
||||||
|
|
||||||
String Permission_NameEN,Permission_code;
|
|
||||||
|
|
||||||
|
|
||||||
public String getPermission_NameEN() {
|
|
||||||
return Permission_NameEN;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setPermission_NameEN(String permission_NameEN) {
|
|
||||||
Permission_NameEN = permission_NameEN;
|
|
||||||
}
|
|
||||||
@Override public String toString() {
|
|
||||||
return this.getPermission_NameEN(); // What to display in the Spinner list.
|
|
||||||
}
|
|
||||||
}
|
|
@ -7,8 +7,6 @@ import android.app.TimePickerDialog;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.PersistableBundle;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
@ -16,7 +14,6 @@ import android.widget.Button;
|
|||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.RelativeLayout;
|
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.TimePicker;
|
import android.widget.TimePicker;
|
||||||
@ -31,7 +28,6 @@ import org.json.JSONArray;
|
|||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@ -58,13 +54,11 @@ public class PermissionRequestActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
String permission_type,permission_code;
|
String permission_type,permission_code;
|
||||||
|
|
||||||
ArrayList<PermissionModel> permission_type_list=new ArrayList<>();
|
String Employeeid,Permission_code_o,Permission_code_p;
|
||||||
ArrayList<String> spinner_array=new ArrayList<>();
|
String fromDate,toDate,fromTime,toTime;
|
||||||
|
|
||||||
// code for Niladri
|
String currentDateandTime;
|
||||||
|
|
||||||
RelativeLayout private_date,official_from_date,official_to_date;
|
|
||||||
String permission_code;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@ -76,10 +70,6 @@ public class PermissionRequestActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
Employeeid = shared.getString("Employeeid", "");
|
Employeeid = shared.getString("Employeeid", "");
|
||||||
|
|
||||||
private_date=findViewById(R.id.private_date);
|
|
||||||
official_from_date=findViewById(R.id.official_from_date);
|
|
||||||
official_to_date=findViewById(R.id.official_to_date);
|
|
||||||
|
|
||||||
IsELeaveApprover();
|
IsELeaveApprover();
|
||||||
//PermissionInsert();
|
//PermissionInsert();
|
||||||
PermissionApprovalList();
|
PermissionApprovalList();
|
||||||
@ -93,33 +83,17 @@ public class PermissionRequestActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
|
|
||||||
spinner = findViewById(R.id.spinner);
|
spinner = findViewById(R.id.spinner);
|
||||||
// ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.spinner_items, android.R.layout.simple_spinner_item);
|
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.spinner_items, android.R.layout.simple_spinner_item);
|
||||||
// adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
// spinner.setAdapter(adapter);
|
spinner.setAdapter(adapter);
|
||||||
|
|
||||||
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parentView, View selectedItemView, int position, long id) {
|
public void onItemSelected(AdapterView<?> parentView, View selectedItemView, int position, long id) {
|
||||||
// Handle the selected item here
|
// Handle the selected item here
|
||||||
PermissionModel permissionModel=(PermissionModel) parentView.getSelectedItem();
|
permission_type = parentView.getItemAtPosition(position).toString();
|
||||||
Log.d("code",permissionModel.Permission_code);
|
System.out.println("Value of permission_type "+permission_type);
|
||||||
|
|
||||||
|
|
||||||
// Do something with the selected item
|
// Do something with the selected item
|
||||||
|
|
||||||
|
|
||||||
if (permissionModel.Permission_code.toUpperCase().equals("O"))
|
|
||||||
{
|
|
||||||
official_from_date.setVisibility(View.VISIBLE);
|
|
||||||
official_to_date.setVisibility(View.VISIBLE);
|
|
||||||
private_date.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
official_from_date.setVisibility(View.GONE);
|
|
||||||
official_to_date.setVisibility(View.GONE);
|
|
||||||
private_date.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -128,13 +102,6 @@ public class PermissionRequestActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
private_date.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
back = findViewById(R.id.back);
|
back = findViewById(R.id.back);
|
||||||
back.setOnClickListener(new View.OnClickListener() {
|
back.setOnClickListener(new View.OnClickListener() {
|
||||||
@ -446,15 +413,28 @@ public class PermissionRequestActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
String url= "http://43.242.212.92:7001/api/lgt/PermissionTypes";
|
String url= "http://43.242.212.92:7001/api/lgt/PermissionTypes";
|
||||||
StringRequest stringRequest=new StringRequest(Request.Method.GET, url, new com.android.volley.Response.Listener<String>() {
|
StringRequest stringRequest=new StringRequest(Request.Method.GET, url, new com.android.volley.Response.Listener<String>() {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(String response) {
|
public void onResponse(String response) {
|
||||||
|
|
||||||
Toast.makeText(PermissionRequestActivity.this, "Response successful2", Toast.LENGTH_SHORT).show();
|
Toast.makeText(PermissionRequestActivity.this, "Response successful2", Toast.LENGTH_SHORT).show();
|
||||||
|
try {
|
||||||
|
JSONArray jsonArray = new JSONArray(response);
|
||||||
|
for (int i = 0;i< jsonArray.length();i++){
|
||||||
|
JSONObject jb1=jsonArray.getJSONObject(i);
|
||||||
|
permission_code=jb1.getString("Permission_code");
|
||||||
|
if(permission_code.equals("P"))
|
||||||
|
{
|
||||||
|
permission_code="P";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
permission_code="O";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (JSONException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
loading.dismiss();
|
loading.dismiss();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}, new com.android.volley.Response.ErrorListener() {
|
}, new com.android.volley.Response.ErrorListener() {
|
||||||
|
@ -9,17 +9,6 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="23dp">
|
android:padding="23dp">
|
||||||
|
|
||||||
<ScrollView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/lin1"
|
android:id="@+id/lin1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -47,6 +36,9 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/linearLayout1"
|
android:id="@+id/linearLayout1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -149,74 +141,6 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/private_date"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="45dp"
|
|
||||||
android:layout_marginLeft="14dp"
|
|
||||||
android:layout_marginRight="14dp"
|
|
||||||
android:background="@drawable/bg_button_time"
|
|
||||||
android:layout_marginTop="25dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="Date"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:paddingLeft="135dp"
|
|
||||||
android:textSize="17sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/official_from_date"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="45dp"
|
|
||||||
android:layout_marginLeft="14dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_marginRight="14dp"
|
|
||||||
android:background="@drawable/bg_button_time"
|
|
||||||
android:layout_marginTop="25dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="From Date"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:paddingLeft="135dp"
|
|
||||||
android:textSize="17sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/official_to_date"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="45dp"
|
|
||||||
android:layout_marginLeft="14dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_marginRight="14dp"
|
|
||||||
android:background="@drawable/bg_button_time"
|
|
||||||
android:layout_marginTop="25dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="To Date"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:paddingLeft="135dp"
|
|
||||||
android:textSize="17sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -284,14 +208,12 @@
|
|||||||
android:id="@+id/edtRemarks"
|
android:id="@+id/edtRemarks"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="80dp"
|
android:layout_height="80dp"
|
||||||
android:padding="10dp"
|
|
||||||
android:background="@drawable/edittext_border"
|
android:background="@drawable/edittext_border"
|
||||||
android:layout_marginLeft="14dp"
|
android:layout_marginLeft="14dp"
|
||||||
android:layout_marginRight="14dp"
|
android:layout_marginRight="14dp"
|
||||||
android:layout_marginTop="30dp"
|
android:layout_marginTop="30dp"
|
||||||
android:hint="Remarks"
|
android:hint="Remarks"
|
||||||
|
android:gravity="center"/>
|
||||||
android:gravity="left"/>
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btnSubmit"
|
android:id="@+id/btnSubmit"
|
||||||
@ -299,12 +221,11 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="14dp"
|
android:layout_marginLeft="14dp"
|
||||||
android:layout_marginRight="14dp"
|
android:layout_marginRight="14dp"
|
||||||
android:layout_marginTop="100dp"
|
android:layout_marginTop="210dp"
|
||||||
android:background="@drawable/bg_btn_with_stroke"
|
android:background="@drawable/bg_btn_with_stroke"
|
||||||
android:text="Submit"
|
android:text="Submit"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
|
||||||
</ScrollView>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
Loading…
x
Reference in New Issue
Block a user