package com.realnet.angulardatatype.Services;
import java.util.*;
import com.realnet.testdata.Repository.DistrictRepository;
import com.realnet.testdata.Entity.District;

import com.realnet.angulardatatype.Entity.District_ListFilter1;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
	import org.springframework.stereotype.Service;

@Service
 public class District_ListFilter1Service {
@Autowired
private DistrictRepository Repository;




 public   List<District_ListFilter1>   getlistbuilder() {
	List<District> list= Repository.findAll();
		ArrayList<District_ListFilter1> l = new ArrayList<>();
		for (District data : list) {
Boolean isActive = data.getActive();

				if (Boolean.TRUE.equals(isActive)) {String State_name = data.getState_name();
 System.out.println(State_name + "\n");

			if ("item".equals(State_name)){	
District_ListFilter1 dummy = new District_ListFilter1();
			dummy.setId(data.getId());
  dummy.setDistrict_name(data.getDistrict_name());
	l.add(dummy);
}} 
} 		
return l;}



 public   List<District_ListFilter1>   getlistbuilderparam(  String item) {
	List<District> list= Repository.findAll();
		ArrayList<District_ListFilter1> l = new ArrayList<>();
		for (District data : list) {
Boolean isActive = data.getActive();

				if (Boolean.TRUE.equals(isActive)) {String State_name = data.getState_name();
 System.out.println(State_name + "\n");

			if (item.equals(State_name)){	
District_ListFilter1 dummy = new District_ListFilter1();
			dummy.setId(data.getId());
  dummy.setDistrict_name(data.getDistrict_name());
	l.add(dummy);
}} 
} 		
return l;}
}