build_app

This commit is contained in:
2026-04-08 05:34:41 +00:00
parent d6434951f9
commit b4b9c778a6
121 changed files with 18166 additions and 121 deletions

View File

@@ -80,6 +80,36 @@ public class BuilderService {
// } // }
// ADD OTHER SERVICE // ADD OTHER SERVICE
addCustomMenu( "Adv4","Adv4", "Transcations");
addCustomMenu( "Adv3","Adv3", "Transcations");
addCustomMenu( "Support","Support", "Transcations");
addCustomMenu( "Adv2s","Adv2s", "Transcations");
addCustomMenu( "Adv1","Adv1", "Transcations");
addCustomMenu( "Child","Child", "Transcations");
addCustomMenu( "State","State", "Transcations");
addCustomMenu( "Contry","Contry", "Transcations");
addCustomMenu( "Distric","Distric", "Transcations");
addCustomMenu( "Test_a","Test_a", "Transcations");
System.out.println("dashboard and menu inserted..."); System.out.println("dashboard and menu inserted...");

View File

@@ -0,0 +1,187 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.basicp1.Entity.Adv1;
import com.realnet.basicp1.Services.Adv1Service ;
@RequestMapping(value = "/Adv1")
@CrossOrigin("*")
@RestController
public class Adv1Controller {
@Autowired
private Adv1Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Adv1")
public Adv1 Savedata(@RequestBody Adv1 data) {
Adv1 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Adv1/{id}")
public Adv1 update(@RequestBody Adv1 data,@PathVariable Integer id ) {
Adv1 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Adv1/getall/page")
public Page<Adv1> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Adv1> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Adv1")
public List<Adv1> getdetails() {
List<Adv1> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Adv1")
public List<Adv1> getallwioutsec() {
List<Adv1> get = Service.getdetails();
return get;
}
@GetMapping("/Adv1/{id}")
public Adv1 getdetailsbyId(@PathVariable Integer id ) {
Adv1 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Adv1/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,139 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.basicp1.Entity.Adv2s;
import com.realnet.basicp1.Services.Adv2sService ;
@RequestMapping(value = "/Adv2s")
@CrossOrigin("*")
@RestController
public class Adv2sController {
@Autowired
private Adv2sService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Adv2s")
public Adv2s Savedata(@RequestBody Adv2s data) {
Adv2s save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Adv2s/{id}")
public Adv2s update(@RequestBody Adv2s data,@PathVariable Integer id ) {
Adv2s update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Adv2s/getall/page")
public Page<Adv2s> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Adv2s> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Adv2s")
public List<Adv2s> getdetails() {
List<Adv2s> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Adv2s")
public List<Adv2s> getallwioutsec() {
List<Adv2s> get = Service.getdetails();
return get;
}
@GetMapping("/Adv2s/{id}")
public Adv2s getdetailsbyId(@PathVariable Integer id ) {
Adv2s get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Adv2s/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,163 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.basicp1.Entity.Adv3;
import com.realnet.basicp1.Services.Adv3Service ;
@RequestMapping(value = "/Adv3")
@CrossOrigin("*")
@RestController
public class Adv3Controller {
@Autowired
private Adv3Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Adv3")
public Adv3 Savedata(@RequestBody Adv3 data) {
Adv3 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Adv3/{id}")
public Adv3 update(@RequestBody Adv3 data,@PathVariable Integer id ) {
Adv3 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Adv3/getall/page")
public Page<Adv3> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Adv3> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Adv3")
public List<Adv3> getdetails() {
List<Adv3> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Adv3")
public List<Adv3> getallwioutsec() {
List<Adv3> get = Service.getdetails();
return get;
}
@GetMapping("/Adv3/{id}")
public Adv3 getdetailsbyId(@PathVariable Integer id ) {
Adv3 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Adv3/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,130 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.basicp1.Entity.Adv4;
import com.realnet.basicp1.Services.Adv4Service ;
import com.realnet.basicp1.Entity.Support;
import com.realnet.basicp1.Entity.Child;
@RequestMapping(value = "/Adv4")
@CrossOrigin("*")
@RestController
public class Adv4Controller {
@Autowired
private Adv4Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Adv4")
public Adv4 Savedata(@RequestBody Adv4 data) {
Adv4 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Adv4/{id}")
public Adv4 update(@RequestBody Adv4 data,@PathVariable Integer id ) {
Adv4 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Adv4/getall/page")
public Page<Adv4> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Adv4> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Adv4")
public List<Adv4> getdetails() {
List<Adv4> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Adv4")
public List<Adv4> getallwioutsec() {
List<Adv4> get = Service.getdetails();
return get;
}
@GetMapping("/Adv4/{id}")
public Adv4 getdetailsbyId(@PathVariable Integer id ) {
Adv4 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Adv4/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
@PostMapping("/Adv4/Support_insert")
public Support insertSupport(@RequestBody Support data) {
Support insertaction = Service.insertSupport(data);
return insertaction;
}
@PutMapping("/Adv4/Child_update/{id}")
public ResponseEntity<?> updateChild(@PathVariable Integer id, @RequestBody Child data) {
ResponseEntity<?> update = Service.updateChild(id, data);
System.out.println(update + " updateed");
return update;
}
}

View File

@@ -0,0 +1,99 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.basicp1.Entity.Child;
import com.realnet.basicp1.Services.ChildService ;
@RequestMapping(value = "/Child")
@CrossOrigin("*")
@RestController
public class ChildController {
@Autowired
private ChildService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Child")
public Child Savedata(@RequestBody Child data) {
Child save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Child/{id}")
public Child update(@RequestBody Child data,@PathVariable Integer id ) {
Child update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Child/getall/page")
public Page<Child> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Child> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Child")
public List<Child> getdetails() {
List<Child> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Child")
public List<Child> getallwioutsec() {
List<Child> get = Service.getdetails();
return get;
}
@GetMapping("/Child/{id}")
public Child getdetailsbyId(@PathVariable Integer id ) {
Child get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Child/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,23 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.http.ResponseEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.realnet.basicp1.Entity.Child;
import com.realnet.basicp1.Services.ChildUpdateService4 ;
@RequestMapping(value = "/Child")
@RestController
public class ChildUpdateController4{
@Autowired
private ChildUpdateService4 Service;
@PutMapping("/Child_update/{id}")
public ResponseEntity<?> update(@PathVariable Integer id,@RequestBody Child child) {
ResponseEntity<?> update = Service.updateaction(id,child );
System.out.println(update+" updateed");
return update;
}
}

View File

@@ -0,0 +1,99 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.basicp1.Entity.Contry;
import com.realnet.basicp1.Services.ContryService ;
@RequestMapping(value = "/Contry")
@CrossOrigin("*")
@RestController
public class ContryController {
@Autowired
private ContryService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Contry")
public Contry Savedata(@RequestBody Contry data) {
Contry save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Contry/{id}")
public Contry update(@RequestBody Contry data,@PathVariable Integer id ) {
Contry update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Contry/getall/page")
public Page<Contry> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Contry> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Contry")
public List<Contry> getdetails() {
List<Contry> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Contry")
public List<Contry> getallwioutsec() {
List<Contry> get = Service.getdetails();
return get;
}
@GetMapping("/Contry/{id}")
public Contry getdetailsbyId(@PathVariable Integer id ) {
Contry get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Contry/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,24 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.realnet.basicp1.Entity.Contry_ListFilter1;
import com.realnet.basicp1.Services.Contry_ListFilter1Service ;
@RequestMapping(value = "/Contry_ListFilter1")
@RestController
public class Contry_ListFilter1Controller {
@Autowired
private Contry_ListFilter1Service Service;
@GetMapping("/Contry_ListFilter1")
public List<Contry_ListFilter1> getlist() {
List<Contry_ListFilter1> get = Service.getlistbuilder();
return get;
}
@GetMapping("/Contry_ListFilter11")
public List<Contry_ListFilter1> getlistwithparam( ) {
List<Contry_ListFilter1> get = Service.getlistbuilderparam( );
return get;
}
}

View File

@@ -0,0 +1,107 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.basicp1.Entity.Distric;
import com.realnet.basicp1.Services.DistricService ;
@RequestMapping(value = "/Distric")
@CrossOrigin("*")
@RestController
public class DistricController {
@Autowired
private DistricService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Distric")
public Distric Savedata(@RequestBody Distric data) {
Distric save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Distric/{id}")
public Distric update(@RequestBody Distric data,@PathVariable Integer id ) {
Distric update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Distric/getall/page")
public Page<Distric> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Distric> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Distric")
public List<Distric> getdetails() {
List<Distric> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Distric")
public List<Distric> getallwioutsec() {
List<Distric> get = Service.getdetails();
return get;
}
@GetMapping("/Distric/{id}")
public Distric getdetailsbyId(@PathVariable Integer id ) {
Distric get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Distric/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,24 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.realnet.basicp1.Entity.Distric_ListFilter1;
import com.realnet.basicp1.Services.Distric_ListFilter1Service ;
@RequestMapping(value = "/Distric_ListFilter1")
@RestController
public class Distric_ListFilter1Controller {
@Autowired
private Distric_ListFilter1Service Service;
@GetMapping("/Distric_ListFilter1")
public List<Distric_ListFilter1> getlist() {
List<Distric_ListFilter1> get = Service.getlistbuilder();
return get;
}
@GetMapping("/Distric_ListFilter11/{item}")
public List<Distric_ListFilter1> getlistwithparam( @PathVariable String item) {
List<Distric_ListFilter1> get = Service.getlistbuilderparam( item);
return get;
}
}

View File

@@ -0,0 +1,107 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.basicp1.Entity.State;
import com.realnet.basicp1.Services.StateService ;
@RequestMapping(value = "/State")
@CrossOrigin("*")
@RestController
public class StateController {
@Autowired
private StateService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/State")
public State Savedata(@RequestBody State data) {
State save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/State/{id}")
public State update(@RequestBody State data,@PathVariable Integer id ) {
State update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/State/getall/page")
public Page<State> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<State> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/State")
public List<State> getdetails() {
List<State> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/State")
public List<State> getallwioutsec() {
List<State> get = Service.getdetails();
return get;
}
@GetMapping("/State/{id}")
public State getdetailsbyId(@PathVariable Integer id ) {
State get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/State/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,24 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.realnet.basicp1.Entity.State_ListFilter1;
import com.realnet.basicp1.Services.State_ListFilter1Service ;
@RequestMapping(value = "/State_ListFilter1")
@RestController
public class State_ListFilter1Controller {
@Autowired
private State_ListFilter1Service Service;
@GetMapping("/State_ListFilter1")
public List<State_ListFilter1> getlist() {
List<State_ListFilter1> get = Service.getlistbuilder();
return get;
}
@GetMapping("/State_ListFilter11/{item}")
public List<State_ListFilter1> getlistwithparam( @PathVariable String item) {
List<State_ListFilter1> get = Service.getlistbuilderparam( item);
return get;
}
}

View File

@@ -0,0 +1,91 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.basicp1.Entity.Support;
import com.realnet.basicp1.Services.SupportService ;
@RequestMapping(value = "/Support")
@CrossOrigin("*")
@RestController
public class SupportController {
@Autowired
private SupportService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Support")
public Support Savedata(@RequestBody Support data) {
Support save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Support/{id}")
public Support update(@RequestBody Support data,@PathVariable Integer id ) {
Support update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Support/getall/page")
public Page<Support> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Support> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Support")
public List<Support> getdetails() {
List<Support> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Support")
public List<Support> getallwioutsec() {
List<Support> get = Service.getdetails();
return get;
}
@GetMapping("/Support/{id}")
public Support getdetailsbyId(@PathVariable Integer id ) {
Support get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Support/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,21 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.*;
import com.realnet.basicp1.Entity.Support;
import com.realnet.basicp1.Services.SupportInsertService3;
@RequestMapping(value = "/Support")
@RestController
public class SupportInsertController3{
@Autowired
private SupportInsertService3 Service;
@PostMapping("/Support_insert")
public ResponseEntity<?> insert(@RequestBody Support support) {
Support insertaction = Service.insertaction(support);
return new ResponseEntity<>(insertaction, HttpStatus.OK);
}
}

View File

@@ -0,0 +1,203 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.basicp1.Entity.Test_a;
import com.realnet.basicp1.Services.Test_aService ;
@RequestMapping(value = "/Test_a")
@CrossOrigin("*")
@RestController
public class Test_aController {
@Autowired
private Test_aService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Test_a")
public Test_a Savedata(@RequestBody Test_a data) {
Test_a save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Test_a/{id}")
public Test_a update(@RequestBody Test_a data,@PathVariable Integer id ) {
Test_a update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Test_a/getall/page")
public Page<Test_a> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Test_a> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Test_a")
public List<Test_a> getdetails() {
List<Test_a> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Test_a")
public List<Test_a> getallwioutsec() {
List<Test_a> get = Service.getdetails();
return get;
}
@GetMapping("/Test_a/{id}")
public Test_a getdetailsbyId(@PathVariable Integer id ) {
Test_a get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Test_a/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,187 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.basicp1.Entity.Adv1;
import com.realnet.basicp1.Services.Adv1Service ;
@RequestMapping(value = "/token/Adv1")
@CrossOrigin("*")
@RestController
public class tokenFree_Adv1Controller {
@Autowired
private Adv1Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Adv1")
public Adv1 Savedata(@RequestBody Adv1 data) {
Adv1 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Adv1/{id}")
public Adv1 update(@RequestBody Adv1 data,@PathVariable Integer id ) {
Adv1 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Adv1/getall/page")
public Page<Adv1> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Adv1> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Adv1")
public List<Adv1> getdetails() {
List<Adv1> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Adv1")
public List<Adv1> getallwioutsec() {
List<Adv1> get = Service.getdetails();
return get;
}
@GetMapping("/Adv1/{id}")
public Adv1 getdetailsbyId(@PathVariable Integer id ) {
Adv1 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Adv1/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,139 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.basicp1.Entity.Adv2s;
import com.realnet.basicp1.Services.Adv2sService ;
@RequestMapping(value = "/token/Adv2s")
@CrossOrigin("*")
@RestController
public class tokenFree_Adv2sController {
@Autowired
private Adv2sService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Adv2s")
public Adv2s Savedata(@RequestBody Adv2s data) {
Adv2s save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Adv2s/{id}")
public Adv2s update(@RequestBody Adv2s data,@PathVariable Integer id ) {
Adv2s update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Adv2s/getall/page")
public Page<Adv2s> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Adv2s> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Adv2s")
public List<Adv2s> getdetails() {
List<Adv2s> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Adv2s")
public List<Adv2s> getallwioutsec() {
List<Adv2s> get = Service.getdetails();
return get;
}
@GetMapping("/Adv2s/{id}")
public Adv2s getdetailsbyId(@PathVariable Integer id ) {
Adv2s get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Adv2s/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,163 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.basicp1.Entity.Adv3;
import com.realnet.basicp1.Services.Adv3Service ;
@RequestMapping(value = "/token/Adv3")
@CrossOrigin("*")
@RestController
public class tokenFree_Adv3Controller {
@Autowired
private Adv3Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Adv3")
public Adv3 Savedata(@RequestBody Adv3 data) {
Adv3 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Adv3/{id}")
public Adv3 update(@RequestBody Adv3 data,@PathVariable Integer id ) {
Adv3 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Adv3/getall/page")
public Page<Adv3> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Adv3> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Adv3")
public List<Adv3> getdetails() {
List<Adv3> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Adv3")
public List<Adv3> getallwioutsec() {
List<Adv3> get = Service.getdetails();
return get;
}
@GetMapping("/Adv3/{id}")
public Adv3 getdetailsbyId(@PathVariable Integer id ) {
Adv3 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Adv3/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,130 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.basicp1.Entity.Adv4;
import com.realnet.basicp1.Services.Adv4Service ;
import com.realnet.basicp1.Entity.Support;
import com.realnet.basicp1.Entity.Child;
@RequestMapping(value = "/token/Adv4")
@CrossOrigin("*")
@RestController
public class tokenFree_Adv4Controller {
@Autowired
private Adv4Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Adv4")
public Adv4 Savedata(@RequestBody Adv4 data) {
Adv4 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Adv4/{id}")
public Adv4 update(@RequestBody Adv4 data,@PathVariable Integer id ) {
Adv4 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Adv4/getall/page")
public Page<Adv4> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Adv4> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Adv4")
public List<Adv4> getdetails() {
List<Adv4> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Adv4")
public List<Adv4> getallwioutsec() {
List<Adv4> get = Service.getdetails();
return get;
}
@GetMapping("/Adv4/{id}")
public Adv4 getdetailsbyId(@PathVariable Integer id ) {
Adv4 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Adv4/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
@PostMapping("/Adv4/Support_insert")
public Support insertSupport(@RequestBody Support data) {
Support insertaction = Service.insertSupport(data);
return insertaction;
}
@PutMapping("/Adv4/Child_update/{id}")
public ResponseEntity<?> updateChild(@PathVariable Integer id, @RequestBody Child data) {
ResponseEntity<?> update = Service.updateChild(id, data);
System.out.println(update + " updateed");
return update;
}
}

View File

@@ -0,0 +1,99 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.basicp1.Entity.Child;
import com.realnet.basicp1.Services.ChildService ;
@RequestMapping(value = "/token/Child")
@CrossOrigin("*")
@RestController
public class tokenFree_ChildController {
@Autowired
private ChildService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Child")
public Child Savedata(@RequestBody Child data) {
Child save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Child/{id}")
public Child update(@RequestBody Child data,@PathVariable Integer id ) {
Child update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Child/getall/page")
public Page<Child> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Child> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Child")
public List<Child> getdetails() {
List<Child> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Child")
public List<Child> getallwioutsec() {
List<Child> get = Service.getdetails();
return get;
}
@GetMapping("/Child/{id}")
public Child getdetailsbyId(@PathVariable Integer id ) {
Child get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Child/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,99 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.basicp1.Entity.Contry;
import com.realnet.basicp1.Services.ContryService ;
@RequestMapping(value = "/token/Contry")
@CrossOrigin("*")
@RestController
public class tokenFree_ContryController {
@Autowired
private ContryService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Contry")
public Contry Savedata(@RequestBody Contry data) {
Contry save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Contry/{id}")
public Contry update(@RequestBody Contry data,@PathVariable Integer id ) {
Contry update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Contry/getall/page")
public Page<Contry> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Contry> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Contry")
public List<Contry> getdetails() {
List<Contry> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Contry")
public List<Contry> getallwioutsec() {
List<Contry> get = Service.getdetails();
return get;
}
@GetMapping("/Contry/{id}")
public Contry getdetailsbyId(@PathVariable Integer id ) {
Contry get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Contry/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,24 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.realnet.basicp1.Entity.Contry_ListFilter1;
import com.realnet.basicp1.Services.Contry_ListFilter1Service ;
@RequestMapping(value = "/token/Contry_ListFilter1")
@RestController
public class tokenFree_Contry_ListFilter1Controller {
@Autowired
private Contry_ListFilter1Service Service;
@GetMapping("/Contry_ListFilter1")
public List<Contry_ListFilter1> getlist() {
List<Contry_ListFilter1> get = Service.getlistbuilder();
return get;
}
@GetMapping("/Contry_ListFilter11")
public List<Contry_ListFilter1> getlistwithparam( ) {
List<Contry_ListFilter1> get = Service.getlistbuilderparam( );
return get;
}
}

View File

@@ -0,0 +1,107 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.basicp1.Entity.Distric;
import com.realnet.basicp1.Services.DistricService ;
@RequestMapping(value = "/token/Distric")
@CrossOrigin("*")
@RestController
public class tokenFree_DistricController {
@Autowired
private DistricService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Distric")
public Distric Savedata(@RequestBody Distric data) {
Distric save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Distric/{id}")
public Distric update(@RequestBody Distric data,@PathVariable Integer id ) {
Distric update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Distric/getall/page")
public Page<Distric> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Distric> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Distric")
public List<Distric> getdetails() {
List<Distric> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Distric")
public List<Distric> getallwioutsec() {
List<Distric> get = Service.getdetails();
return get;
}
@GetMapping("/Distric/{id}")
public Distric getdetailsbyId(@PathVariable Integer id ) {
Distric get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Distric/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,24 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.realnet.basicp1.Entity.Distric_ListFilter1;
import com.realnet.basicp1.Services.Distric_ListFilter1Service ;
@RequestMapping(value = "/token/Distric_ListFilter1")
@RestController
public class tokenFree_Distric_ListFilter1Controller {
@Autowired
private Distric_ListFilter1Service Service;
@GetMapping("/Distric_ListFilter1")
public List<Distric_ListFilter1> getlist() {
List<Distric_ListFilter1> get = Service.getlistbuilder();
return get;
}
@GetMapping("/Distric_ListFilter11/{item}")
public List<Distric_ListFilter1> getlistwithparam( @PathVariable String item) {
List<Distric_ListFilter1> get = Service.getlistbuilderparam( item);
return get;
}
}

View File

@@ -0,0 +1,107 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.basicp1.Entity.State;
import com.realnet.basicp1.Services.StateService ;
@RequestMapping(value = "/token/State")
@CrossOrigin("*")
@RestController
public class tokenFree_StateController {
@Autowired
private StateService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/State")
public State Savedata(@RequestBody State data) {
State save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/State/{id}")
public State update(@RequestBody State data,@PathVariable Integer id ) {
State update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/State/getall/page")
public Page<State> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<State> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/State")
public List<State> getdetails() {
List<State> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/State")
public List<State> getallwioutsec() {
List<State> get = Service.getdetails();
return get;
}
@GetMapping("/State/{id}")
public State getdetailsbyId(@PathVariable Integer id ) {
State get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/State/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,24 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.realnet.basicp1.Entity.State_ListFilter1;
import com.realnet.basicp1.Services.State_ListFilter1Service ;
@RequestMapping(value = "/token/State_ListFilter1")
@RestController
public class tokenFree_State_ListFilter1Controller {
@Autowired
private State_ListFilter1Service Service;
@GetMapping("/State_ListFilter1")
public List<State_ListFilter1> getlist() {
List<State_ListFilter1> get = Service.getlistbuilder();
return get;
}
@GetMapping("/State_ListFilter11/{item}")
public List<State_ListFilter1> getlistwithparam( @PathVariable String item) {
List<State_ListFilter1> get = Service.getlistbuilderparam( item);
return get;
}
}

View File

@@ -0,0 +1,91 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.basicp1.Entity.Support;
import com.realnet.basicp1.Services.SupportService ;
@RequestMapping(value = "/token/Support")
@CrossOrigin("*")
@RestController
public class tokenFree_SupportController {
@Autowired
private SupportService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Support")
public Support Savedata(@RequestBody Support data) {
Support save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Support/{id}")
public Support update(@RequestBody Support data,@PathVariable Integer id ) {
Support update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Support/getall/page")
public Page<Support> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Support> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Support")
public List<Support> getdetails() {
List<Support> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Support")
public List<Support> getallwioutsec() {
List<Support> get = Service.getdetails();
return get;
}
@GetMapping("/Support/{id}")
public Support getdetailsbyId(@PathVariable Integer id ) {
Support get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Support/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,203 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.CrossOrigin;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.realnet.config.EmailService;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.data.domain.*;
import com.realnet.fnd.response.EntityResponse;
import org.springframework.http.*;
import org.springframework.beans.factory.annotation.*;
import com.realnet.basicp1.Entity.Test_a;
import com.realnet.basicp1.Services.Test_aService ;
@RequestMapping(value = "/token/Test_a")
@CrossOrigin("*")
@RestController
public class tokenFree_Test_aController {
@Autowired
private Test_aService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Test_a")
public Test_a Savedata(@RequestBody Test_a data) {
Test_a save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Test_a/{id}")
public Test_a update(@RequestBody Test_a data,@PathVariable Integer id ) {
Test_a update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Test_a/getall/page")
public Page<Test_a> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Test_a> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Test_a")
public List<Test_a> getdetails() {
List<Test_a> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Test_a")
public List<Test_a> getallwioutsec() {
List<Test_a> get = Service.getdetails();
return get;
}
@GetMapping("/Test_a/{id}")
public Test_a getdetailsbyId(@PathVariable Integer id ) {
Test_a get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Test_a/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,104 @@
package com.realnet.basicp1.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Entity
@Data
public class Adv1 extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
private String gender;
private Boolean java;
private Boolean testing;
private Boolean selenium;
private String fileupload_fieldname;
private String fileupload_fieldpath ;
private String imageupload_fieldname;
private String imageupload_fieldpath ;
private String audio_fieldname;
private String audio_fieldpath ;
private String video_fieldname;
private String video_fieldpath ;
private String currency;
private String qrcode_field;
private String barcode_field;
private String name;
private String last_name;
}

View File

@@ -0,0 +1,54 @@
package com.realnet.basicp1.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Entity
@Data
public class Adv2s extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
private String sta_select;
private String stat_mulsel;
private String dyan_sel;
private String dyan_selidentifier;
private String dyna_mul;
private String autoc;
private String autocidentifier;
private String auto_mul;
}

View File

@@ -0,0 +1,74 @@
package com.realnet.basicp1.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
import com.realnet.basicp1.Entity.Child;
@Entity
@Data
public class Adv3 extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
@OneToOne( cascade=CascadeType.ALL)
private Child child;
private int age_1;
private int age2;
private String calculated_add;
private String calculated_sub;
private String calculated_mul;
private String calculated_div;
private String contry;
private String contryidentifier;
private String state;
private String distric;
}

View File

@@ -0,0 +1,41 @@
package com.realnet.basicp1.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
import com.realnet.basicp1.Entity.Child;
@Entity
@Data
public class Adv4 extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
@OneToMany( cascade=CascadeType.ALL)
private List<Child> child = new ArrayList<>();
private String survey_form;
}

View File

@@ -0,0 +1,33 @@
package com.realnet.basicp1.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Entity
@Data
public class Child extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
@Column(length = 2000)
private String description;
private Boolean active;
}

View File

@@ -0,0 +1,33 @@
package com.realnet.basicp1.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Entity
@Data
public class Contry extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
@Column(length = 2000)
private String description;
private Boolean active;
}

View File

@@ -0,0 +1,15 @@
package com.realnet.basicp1.Entity;
import lombok.*;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Data
public class Contry_ListFilter1 {
private Integer id;
private String name;
private String description;
}

View File

@@ -0,0 +1,37 @@
package com.realnet.basicp1.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Entity
@Data
public class Distric extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String distric_name;
@Column(length = 2000)
private String description;
private Boolean active;
private String state_name;
}

View File

@@ -0,0 +1,14 @@
package com.realnet.basicp1.Entity;
import lombok.*;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Data
public class Distric_ListFilter1 {
private Integer id;
private String distric_name;
}

View File

@@ -0,0 +1,37 @@
package com.realnet.basicp1.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Entity
@Data
public class State extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String state_name;
@Column(length = 2000)
private String description;
private Boolean active;
private String contry_name;
}

View File

@@ -0,0 +1,14 @@
package com.realnet.basicp1.Entity;
import lombok.*;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Data
public class State_ListFilter1 {
private Integer id;
private String state_name;
}

View File

@@ -0,0 +1,29 @@
package com.realnet.basicp1.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Entity
@Data
public class Support extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
@Column(length = 2000)
private String description;
}

View File

@@ -0,0 +1,90 @@
package com.realnet.basicp1.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Entity
@Data
public class Test_a extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String text_field;
private int number_field;
private String phone_number;
@Column(length = 2000)
private String paragraph_field;
private String password_field;
@Transient
private String confirmpassword_field;
@Column(length = 2000)
private String textarea;
private String date_field;
private String datetime_field;
private String email_field;
private Boolean toggle_switch;
private String url_field;
private double decimal_field;
private int percentage_field;
private String recaptcha;
private String documentsequence;
private Long user_id;
private String user_name;
}

View File

@@ -0,0 +1,52 @@
package com.realnet.basicp1.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.*;
import com.realnet.basicp1.Entity.Adv1;
@Repository
public interface Adv1Repository extends JpaRepository<Adv1, Integer> {
@Query(value = "select * from adv1 where created_by=?1", nativeQuery = true)
List<Adv1> findAll(Long creayedBy);
@Query(value = "select * from adv1 where created_by=?1", nativeQuery = true)
Page<Adv1> findAll( Long creayedBy,Pageable page);
}

View File

@@ -0,0 +1,40 @@
package com.realnet.basicp1.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.*;
import com.realnet.basicp1.Entity.Adv2s;
@Repository
public interface Adv2sRepository extends JpaRepository<Adv2s, Integer> {
@Query(value = "select * from adv2s where created_by=?1", nativeQuery = true)
List<Adv2s> findAll(Long creayedBy);
@Query(value = "select * from adv2s where created_by=?1", nativeQuery = true)
Page<Adv2s> findAll( Long creayedBy,Pageable page);
}

View File

@@ -0,0 +1,46 @@
package com.realnet.basicp1.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.*;
import com.realnet.basicp1.Entity.Adv3;
@Repository
public interface Adv3Repository extends JpaRepository<Adv3, Integer> {
@Query(value = "select * from adv3 where created_by=?1", nativeQuery = true)
List<Adv3> findAll(Long creayedBy);
@Query(value = "select * from adv3 where created_by=?1", nativeQuery = true)
Page<Adv3> findAll( Long creayedBy,Pageable page);
}

View File

@@ -0,0 +1,34 @@
package com.realnet.basicp1.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.*;
import com.realnet.basicp1.Entity.Adv4;
@Repository
public interface Adv4Repository extends JpaRepository<Adv4, Integer> {
@Query(value = "select * from adv4 where created_by=?1", nativeQuery = true)
List<Adv4> findAll(Long creayedBy);
@Query(value = "select * from adv4 where created_by=?1", nativeQuery = true)
Page<Adv4> findAll( Long creayedBy,Pageable page);
}

View File

@@ -0,0 +1,30 @@
package com.realnet.basicp1.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.*;
import com.realnet.basicp1.Entity.Child;
@Repository
public interface ChildRepository extends JpaRepository<Child, Integer> {
@Query(value = "select * from child where created_by=?1", nativeQuery = true)
List<Child> findAll(Long creayedBy);
@Query(value = "select * from child where created_by=?1", nativeQuery = true)
Page<Child> findAll( Long creayedBy,Pageable page);
}

View File

@@ -0,0 +1,30 @@
package com.realnet.basicp1.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.*;
import com.realnet.basicp1.Entity.Contry;
@Repository
public interface ContryRepository extends JpaRepository<Contry, Integer> {
@Query(value = "select * from contry where created_by=?1", nativeQuery = true)
List<Contry> findAll(Long creayedBy);
@Query(value = "select * from contry where created_by=?1", nativeQuery = true)
Page<Contry> findAll( Long creayedBy,Pageable page);
}

View File

@@ -0,0 +1,32 @@
package com.realnet.basicp1.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.*;
import com.realnet.basicp1.Entity.Distric;
@Repository
public interface DistricRepository extends JpaRepository<Distric, Integer> {
@Query(value = "select * from distric where created_by=?1", nativeQuery = true)
List<Distric> findAll(Long creayedBy);
@Query(value = "select * from distric where created_by=?1", nativeQuery = true)
Page<Distric> findAll( Long creayedBy,Pageable page);
}

View File

@@ -0,0 +1,32 @@
package com.realnet.basicp1.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.*;
import com.realnet.basicp1.Entity.State;
@Repository
public interface StateRepository extends JpaRepository<State, Integer> {
@Query(value = "select * from state where created_by=?1", nativeQuery = true)
List<State> findAll(Long creayedBy);
@Query(value = "select * from state where created_by=?1", nativeQuery = true)
Page<State> findAll( Long creayedBy,Pageable page);
}

View File

@@ -0,0 +1,28 @@
package com.realnet.basicp1.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.*;
import com.realnet.basicp1.Entity.Support;
@Repository
public interface SupportRepository extends JpaRepository<Support, Integer> {
@Query(value = "select * from support where created_by=?1", nativeQuery = true)
List<Support> findAll(Long creayedBy);
@Query(value = "select * from support where created_by=?1", nativeQuery = true)
Page<Support> findAll( Long creayedBy,Pageable page);
}

View File

@@ -0,0 +1,56 @@
package com.realnet.basicp1.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.*;
import com.realnet.basicp1.Entity.Test_a;
@Repository
public interface Test_aRepository extends JpaRepository<Test_a, Integer> {
@Query(value = "select * from test_a where created_by=?1", nativeQuery = true)
List<Test_a> findAll(Long creayedBy);
@Query(value = "select * from test_a where created_by=?1", nativeQuery = true)
Page<Test_a> findAll( Long creayedBy,Pageable page);
}

View File

@@ -0,0 +1,243 @@
package com.realnet.basicp1.Services;
import com.realnet.basicp1.Repository.Adv1Repository;
import com.realnet.basicp1.Entity.Adv1
;import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.realnet.SequenceGenerator.Service.SequenceService;
import org.springframework.data.domain.Page;
import com.realnet.realm.Entity.Realm;
import com.realnet.realm.Services.RealmService;
import org.springframework.data.domain.Pageable;
import org.springframework.http.*;
import com.realnet.users.service1.AppUserServiceImpl;
import com.realnet.users.entity1.AppUser;
import com.realnet.config.EmailService;
import org.springframework.stereotype.Service;
@Service
public class Adv1Service {
@Autowired
private Adv1Repository Repository;
@Autowired
private AppUserServiceImpl userService;
@Autowired
private RealmService realmService;
@Autowired
private EmailService emailServicestatic;
public Adv1 Savedata(Adv1 data) {
try
{
// emailServicestatic.sendEmail( getUser().getEmail(),"Adv1", "test");
emailServicestatic.sendEmailViaSetu(getUser().getEmail(),"test","","ganesh");
} catch (Exception e) {
// TODO: handle exception
System.out.println("Got error During Mail Send " + e);
}
data.setUpdatedBy(getUser().getUserId());
data.setCreatedBy(getUser().getUserId());
data.setAccountId(getUser().getAccount().getAccount_id());
Adv1 save = Repository.save(data);
return save;
}
// get all with pagination
public Page<Adv1> getAllWithPagination(Pageable page) {
return Repository.findAll( getUser().getUserId(),page);
}
public List<Adv1> getdetails() {
List<Realm> realm = realmService.findByUserId(getUser().getUserId());
List<Adv1> all = Repository.findAll(getUser().getUserId());
return all ; }
public Adv1 getdetailsbyId(Integer id) {
return Repository.findById(id).get();
}
public void delete_by_id(Integer id) {
Repository.deleteById(id);
}
public Adv1 update(Adv1 data,Integer id) {
Adv1 old = Repository.findById(id).get();
old.setName(data.getName());
old.setGender(data.getGender());
old.setJava(data.getJava());
old.setTesting(data.getTesting());
old.setSelenium(data.getSelenium());
old.setCurrency(data.getCurrency());
old.setQrcode_field(data.getQrcode_field());
old.setBarcode_field(data.getBarcode_field());
old.setName(data.getName());
old.setLast_name(data.getLast_name());
final Adv1 test = Repository.save(old);
data.setUpdatedBy(getUser().getUserId());
return test;}
public AppUser getUser() {
AppUser user = userService.getLoggedInUser();
return user;
}}

View File

@@ -0,0 +1,207 @@
package com.realnet.basicp1.Services;
import com.realnet.basicp1.Repository.Adv2sRepository;
import com.realnet.basicp1.Entity.Adv2s
;import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.realnet.SequenceGenerator.Service.SequenceService;
import org.springframework.data.domain.Page;
import com.realnet.realm.Entity.Realm;
import com.realnet.realm.Services.RealmService;
import org.springframework.data.domain.Pageable;
import org.springframework.http.*;
import com.realnet.users.service1.AppUserServiceImpl;
import com.realnet.users.entity1.AppUser;
import com.realnet.basicp1.Entity.Contry;
import com.realnet.basicp1.Services.ContryService;
import com.realnet.basicp1.Entity.Contry;
import com.realnet.basicp1.Services.ContryService;
import com.realnet.config.EmailService;
import org.springframework.stereotype.Service;
@Service
public class Adv2sService {
@Autowired
private Adv2sRepository Repository;
@Autowired
private AppUserServiceImpl userService;
@Autowired
private RealmService realmService;
@Autowired
private ContryService dyan_selserv;
@Autowired
private ContryService autocserv;
@Autowired
private EmailService emailServicedynamic;
public Adv2s Savedata(Adv2s data) {
if (data.getDyan_sel() != null) {
try {
int dyan_selId = Integer.valueOf(data.getDyan_sel());
Contry get = dyan_selserv.getdetailsbyId(dyan_selId);
if (get != null) {
data.setDyan_selidentifier(get.getName());
}
} catch (NumberFormatException e) {
System.out.println(" dyan_selId is not integer..");
// Invalid integer string — ignore or log
data.setDyan_selidentifier(data.getDyan_sel());
}
}
if (data.getAutoc() != null) {
try {
int autocId = Integer.valueOf(data.getAutoc());
Contry get = autocserv.getdetailsbyId(autocId);
if (get != null) {
data.setAutocidentifier(get.getName());
}
} catch (NumberFormatException e) {
System.out.println(" autocId is not integer..");
// Invalid integer string — ignore or log
data.setAutocidentifier(data.getAutoc());
}
}
try
{
// emailServicedynamic.sendEmail( "gaurav_dekatc_com","Adv2s", "testing");
emailServicedynamic.sendEmailViaSetu( "gaurav_dekatc_com","testing","","ganesh");
} catch (Exception e) {
// TODO: handle exception
System.out.println("Got error During Mail Send " + e);
}
data.setUpdatedBy(getUser().getUserId());
data.setCreatedBy(getUser().getUserId());
data.setAccountId(getUser().getAccount().getAccount_id());
Adv2s save = Repository.save(data);
return save;
}
// get all with pagination
public Page<Adv2s> getAllWithPagination(Pageable page) {
return Repository.findAll( getUser().getUserId(),page);
}
public List<Adv2s> getdetails() {
List<Realm> realm = realmService.findByUserId(getUser().getUserId());
List<Adv2s> all = Repository.findAll(getUser().getUserId());
return all ; }
public Adv2s getdetailsbyId(Integer id) {
return Repository.findById(id).get();
}
public void delete_by_id(Integer id) {
Repository.deleteById(id);
}
public Adv2s update(Adv2s data,Integer id) {
Adv2s old = Repository.findById(id).get();
old.setName(data.getName());
old.setSta_select(data.getSta_select());
old.setStat_mulsel(data.getStat_mulsel());
old.setDyan_sel(data.getDyan_sel());
old.setDyna_mul(data.getDyna_mul());
old.setAutoc(data.getAutoc());
old.setAuto_mul(data.getAuto_mul());
final Adv2s test = Repository.save(old);
data.setUpdatedBy(getUser().getUserId());
return test;}
public AppUser getUser() {
AppUser user = userService.getLoggedInUser();
return user;
}}

View File

@@ -0,0 +1,202 @@
package com.realnet.basicp1.Services;
import com.realnet.basicp1.Repository.Adv3Repository;
import com.realnet.basicp1.Entity.Adv3
;import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.realnet.SequenceGenerator.Service.SequenceService;
import org.springframework.data.domain.Page;
import com.realnet.realm.Entity.Realm;
import com.realnet.realm.Services.RealmService;
import org.springframework.data.domain.Pageable;
import org.springframework.http.*;
import com.realnet.users.service1.AppUserServiceImpl;
import com.realnet.users.entity1.AppUser;
import com.realnet.basicp1.Entity.Contry;
import com.realnet.basicp1.Services.ContryService;
import org.springframework.stereotype.Service;
@Service
public class Adv3Service {
@Autowired
private Adv3Repository Repository;
@Autowired
private AppUserServiceImpl userService;
@Autowired
private RealmService realmService;
@Autowired
private ContryService contryserv;
public Adv3 Savedata(Adv3 data) {
if (data.getContry() != null) {
try {
int contryId = Integer.valueOf(data.getContry());
Contry get = contryserv.getdetailsbyId(contryId);
if (get != null) {
data.setContryidentifier(get.getName());
}
} catch (NumberFormatException e) {
System.out.println(" contryId is not integer..");
// Invalid integer string — ignore or log
data.setContryidentifier(data.getContry());
}
}
data.setUpdatedBy(getUser().getUserId());
data.setCreatedBy(getUser().getUserId());
data.setAccountId(getUser().getAccount().getAccount_id());
Adv3 save = Repository.save(data);
return save;
}
// get all with pagination
public Page<Adv3> getAllWithPagination(Pageable page) {
return Repository.findAll( getUser().getUserId(),page);
}
public List<Adv3> getdetails() {
List<Realm> realm = realmService.findByUserId(getUser().getUserId());
List<Adv3> all = Repository.findAll(getUser().getUserId());
return all ; }
public Adv3 getdetailsbyId(Integer id) {
return Repository.findById(id).get();
}
public void delete_by_id(Integer id) {
Repository.deleteById(id);
}
public Adv3 update(Adv3 data,Integer id) {
Adv3 old = Repository.findById(id).get();
old.setName(data.getName());
old.setChild(data.getChild());
old.setAge_1(data.getAge_1());
old.setAge2(data.getAge2());
old.setCalculated_add(data.getCalculated_add());
old.setCalculated_sub(data.getCalculated_sub());
old.setCalculated_mul(data.getCalculated_mul());
old.setCalculated_div(data.getCalculated_div());
old.setContry(data.getContry());
old.setState(data.getState());
old.setDistric(data.getDistric());
final Adv3 test = Repository.save(old);
data.setUpdatedBy(getUser().getUserId());
return test;}
public AppUser getUser() {
AppUser user = userService.getLoggedInUser();
return user;
}}

View File

@@ -0,0 +1,167 @@
package com.realnet.basicp1.Services;
import com.realnet.basicp1.Repository.Adv4Repository;
import com.realnet.basicp1.Entity.Adv4
;import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.realnet.SequenceGenerator.Service.SequenceService;
import org.springframework.data.domain.Page;
import com.realnet.realm.Entity.Realm;
import com.realnet.realm.Services.RealmService;
import org.springframework.data.domain.Pageable;
import org.springframework.http.*;
import com.realnet.users.service1.AppUserServiceImpl;
import com.realnet.users.entity1.AppUser;
import com.realnet.basicp1.Entity.Support;
import com.realnet.basicp1.Repository.SupportRepository;
import com.realnet.basicp1.Entity.Child;
import com.realnet.basicp1.Repository.ChildRepository;
import org.springframework.stereotype.Service;
@Service
public class Adv4Service {
@Autowired
private Adv4Repository Repository;
@Autowired
private AppUserServiceImpl userService;
@Autowired
private RealmService realmService;
public Adv4 Savedata(Adv4 data) {
data.setUpdatedBy(getUser().getUserId());
data.setCreatedBy(getUser().getUserId());
data.setAccountId(getUser().getAccount().getAccount_id());
Adv4 save = Repository.save(data);
return save;
}
// get all with pagination
public Page<Adv4> getAllWithPagination(Pageable page) {
return Repository.findAll( getUser().getUserId(),page);
}
public List<Adv4> getdetails() {
List<Realm> realm = realmService.findByUserId(getUser().getUserId());
List<Adv4> all = Repository.findAll(getUser().getUserId());
return all ; }
public Adv4 getdetailsbyId(Integer id) {
return Repository.findById(id).get();
}
public void delete_by_id(Integer id) {
Repository.deleteById(id);
}
public Adv4 update(Adv4 data,Integer id) {
Adv4 old = Repository.findById(id).get();
old.setName(data.getName());
old.setChild(data.getChild());
old.setSurvey_form(data.getSurvey_form());
final Adv4 test = Repository.save(old);
data.setUpdatedBy(getUser().getUserId());
return test;}
// Insert Action
@Autowired
private SupportRepository supportinsertrepository;
public Support insertSupport(Support data) {
data.setUpdatedBy(getUser().getUserId());
data.setCreatedBy(getUser().getUserId());
data.setAccountId(getUser().getAccount().getAccount_id());
final Support save = supportinsertrepository.save(data);
return save;
}
// update Action
@Autowired
private ChildRepository childupdaterepository;
public ResponseEntity<?> updateChild(Integer id, Child data) {
Integer i = 0;
Adv4 s = Repository.findById(id).get();
List<Child> list = new ArrayList<>();
Object childObject = s.getChild();
if (childObject instanceof List<?>) {
// If it's a list, cast and add all elements to the list
list.addAll((List<Child>) childObject);
} else if (childObject instanceof Child) {
// If it's a single Child object, add it to the list
list.add((Child) childObject);
}
for (Child li : list) {
Child old = childupdaterepository.findById(li.getId()).get();
final Child childdata = childupdaterepository.save(old);
i++;
}
return new ResponseEntity<>(i + " updated", HttpStatus.OK);
}
public AppUser getUser() {
AppUser user = userService.getLoggedInUser();
return user;
}}

View File

@@ -0,0 +1,93 @@
package com.realnet.basicp1.Services;
import com.realnet.basicp1.Repository.ChildRepository;
import com.realnet.basicp1.Entity.Child
;import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.realnet.SequenceGenerator.Service.SequenceService;
import org.springframework.data.domain.Page;
import com.realnet.realm.Entity.Realm;
import com.realnet.realm.Services.RealmService;
import org.springframework.data.domain.Pageable;
import org.springframework.http.*;
import com.realnet.users.service1.AppUserServiceImpl;
import com.realnet.users.entity1.AppUser;
import org.springframework.stereotype.Service;
@Service
public class ChildService {
@Autowired
private ChildRepository Repository;
@Autowired
private AppUserServiceImpl userService;
@Autowired
private RealmService realmService;
public Child Savedata(Child data) {
data.setUpdatedBy(getUser().getUserId());
data.setCreatedBy(getUser().getUserId());
data.setAccountId(getUser().getAccount().getAccount_id());
Child save = Repository.save(data);
return save;
}
// get all with pagination
public Page<Child> getAllWithPagination(Pageable page) {
return Repository.findAll( getUser().getUserId(),page);
}
public List<Child> getdetails() {
List<Realm> realm = realmService.findByUserId(getUser().getUserId());
List<Child> all = Repository.findAll(getUser().getUserId());
return all ; }
public Child getdetailsbyId(Integer id) {
return Repository.findById(id).get();
}
public void delete_by_id(Integer id) {
Repository.deleteById(id);
}
public Child update(Child data,Integer id) {
Child old = Repository.findById(id).get();
old.setName(data.getName());
old.setDescription(data.getDescription());
old.setActive (data.getActive());
final Child test = Repository.save(old);
data.setUpdatedBy(getUser().getUserId());
return test;}
public AppUser getUser() {
AppUser user = userService.getLoggedInUser();
return user;
}}

View File

@@ -0,0 +1,42 @@
package com.realnet.basicp1.Services;
import com.realnet.basicp1.Repository.ChildRepository;
import com.realnet.basicp1.Entity.Child;
import java.util.List;
import org.springframework.http.ResponseEntity;
import java.util.ArrayList;
import org.springframework.http.HttpStatus;
import org.springframework.beans.factory.annotation.Autowired;
import com.realnet.basicp1.Entity.Adv4;
import com.realnet.basicp1.Repository.Adv4Repository;
import org.springframework.stereotype.Service;
@Service
public class ChildUpdateService4 {
@Autowired
private ChildRepository Repository;
@Autowired
private Adv4Repository adv4repository;
public ResponseEntity<?> updateaction(Integer id, Child child ) {
Integer i = 0; Adv4 adv4 = adv4repository.findById(id).get();
List<Child> list = new ArrayList<>();
Object ChildObject = adv4.getChild();
if (ChildObject instanceof List<?>) {
// If it's a list, cast and add all elements to the list
list.addAll((List<Child>) ChildObject);
} else if (ChildObject instanceof Child) {
// If it's a single Childb object, add it to the list
list.add((Child) ChildObject);
} for (Child li : list) { Child old = Repository.findById(li.getId()).get();
old.setActive(child.getActive());
old.setDescription(child.getDescription());
old.setName(child.getName());
final Child childdata = Repository.save(old);
i++;} return new ResponseEntity<>(i+" updated", HttpStatus.OK);
}}

View File

@@ -0,0 +1,93 @@
package com.realnet.basicp1.Services;
import com.realnet.basicp1.Repository.ContryRepository;
import com.realnet.basicp1.Entity.Contry
;import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.realnet.SequenceGenerator.Service.SequenceService;
import org.springframework.data.domain.Page;
import com.realnet.realm.Entity.Realm;
import com.realnet.realm.Services.RealmService;
import org.springframework.data.domain.Pageable;
import org.springframework.http.*;
import com.realnet.users.service1.AppUserServiceImpl;
import com.realnet.users.entity1.AppUser;
import org.springframework.stereotype.Service;
@Service
public class ContryService {
@Autowired
private ContryRepository Repository;
@Autowired
private AppUserServiceImpl userService;
@Autowired
private RealmService realmService;
public Contry Savedata(Contry data) {
data.setUpdatedBy(getUser().getUserId());
data.setCreatedBy(getUser().getUserId());
data.setAccountId(getUser().getAccount().getAccount_id());
Contry save = Repository.save(data);
return save;
}
// get all with pagination
public Page<Contry> getAllWithPagination(Pageable page) {
return Repository.findAll( getUser().getUserId(),page);
}
public List<Contry> getdetails() {
List<Realm> realm = realmService.findByUserId(getUser().getUserId());
List<Contry> all = Repository.findAll(getUser().getUserId());
return all ; }
public Contry getdetailsbyId(Integer id) {
return Repository.findById(id).get();
}
public void delete_by_id(Integer id) {
Repository.deleteById(id);
}
public Contry update(Contry data,Integer id) {
Contry old = Repository.findById(id).get();
old.setName(data.getName());
old.setDescription(data.getDescription());
old.setActive (data.getActive());
final Contry test = Repository.save(old);
data.setUpdatedBy(getUser().getUserId());
return test;}
public AppUser getUser() {
AppUser user = userService.getLoggedInUser();
return user;
}}

View File

@@ -0,0 +1,53 @@
package com.realnet.basicp1.Services;
import java.util.*;
import com.realnet.basicp1.Repository.ContryRepository;
import com.realnet.basicp1.Entity.Contry;
import com.realnet.basicp1.Entity.Contry_ListFilter1;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class Contry_ListFilter1Service {
@Autowired
private ContryRepository Repository;
public List<Contry_ListFilter1> getlistbuilder() {
List<Contry> list= Repository.findAll();
ArrayList<Contry_ListFilter1> l = new ArrayList<>();
for (Contry data : list) {
Boolean isActive = data.getActive();
if (Boolean.TRUE.equals(isActive)) {{
Contry_ListFilter1 dummy = new Contry_ListFilter1();
dummy.setId(data.getId());
dummy.setName(data.getName());
dummy.setDescription(data.getDescription());
l.add(dummy);
}}
}
return l;}
public List<Contry_ListFilter1> getlistbuilderparam( ) {
List<Contry> list= Repository.findAll();
ArrayList<Contry_ListFilter1> l = new ArrayList<>();
for (Contry data : list) {
Boolean isActive = data.getActive();
if (Boolean.TRUE.equals(isActive)) {{
Contry_ListFilter1 dummy = new Contry_ListFilter1();
dummy.setId(data.getId());
dummy.setName(data.getName());
dummy.setDescription(data.getDescription());
l.add(dummy);
}}
}
return l;}
}

View File

@@ -0,0 +1,103 @@
package com.realnet.basicp1.Services;
import com.realnet.basicp1.Repository.DistricRepository;
import com.realnet.basicp1.Entity.Distric
;import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.realnet.SequenceGenerator.Service.SequenceService;
import org.springframework.data.domain.Page;
import com.realnet.realm.Entity.Realm;
import com.realnet.realm.Services.RealmService;
import org.springframework.data.domain.Pageable;
import org.springframework.http.*;
import com.realnet.users.service1.AppUserServiceImpl;
import com.realnet.users.entity1.AppUser;
import org.springframework.stereotype.Service;
@Service
public class DistricService {
@Autowired
private DistricRepository Repository;
@Autowired
private AppUserServiceImpl userService;
@Autowired
private RealmService realmService;
public Distric Savedata(Distric data) {
data.setUpdatedBy(getUser().getUserId());
data.setCreatedBy(getUser().getUserId());
data.setAccountId(getUser().getAccount().getAccount_id());
Distric save = Repository.save(data);
return save;
}
// get all with pagination
public Page<Distric> getAllWithPagination(Pageable page) {
return Repository.findAll( getUser().getUserId(),page);
}
public List<Distric> getdetails() {
List<Realm> realm = realmService.findByUserId(getUser().getUserId());
List<Distric> all = Repository.findAll(getUser().getUserId());
return all ; }
public Distric getdetailsbyId(Integer id) {
return Repository.findById(id).get();
}
public void delete_by_id(Integer id) {
Repository.deleteById(id);
}
public Distric update(Distric data,Integer id) {
Distric old = Repository.findById(id).get();
old.setDistric_name(data.getDistric_name());
old.setDescription(data.getDescription());
old.setActive (data.getActive());
old.setState_name(data.getState_name());
final Distric test = Repository.save(old);
data.setUpdatedBy(getUser().getUserId());
return test;}
public AppUser getUser() {
AppUser user = userService.getLoggedInUser();
return user;
}}

View File

@@ -0,0 +1,57 @@
package com.realnet.basicp1.Services;
import java.util.*;
import com.realnet.basicp1.Repository.DistricRepository;
import com.realnet.basicp1.Entity.Distric;
import com.realnet.basicp1.Entity.Distric_ListFilter1;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class Distric_ListFilter1Service {
@Autowired
private DistricRepository Repository;
public List<Distric_ListFilter1> getlistbuilder() {
List<Distric> list= Repository.findAll();
ArrayList<Distric_ListFilter1> l = new ArrayList<>();
for (Distric 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)){
Distric_ListFilter1 dummy = new Distric_ListFilter1();
dummy.setId(data.getId());
dummy.setDistric_name(data.getDistric_name());
l.add(dummy);
}}
}
return l;}
public List<Distric_ListFilter1> getlistbuilderparam( String item) {
List<Distric> list= Repository.findAll();
ArrayList<Distric_ListFilter1> l = new ArrayList<>();
for (Distric 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)){
Distric_ListFilter1 dummy = new Distric_ListFilter1();
dummy.setId(data.getId());
dummy.setDistric_name(data.getDistric_name());
l.add(dummy);
}}
}
return l;}
}

View File

@@ -0,0 +1,103 @@
package com.realnet.basicp1.Services;
import com.realnet.basicp1.Repository.StateRepository;
import com.realnet.basicp1.Entity.State
;import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.realnet.SequenceGenerator.Service.SequenceService;
import org.springframework.data.domain.Page;
import com.realnet.realm.Entity.Realm;
import com.realnet.realm.Services.RealmService;
import org.springframework.data.domain.Pageable;
import org.springframework.http.*;
import com.realnet.users.service1.AppUserServiceImpl;
import com.realnet.users.entity1.AppUser;
import org.springframework.stereotype.Service;
@Service
public class StateService {
@Autowired
private StateRepository Repository;
@Autowired
private AppUserServiceImpl userService;
@Autowired
private RealmService realmService;
public State Savedata(State data) {
data.setUpdatedBy(getUser().getUserId());
data.setCreatedBy(getUser().getUserId());
data.setAccountId(getUser().getAccount().getAccount_id());
State save = Repository.save(data);
return save;
}
// get all with pagination
public Page<State> getAllWithPagination(Pageable page) {
return Repository.findAll( getUser().getUserId(),page);
}
public List<State> getdetails() {
List<Realm> realm = realmService.findByUserId(getUser().getUserId());
List<State> all = Repository.findAll(getUser().getUserId());
return all ; }
public State getdetailsbyId(Integer id) {
return Repository.findById(id).get();
}
public void delete_by_id(Integer id) {
Repository.deleteById(id);
}
public State update(State data,Integer id) {
State old = Repository.findById(id).get();
old.setState_name(data.getState_name());
old.setDescription(data.getDescription());
old.setActive (data.getActive());
old.setContry_name(data.getContry_name());
final State test = Repository.save(old);
data.setUpdatedBy(getUser().getUserId());
return test;}
public AppUser getUser() {
AppUser user = userService.getLoggedInUser();
return user;
}}

View File

@@ -0,0 +1,57 @@
package com.realnet.basicp1.Services;
import java.util.*;
import com.realnet.basicp1.Repository.StateRepository;
import com.realnet.basicp1.Entity.State;
import com.realnet.basicp1.Entity.State_ListFilter1;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class State_ListFilter1Service {
@Autowired
private StateRepository Repository;
public List<State_ListFilter1> getlistbuilder() {
List<State> list= Repository.findAll();
ArrayList<State_ListFilter1> l = new ArrayList<>();
for (State data : list) {
Boolean isActive = data.getActive();
if (Boolean.TRUE.equals(isActive)) {String Contry_name = data.getContry_name();
System.out.println(Contry_name + "\n");
if ("item".equals(Contry_name)){
State_ListFilter1 dummy = new State_ListFilter1();
dummy.setId(data.getId());
dummy.setState_name(data.getState_name());
l.add(dummy);
}}
}
return l;}
public List<State_ListFilter1> getlistbuilderparam( String item) {
List<State> list= Repository.findAll();
ArrayList<State_ListFilter1> l = new ArrayList<>();
for (State data : list) {
Boolean isActive = data.getActive();
if (Boolean.TRUE.equals(isActive)) {String Contry_name = data.getContry_name();
System.out.println(Contry_name + "\n");
if (item.equals(Contry_name)){
State_ListFilter1 dummy = new State_ListFilter1();
dummy.setId(data.getId());
dummy.setState_name(data.getState_name());
l.add(dummy);
}}
}
return l;}
}

View File

@@ -0,0 +1,31 @@
package com.realnet.basicp1.Services;
import com.realnet.basicp1.Repository.SupportRepository;
import com.realnet.basicp1.Entity.Support;
import java.util.List;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class SupportInsertService3 {
@Autowired
private SupportRepository Repository;
@Autowired
private AppUserServiceImpl userService;
public Support insertaction(Support support ) {
support.setUpdatedBy(getUser().getUserId());
support.setCreatedBy(getUser().getUserId());
support.setAccountId(getUser().getAccount().getAccount_id());
final Support save = Repository.save(support);
return save;
}
public AppUser getUser() {
AppUser user = userService.getLoggedInUser();
return user;
}}

View File

@@ -0,0 +1,83 @@
package com.realnet.basicp1.Services;
import com.realnet.basicp1.Repository.SupportRepository;
import com.realnet.basicp1.Entity.Support
;import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.realnet.SequenceGenerator.Service.SequenceService;
import org.springframework.data.domain.Page;
import com.realnet.realm.Entity.Realm;
import com.realnet.realm.Services.RealmService;
import org.springframework.data.domain.Pageable;
import org.springframework.http.*;
import com.realnet.users.service1.AppUserServiceImpl;
import com.realnet.users.entity1.AppUser;
import org.springframework.stereotype.Service;
@Service
public class SupportService {
@Autowired
private SupportRepository Repository;
@Autowired
private AppUserServiceImpl userService;
@Autowired
private RealmService realmService;
public Support Savedata(Support data) {
data.setUpdatedBy(getUser().getUserId());
data.setCreatedBy(getUser().getUserId());
data.setAccountId(getUser().getAccount().getAccount_id());
Support save = Repository.save(data);
return save;
}
// get all with pagination
public Page<Support> getAllWithPagination(Pageable page) {
return Repository.findAll( getUser().getUserId(),page);
}
public List<Support> getdetails() {
List<Realm> realm = realmService.findByUserId(getUser().getUserId());
List<Support> all = Repository.findAll(getUser().getUserId());
return all ; }
public Support getdetailsbyId(Integer id) {
return Repository.findById(id).get();
}
public void delete_by_id(Integer id) {
Repository.deleteById(id);
}
public Support update(Support data,Integer id) {
Support old = Repository.findById(id).get();
old.setName(data.getName());
old.setDescription(data.getDescription());
final Support test = Repository.save(old);
data.setUpdatedBy(getUser().getUserId());
return test;}
public AppUser getUser() {
AppUser user = userService.getLoggedInUser();
return user;
}}

View File

@@ -0,0 +1,225 @@
package com.realnet.basicp1.Services;
import com.realnet.basicp1.Repository.Test_aRepository;
import com.realnet.basicp1.Entity.Test_a
;import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.realnet.SequenceGenerator.Service.SequenceService;
import org.springframework.data.domain.Page;
import com.realnet.realm.Entity.Realm;
import com.realnet.realm.Services.RealmService;
import org.springframework.data.domain.Pageable;
import org.springframework.http.*;
import com.realnet.users.service1.AppUserServiceImpl;
import com.realnet.users.entity1.AppUser;
import org.springframework.stereotype.Service;
@Service
public class Test_aService {
@Autowired
private Test_aRepository Repository;
@Autowired
private AppUserServiceImpl userService;
@Autowired
private RealmService realmService;
@Autowired
private SequenceService documentsequencesequenceService;
public Test_a Savedata(Test_a data) {
data.setDocumentsequence (documentsequencesequenceService.GenerateSequence("nn"));
data.setUser_id(getUser().getUserId());
data.setUser_name(getUser().getFullName());
data.setUpdatedBy(getUser().getUserId());
data.setCreatedBy(getUser().getUserId());
data.setAccountId(getUser().getAccount().getAccount_id());
Test_a save = Repository.save(data);
return save;
}
// get all with pagination
public Page<Test_a> getAllWithPagination(Pageable page) {
return Repository.findAll( getUser().getUserId(),page);
}
public List<Test_a> getdetails() {
List<Realm> realm = realmService.findByUserId(getUser().getUserId());
List<Test_a> all = Repository.findAll(getUser().getUserId());
return all ; }
public Test_a getdetailsbyId(Integer id) {
return Repository.findById(id).get();
}
public void delete_by_id(Integer id) {
Repository.deleteById(id);
}
public Test_a update(Test_a data,Integer id) {
Test_a old = Repository.findById(id).get();
old.setText_field(data.getText_field());
old.setNumber_field(data.getNumber_field());
old.setPhone_number(data.getPhone_number());
old.setParagraph_field(data.getParagraph_field());
old.setPassword_field(data.getPassword_field());
old.setTextarea(data.getTextarea());
old.setDate_field(data.getDate_field());
old.setDatetime_field(data.getDatetime_field());
old.setEmail_field(data.getEmail_field());
old.setToggle_switch (data.getToggle_switch());
old.setUrl_field(data.getUrl_field());
old.setDecimal_field(data.getDecimal_field());
old.setPercentage_field(data.getPercentage_field());
old.setRecaptcha(data.getRecaptcha());
old.setDocumentsequence(data.getDocumentsequence());
final Test_a test = Repository.save(old);
data.setUpdatedBy(getUser().getUserId());
return test;}
public AppUser getUser() {
AppUser user = userService.getLoggedInUser();
return user;
}}

View File

@@ -0,0 +1,20 @@
CREATE TABLE dbb.Test_a(id BIGINT NOT NULL AUTO_INCREMENT, toggle_switch VARCHAR(400), number_field int, text_field VARCHAR(400), datetime_field VARCHAR(400), percentage_field int, phone_number VARCHAR(400), email_field VARCHAR(400), url_field VARCHAR(400), paragraph_field VARCHAR(400), textarea VARCHAR(400), recaptcha VARCHAR(400), userid_field VARCHAR(400), password_field VARCHAR(400), date_field Date, decimal_field double, documentsequence VARCHAR(400), PRIMARY KEY (id));
CREATE TABLE dbb.Distric(id BIGINT NOT NULL AUTO_INCREMENT, distric_name VARCHAR(400), active VARCHAR(400), description VARCHAR(400), state_name VARCHAR(400), PRIMARY KEY (id));
CREATE TABLE dbb.Contry(id BIGINT NOT NULL AUTO_INCREMENT, active VARCHAR(400), description VARCHAR(400), name VARCHAR(400), PRIMARY KEY (id));
CREATE TABLE dbb.State(id BIGINT NOT NULL AUTO_INCREMENT, active VARCHAR(400), description VARCHAR(400), state_name VARCHAR(400), contry_name VARCHAR(400), PRIMARY KEY (id));
CREATE TABLE dbb.Child(id BIGINT NOT NULL AUTO_INCREMENT, active VARCHAR(400), description VARCHAR(400), name VARCHAR(400), PRIMARY KEY (id));
CREATE TABLE dbb.Adv1(id BIGINT NOT NULL AUTO_INCREMENT, video_field VARCHAR(400), gender VARCHAR(400), testing bit(1), qrcode_field VARCHAR(400), last_name VARCHAR(400), fileupload_field VARCHAR(400), value_list_field VARCHAR(400), datagrid_field VARCHAR(400), name VARCHAR(400), java bit(1), selenium bit(1), currency VARCHAR(400), name VARCHAR(400), imageupload_field VARCHAR(400), audio_field VARCHAR(400), static VARCHAR(400), barcode_field VARCHAR(400), PRIMARY KEY (id));
CREATE TABLE dbb.Adv2s(id BIGINT NOT NULL AUTO_INCREMENT, auto_mul VARCHAR(400), dynamic VARCHAR(400), dyan_sel int, autoc int, sta_select VARCHAR(400), stat_mulsel VARCHAR(400), dyna_mul VARCHAR(400), name VARCHAR(400), PRIMARY KEY (id));
CREATE TABLE dbb.Support(id BIGINT NOT NULL AUTO_INCREMENT, description VARCHAR(400), name VARCHAR(400), PRIMARY KEY (id));
CREATE TABLE dbb.Adv3(id BIGINT NOT NULL AUTO_INCREMENT, distric VARCHAR(400), onetoone VARCHAR(400), age_1 int, calculated_sub VARCHAR(400), contry int, calculated_add VARCHAR(400), calculated_div VARCHAR(400), calculated_mul VARCHAR(400), state VARCHAR(400), age2 int, name VARCHAR(400), PRIMARY KEY (id));
CREATE TABLE dbb.Adv4(id BIGINT NOT NULL AUTO_INCREMENT, onetomanyextension VARCHAR(400), button_field VARCHAR(400), name VARCHAR(400), survey_form VARCHAR(400), PRIMARY KEY (id));

View File

@@ -0,0 +1,85 @@
//@import "../../../../assets/scss/var";
.s-info-bar {
display: flex;
flex-direction: row;
justify-content: space-between;
button {
outline: none;
}
}
.delete,.heading{
text-align: center;
color: red;
}
.entry-pg {
width: 750px;
}
.button1::after {
content: none;
}
.button1:hover::after {
content: "ADD ROWS";
}
.section {
background-color: #dddddd;
height: 40px;
}
.section p {
//color: white;
padding: 10px;
font-size: 18px;
}
.clr-input {
color: #212529;
border: 1px solid #ced4da;
border-radius: 0.25rem;
padding: 0.75rem 0.75rem;
margin-top: 3px;
width: 100%;
margin-bottom: 10px;
}
.clr-file {
color: #212529;
border: 1px solid #ced4da;
border-radius: 0.25rem;
//padding: 0.6rem 0.75rem;
margin-top: 3px;
width: 100%;
margin-bottom: 10px;
}
.center {
text-align: center;
}
select{
width: 100%;
margin-top: 3px;
padding: 5px 5px;
border: 1px solid #ccc;
border-radius: 4px;
}
input[type=text],[type=date],[type=number],textarea {
width: 100%;
padding: 15px 15px;
background-color:rgb(255, 255, 255);
// margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.error_mess {
color: red;
}
.universal-section-header {
margin: 24px 0 10px 0;
font-weight: 600;
color: #1a237e;
letter-spacing: 0.5px;
font-size: 1.25rem;
}

View File

@@ -0,0 +1,864 @@
import { Component, OnInit } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { AlertService } from 'src/app/services/alert.service';
import { Adv1service} from './Adv1.service';
import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms';
import { ExtensionService } from 'src/app/services/fnd/extension.service';
import { DashboardContentModel2 } from 'src/app/models/builder/dashboard';
import { Adv1cardvariable } from './Adv1_cardvariable';
import { UserInfoService } from 'src/app/services/user-info.service';
declare var JsBarcode: any;
@Component({
selector: 'app-Adv1',
templateUrl: './Adv1.component.html',
styleUrls: ['./Adv1.component.scss']
})
export class Adv1Component implements OnInit {
cardButton = Adv1cardvariable.cardButton;
cardmodeldata = Adv1cardvariable.cardmodeldata;
public dashboardArray: DashboardContentModel2[];
isCardview = Adv1cardvariable.cardButton;
cardmodal; changeView(){
this.isCardview = !this.isCardview;
}
beforeText(fieldtext: string): string { // Extract the text before the first '<'
const index = fieldtext.indexOf('<');
return index !== -1 ? fieldtext.substring(0, index) : fieldtext;
}
afterText(fieldtext: string): string { // Extract the text after the last '>'
const index = fieldtext.lastIndexOf('>');
return index !== -1 ? fieldtext.substring(index + 1) : '';
}
transform(fieldtext: string): string {
const match = fieldtext.match(/<([^>]*)>/);
return match ? match[1] : ''; // Extract the text between '<' and '>'
}
userrole;
rowSelected :any= {};
modaldelete=false;
modalEdit=false;
modalAdd= false;
public entryForm: FormGroup;
loading = false;
product;
modalOpenedforNewLine = false;
newLine:any;
additionalFieldsFromBackend: any[] = [];
formcode = 'Adv1_formCode'
tableName = 'Adv1'; checkFormCode; selected: any[] = []; constructor(
private extensionService: ExtensionService,
private userInfoService:UserInfoService,
private mainService:Adv1service,
private alertService: AlertService,
private toastr: ToastrService,
private _fb: FormBuilder,
) { }
private editInterval: any;
// component button
ngOnInit(): void {
if(this.cardmodeldata !== ''){
this.cardmodal = JSON.parse(this.cardmodeldata);
this.dashboardArray = this.cardmodal.dashboard.slice();
console.log(this.dashboardArray)
}
this.userrole=this.userInfoService.getRoles();
this.getData();
this.entryForm = this._fb.group({
name : [null],
gender : [null],
java:[false],
testing:[false],
selenium:[false],
currency : [null, { updateOn: 'blur' }],
qrcode_field : [null],
barcode_field : [null],
name:[null],
last_name:[null],
}); // component_button200
// form code start
this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => {
console.log(data);
const jsonArray = data.map((str) => JSON.parse(str));
this.additionalFieldsFromBackend = jsonArray;
this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Adv1_formCode");
console.log(this.checkFormCode);
console.log(this.additionalFieldsFromBackend);
if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) {
this.additionalFieldsFromBackend.forEach(field => {
if (field.formCode === this.formcode) {
if (!this.entryForm.contains(field.extValue)) {
// Add the control only if it doesn't exist in the form
this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue));
}
}
});
}
});
console.log(this.entryForm.value);
// form code end
}
ngOnDestroy(): void {
if (this.editInterval) {
clearInterval(this.editInterval);
}
}
FileDataImageupload_field: any[];
selectedImageupload_field: any[];
FileDataAudio_field: any[];
selectedAudio_field: any[];
FileDataVideo_field: any[];
selectedVideo_field: any[];
error;
getData() {
this.mainService.getAll().subscribe((data) => {
console.log(data);
this.product = data;
this.product = [...this.product].reverse(); if(this.product.length==0){
this.error="No Data Available"
}
},(error) => {
console.log(error);
if(error){
this.error="Server Error";
}
});
}
onEdit(row) {
this.rowSelected = row;
this.selectedfileupload_field = [];
this.mainService.uploadfilegetByIdfileupload_field(row.id,this.tableName).subscribe(uploaddata =>{
console.log(uploaddata);
this.FileDatafileupload_field = uploaddata;
})
this.selectedimageupload_field = [];
this.mainService.uploadImageupload_fieldgetById(row.id,this.tableName).subscribe(uploaddata =>{
console.log(uploaddata);
this.FileDataimageupload_field = uploaddata;
})
this.selectedaudio_field = [];
this.mainService.uploadAudio_fieldgetById(row.id,this.tableName).subscribe(uploaddata =>{
console.log(uploaddata);
this.FileDataaudio_field = uploaddata;
})
this.selectedvideo_field = [];
this.mainService.uploadVideo_fieldgetById(row.id,this.tableName).subscribe(uploaddata =>{
console.log(uploaddata);
this.FileDatavideo_field = uploaddata;
})
// bar code field start
setTimeout(function(){
JsBarcode("#barcodebarcode_field", row?.barcode_field);
}, 500);
// bar code field start
this.modalEdit = true;
}
onDelete(row) {
this.rowSelected = row;
this.modaldelete=true;
}
delete(id)
{
this.modaldelete = false;
console.log("in delete "+id);
this.mainService.delete(id).subscribe(
(data) => {
console.log(data);
this.ngOnInit();
if (data) { this.toastr.success('Deleted successfully'); }
});
}
onUpdate(id) {
this.modalEdit = false;
//console.log("in update");
console.log("id " + id);
console.log(this.rowSelected);
//console.log("out update");
this.mainService.update(id, this.rowSelected).subscribe(
(data) => {
console.log(data);
if (data || data.status >= 200 && data.status <= 299) {
this.toastr.success("Update Successfully");
}
setTimeout(() => {
this.ngOnInit();
}, 500);
for (let i = 0; i < this.selectedfileupload_field.length; i++){
this.mainService.uploadfilefileupload_field(data.id,this.tableName,this.selectedfileupload_field[i]).subscribe(uploaddata =>{
console.log(uploaddata);
})
}
for (let i = 0; i < this.selectedimageupload_field.length; i++){
this.mainService.uploadImageupload_field(data.id,this.tableName,this.selectedimageupload_field[i]).subscribe(uploaddata =>{
console.log(uploaddata);
})
}
for (let i = 0; i < this.selectedaudio_field.length; i++){
this.mainService.uploadAudio_field(data.id,this.tableName,this.selectedaudio_field[i]).subscribe(uploaddata =>{
console.log(uploaddata);
})
}
for (let i = 0; i < this.selectedvideo_field.length; i++){
this.mainService.uploadVideo_field(data.id,this.tableName,this.selectedvideo_field[i]).subscribe(uploaddata =>{
console.log(uploaddata);
})
}
}, (error) => {
console.log(error);
if (error.status >= 200 && error.status <= 299) {
// this.toastr.success("update Succesfully");
}
if (error.status >= 400 && error.status <= 499) {
this.toastr.error("Not Updated");
}
if (error.status >= 500 && error.status <= 599) {
this.toastr.error("Not Updated");
}
});
setTimeout(() => {
this.ngOnInit();
}, 500);
}
onCreate() {
this.modalAdd=false;
this.mainService.create(this.entryForm.value).subscribe(
(data) => {
console.log(data);
if (data || data.status >= 200 && data.status <= 299) {
this.toastr.success("Added Successfully");
}
setTimeout(() => {
this.ngOnInit();
}, 500);
for (let i = 0; i < this.selectedfileupload_field.length; i++){
this.mainService.uploadfilefileupload_field(data.id,this.tableName,this.selectedfileupload_field[i]).subscribe(uploaddata =>{
console.log(uploaddata);
})
}
for (let i = 0; i < this.selectedimageupload_field.length; i++){
this.mainService.uploadImageupload_field(data.id,this.tableName,this.selectedimageupload_field[i]).subscribe(uploaddata =>{
console.log(uploaddata);
})
}
for (let i = 0; i < this.selectedaudio_field.length; i++){
this.mainService.uploadAudio_field(data.id,this.tableName,this.selectedaudio_field[i]).subscribe(uploaddata =>{
console.log(uploaddata);
})
}
for (let i = 0; i < this.selectedvideo_field.length; i++){
this.mainService.uploadVideo_field(data.id,this.tableName,this.selectedvideo_field[i]).subscribe(uploaddata =>{
console.log(uploaddata);
})
}
}, (error) => {
console.log(error);
if (error.status >= 200 && error.status <= 299) {
// this.toastr.success("Added Succesfully");
}
if (error.status >= 400 && error.status <= 499) {
this.toastr.error("Not Added");
}
if (error.status >= 500 && error.status <= 599) {
this.toastr.error("Not Added");
}
});
setTimeout(() => {
this.ngOnInit();
}, 500);
}
goToAdd(row) {
this.modalAdd = true; this.submitted = false;
this.FileDatafileupload_field = [];
this.selectedfileupload_field =[];
this.FileDataImageupload_field = [];
this.selectedImageupload_field =[];
this.FileDataAudio_field = [];
this.selectedAudio_field =[];
this.FileDataVideo_field = [];
this.selectedVideo_field =[];
this.getdatagrid_fieldData();
}
submitted = false;
onSubmit() {
console.log(this.entryForm.value);
this.submitted = true;
if (this.entryForm.invalid) {
return;
}this.onCreate();
}
updategender (gender : string): void {
this.entryForm.get('gender').setValue(gender); }
updategenderEdit(gender : string): void { this.rowSelected.gender = gender }
;
filePreviewfileupload_field: string | ArrayBuffer | null = null;
FileDatafileupload_field: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array
selectedfileupload_field: File[]=[];
public onFileChangedfileupload_field(event, index) {
const files = event.target.files;
for (let i = 0; i < files.length; i++) {
const file = files[i];
this.FileDatafileupload_field[index].uploadedfile_name = files[i].name;
this.selectedfileupload_field.push(files[i]);
if (file.type.startsWith('file/')) {
const reader = new FileReader();
reader.onload = (e) => {
// Set the file preview source
const filePreview = e.target?.result as string;
this.FileDatafileupload_field[index] = {
...this.FileDatafileupload_field[index], // Preserve existing properties
filePreview: filePreview // Update only the filePreview property
};
};
reader.readAsDataURL(file);
}
}
}
onAddLinesfileupload_field(){
this.FileDatafileupload_field.push({
uploadedfile_name: "",
filePreview: "",
// f3: "",
});
}
deleteRowfileupload_field(index,id) {
this.FileDatafileupload_field.splice(index, 1);
if(id){
this.mainService.uploadfiledeletefileupload_field(id).subscribe(data =>{
console.log(data);
})
}
}
filePreviewimageupload_field: string | ArrayBuffer | null = null;
FileDataimageupload_field: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array
selectedimageupload_field: File[]=[];
public onFileChangedimageupload_field(event, index) {
const files = event.target.files;
for (let i = 0; i < files.length; i++) {
const file = files[i];
this.FileDataimageupload_field[index].uploadedfile_name = files[i].name;
this.selectedimageupload_field.push(files[i]);
if (file.type.startsWith('image/')) {
const reader = new FileReader();
reader.onload = (e) => {
// Set the file preview source
const filePreview = e.target?.result as string;
this.FileDataimageupload_field[index] = {
...this.FileDataimageupload_field[index], // Preserve existing properties
filePreview: filePreview // Update only the filePreview property
};
};
reader.readAsDataURL(file);
}
}
}
onAddLinesimageupload_field(){
this.FileDataimageupload_field.push({
uploadedfile_name: "",
filePreview: "",
// f3: "",
});
}
deleteRowimageupload_field(index,id) {
this.FileDataimageupload_field.splice(index, 1);
if(id){
this.mainService.uploadImageupload_fielddelete(id).subscribe(data =>{
console.log(data);
})
}
}
filePreviewaudio_field: string | ArrayBuffer | null = null;
FileDataaudio_field: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array
selectedaudio_field: File[]=[];
public onFileChangedaudio_field(event, index) {
const files = event.target.files;
for (let i = 0; i < files.length; i++) {
const file = files[i];
this.FileDataaudio_field[index].uploadedfile_name = files[i].name;
this.selectedaudio_field.push(files[i]);
if (file.type.startsWith('audio/')) {
const reader = new FileReader();
reader.onload = (e) => {
// Set the file preview source
const filePreview = e.target?.result as string;
this.FileDataaudio_field[index] = {
...this.FileDataaudio_field[index], // Preserve existing properties
filePreview: filePreview // Update only the filePreview property
};
};
reader.readAsDataURL(file);
}
}
}
onAddLinesaudio_field(){
this.FileDataaudio_field.push({
uploadedfile_name: "",
filePreview: "",
// f3: "",
});
}
deleteRowaudio_field(index,id) {
this.FileDataaudio_field.splice(index, 1);
if(id){
this.mainService.uploadAudio_fielddelete(id).subscribe(data =>{
console.log(data);
})
}
}
filePreviewvideo_field: string | ArrayBuffer | null = null;
FileDatavideo_field: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array
selectedvideo_field: File[]=[];
public onFileChangedvideo_field(event, index) {
const files = event.target.files;
for (let i = 0; i < files.length; i++) {
const file = files[i];
this.FileDatavideo_field[index].uploadedfile_name = files[i].name;
this.selectedvideo_field.push(files[i]);
if (file.type.startsWith('video/')) {
const reader = new FileReader();
reader.onload = (e) => {
// Set the file preview source
const filePreview = e.target?.result as string;
this.FileDatavideo_field[index] = {
...this.FileDatavideo_field[index], // Preserve existing properties
filePreview: filePreview // Update only the filePreview property
};
};
reader.readAsDataURL(file);
}
}
}
onAddLinesvideo_field(){
this.FileDatavideo_field.push({
uploadedfile_name: "",
filePreview: "",
// f3: "",
});
}
deleteRowvideo_field(index,id) {
this.FileDatavideo_field.splice(index, 1);
if(id){
this.mainService.uploadVideo_fielddelete(id).subscribe(data =>{
console.log(data);
})
}
}
//currency field start
formatCurrencycurrency () {
// Format the currency with two decimal places
this.rowSelected.currency = Number(this.rowSelected.currency ).toFixed(2);
// Remove commas from the formatted currency
this.rowSelected.currency = this.rowSelected.currency?.replace(/,/g, ''); }
//currency field end
//bar code field start
generateBarcodebarcode_field(value) {
const barcodeValue = value;
const barcodeElement = document.getElementById("barcodebarcode_field");
if (barcodeElement) { if (barcodeValue) {
JsBarcode(barcodeElement, barcodeValue, { format: "CODE128"
}); } else {
// Clear the barcode if the input is empty
barcodeElement.innerHTML = ''; } } }
// bar code field end
//Value List field start
value_list_fieldMode;
searchcusttextvalue_list_field :any;
valueListModalvalue_list_field :boolean=false;
openvalueListvalue_list_field(mode){
this.valueListModalvalue_list_field=!this.valueListModalvalue_list_field ;
this.value_list_fieldMode = mode; }
customerdatavalue_list_field ;
value_list_fielderror;
clickedvalue_list_fieldID:number;
getcustvalue_list_fieldID(id:number){
this.clickedvalue_list_fieldID=id;
console.log("clicked by id"+ id);
this.mainService.getById(id).subscribe((data) => { console.log(data);
if(this.value_list_fieldMode == "ADD"){
this.entryForm.get('name').setValue(data.name);
this.entryForm.get('currency').setValue(data.currency);
}else if(this.value_list_fieldMode == "EDIT"){
this.rowSelected.name= data. name
this.rowSelected.currency= data. currency
} }); this.valueListModalvalue_list_field =false;
} //value List field end
//datagrid datagrid_field filed start
productdatagrid_field;
rowsdatagrid_field :any[];
getHeadersdatagrid_field () {
this.rowsdatagrid_field = this.productdatagrid_field;
let headers: string[] = [];
if(this.rowsdatagrid_field ) {
this.rowsdatagrid_field.forEach((value) => {
Object.keys(value).forEach((key) => {
if(!headers.find((header) => header == key)){
headers.push(key)
}
})
})
}
return headers;
}
//datagrid datagrid_field filed end
getdatagrid_fieldData() {
this.mainService.getdatagrid_fieldAll().subscribe((data) => {
console.log(data); this.productdatagrid_field = data;
});
}
// updateaction
}

View File

@@ -0,0 +1,116 @@
import { Injectable } from '@angular/core';
import { Observable } from "rxjs";
import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http";
import { ApiRequestService } from "src/app/services/api/api-request.service";
import { environment } from 'src/environments/environment';
@Injectable({
providedIn: 'root'
})
export class Adv1service{
private baseURL = "Adv1/Adv1" ; constructor(
private http: HttpClient,
private apiRequest: ApiRequestService,
) { }
getAll(page?: number, size?: number): Observable<any> {
return this.apiRequest.get(this.baseURL);
}
getById(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.get(_http);
}
create(data: any): Observable<any> {
return this.apiRequest.post(this.baseURL, data);
}
update(id: number, data: any): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.put(_http, data);
}
delete(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.delete(_http);
}
uploadfilefileupload_field(ref:any, Adv1:any, file:any): Observable<any>{
const formData = new FormData();
formData.append('file', file);
return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Adv1}`, formData);
}
uploadfilegetByIdfileupload_field(ref:any, Adv1:any,): Observable<any> {
return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Adv1}`);
}
uploadfiledeletefileupload_field(id: number): Observable<any> {
return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`);
}
uploadImageupload_field(ref:any, Adv1:any, file:any): Observable<any>{
const formData = new FormData();
formData.append('file', file);
return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Adv1}`, formData);
}
uploadImageupload_fieldgetById(ref:any, Adv1:any,): Observable<any> {
return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Adv1}`);
}
uploadImageupload_fielddelete(id: number): Observable<any> {
return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`);
}
uploadAudio_field(ref:any, Adv1:any, file:any): Observable<any>{
const formData = new FormData();
formData.append('file', file);
return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Adv1}`, formData);
}
uploadAudio_fieldgetById(ref:any, Adv1:any,): Observable<any> {
return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Adv1}`);
}
uploadAudio_fielddelete(id: number): Observable<any> {
return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`);
}
uploadVideo_field(ref:any, Adv1:any, file:any): Observable<any>{
const formData = new FormData();
formData.append('file', file);
return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Adv1}`, formData);
}
uploadVideo_fieldgetById(ref:any, Adv1:any,): Observable<any> {
return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Adv1}`);
}
uploadVideo_fielddelete(id: number): Observable<any> {
return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`);
}
getdatagrid_fieldAll(page?: number, size?: number): Observable<any> {
return this.apiRequest.get("Contry_ListFilter1/Contry_ListFilter1");
}
// updateaction
}

View File

@@ -0,0 +1,4 @@
export const Adv1cardvariable = {
"cardButton": false,
"cardmodeldata": ``
}

View File

@@ -0,0 +1,671 @@
<ol class="breadcrumb breadcrumb-arrow font-trirong">
<li><a href="javascript://"> Adv2s</a></li>
</ol>
<div class="dg-wrapper">
<div class="clr-row">
<div class="clr-col-8">
<h3>Adv2s </h3>
</div>
<div class="clr-col-4" style="text-align: right;">
<button *ngIf="cardButton" id="add" class="btn btn-primary btn-icon" (click)="changeView()" >
<clr-icon *ngIf="!isCardview" shape="grid-view"></clr-icon> <clr-icon *ngIf="isCardview" shape="bars"></clr-icon>
</button>
<!-- button -->
<button id="add" class="btn btn-primary" (click)="goToAdd(product)" >
<clr-icon shape="plus"></clr-icon>ADD
</button>
</div></div>
<ng-container *ngIf="!isCardview"> <!-- GET ALL --> <clr-datagrid [clrDgLoading]="loading" [(clrDgSelected)]="selected">
<clr-dg-placeholder>
<ng-template #loadingSpinner>
<clr-spinner>Loading ... </clr-spinner>
</ng-template>
<div *ngIf="error;else loadingSpinner">{{error}}</div>
</clr-dg-placeholder>
<clr-dg-column [clrDgField]="'name'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Name
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'sta_select'"> <ng-container *clrDgHideableColumn="{hidden: false}"> sta select
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'stat_mulsel'"> <ng-container *clrDgHideableColumn="{hidden: false}"> stat mulsel
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'dyan_sel'"> <ng-container *clrDgHideableColumn="{hidden: false}"> dyan sel
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'dyna_mul'"> <ng-container *clrDgHideableColumn="{hidden: false}"> dyna mul
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'autoc'"> <ng-container *clrDgHideableColumn="{hidden: false}"> autoc
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'auto_mul'"> <ng-container *clrDgHideableColumn="{hidden: false}"> auto mul
</ng-container></clr-dg-column>
<!-- who column -->
<clr-dg-column> <ng-container *clrDgHideableColumn="{hidden: false}">
<clr-icon shape="bars"></clr-icon> Action
</ng-container></clr-dg-column>
<!-- end -->
<clr-dg-row *clrDgItems="let user of product" [clrDgItem]="user">
<clr-dg-cell>{{user.name }}</clr-dg-cell>
<clr-dg-cell>{{user.sta_select }}</clr-dg-cell>
<clr-dg-cell>{{user.stat_mulsel }}</clr-dg-cell>
<clr-dg-cell>{{user.dyan_selidentifier}}</clr-dg-cell>
<clr-dg-cell>{{user. dyna_mul }}</clr-dg-cell>
<clr-dg-cell>{{user.autocidentifier}}</clr-dg-cell>
<clr-dg-cell>{{user. auto_mul }}</clr-dg-cell>
<!-- who column -->
<clr-dg-cell>
<clr-signpost>
<span style="cursor: pointer;" clrSignpostTrigger><clr-icon shape="help" class="success" style="color: rgb(0, 130, 236);"></clr-icon></span>
<clr-signpost-content [clrPosition]="'left-middle'" *clrIfOpen>
<h5 style="margin-top: 0">Who Column</h5>
<div>Account ID: <code class="clr-code">{{user.accountId}}</code></div>
<div>Created At: <code class="clr-code">{{user.createdAt| date}}</code></div>
<div>Created By: <code class="clr-code">{{user.createdBy}}</code></div>
<div>Updated At: <code class="clr-code">{{user.updatedAt | date}}</code></div>
<div>Updated By: <code class="clr-code">{{user.updatedBy}}</code></div>
</clr-signpost-content>
</clr-signpost>
</clr-dg-cell>
<!-- who colmn -->
<clr-dg-action-overflow>
<button class="action-item" (click)="onEdit(user)">Edit</button>
<button class="action-item" (click)="onDelete(user)">Delete</button>
</clr-dg-action-overflow>
</clr-dg-row>
<clr-dg-footer>
<clr-dg-pagination #pagination [clrDgPageSize]="10">
<clr-dg-page-size [clrPageSizeOptions]="[10,20,50,100]">Users per page</clr-dg-page-size>
{{pagination.firstItem + 1}} - {{pagination.lastItem + 1}}
of {{pagination.totalItems}} users
</clr-dg-pagination>
</clr-dg-footer>
</clr-datagrid> </ng-container>
<ng-template #showInfo>
<div class="alert alert-info" role="alert">
<div class="alert-items">
<div class="alert-item static">
<span class="alert-text">
<clr-icon class="alert-icon" shape="info-circle"></clr-icon>
Data could be found. Loading..
<clr-spinner [clrMedium]="true">Loading ...</clr-spinner>
</span>
</div>
</div>
</div>
</ng-template><ng-container *ngIf="isCardview">
<div *ngIf="product; else showInfo" class="clr-row clr-align-items-start clr-justify-content-start">
<div *ngFor="let app of product| filter:search; let index = i" class="clr-col-auto" >
<div class="clr-row">
<div class="clr-col-lg-12 clr-col-md-4 clr-col-sm-4 clr-col-12" style="width: 410px;">
<div class="card" style="padding: 10px; "[style.background-color]="cardmodal.cardColor !== '' ? cardmodal.cardColor : 'white'">
<div class="card-body" style="display: grid; grid-template-columns: repeat(13, 1fr); grid-template-rows: repeat(7, 1fr); gap: 5px;">
<ng-container *ngFor="let item of dashboardArray">
<div [style.gridColumn]="item.x + 1" [style.gridRow]="item.y + 1" [style.gridColumnEnd]="item.x + item.cols + 1"
[style.gridRowEnd]="item.y + item.rows + 1">
<div *ngIf="item.name === 'textField'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'" [style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
{{beforeText(item.fieldtext)}}
{{ app[transform(item.fieldtext) ] }}
{{afterText(item.fieldtext)}}
</div>
<div *ngIf="item.name === 'dateField'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'" [style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
{{beforeText(item.fieldtext)}}
{{ app[transform(item.fieldtext) ] | date}}
{{afterText(item.fieldtext)}}
</div>
<div *ngIf="item.name === 'numberField'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'" [style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
{{beforeText(item.fieldtext)}}
{{ app[transform(item.fieldtext) ]}}
{{afterText(item.fieldtext)}}
</div>
<div *ngIf="item.name === 'Line'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'">
<hr>
</div>
<div *ngIf="item.name === 'Icon'" class="icon-card"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'"
>
<clr-icon [attr.shape]="item.iconName"></clr-icon>
</div>
<div *ngIf="item.name == 'Image'"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'"
[style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor"> <img id="filePreview" [src]="item.imageURL" alt="File Preview"
[style.width]="item.imagewidth !== '' ? item.imagewidth + 'px' : '100px'"
[style.height]="item.imagewidth !== '' ? item.imagewidth + 'px' : '100px'"></div>
</div>
</ng-container>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-container>
</div>
<!-- // EDIT DATA......... -->
<clr-modal [(clrModalOpen)]="modalEdit" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Update Adv2s
<!--update button -->
</h3>
<div class="modal-body" *ngIf="rowSelected.id">
<h2 class="heading">{{rowSelected.id}}</h2>
<!-- button -->
<form >
<div class="clr-row">
<div class="clr-col-sm-12">
<label>Name</label>
<input class="clr-input" type="text" [(ngModel)]="rowSelected.name" name="name" />
</div>
<div class="clr-col-sm-12">
<label> sta select</label>
<select name="sta_select" [(ngModel)]="rowSelected.sta_select">
<option [value]="null">Selectsta_select
</option>
<option> a </option>
<option> b </option>
</select> </div>
<div class="clr-col-sm-12">
<label> stat mulsel</label>
<clr-combobox-container style="margin-top: 0; padding-top: 0;">
<clr-combobox [(ngModel)]="nodeEditPropertiesstat_mulsel .editselectedAttributesstat_mulsel" name="
editselectedAttributesstat_mulsel" clrMulti="true">
<ng-container *clrOptionSelected="let selected">
{{selected}} </ng-container>
<clr-options>
<clr-option *clrOptionItems="let item of selectstat_mulsel" [clrValue]=" item"> {{item}}
</clr-option> </clr-options>
</clr-combobox>
</clr-combobox-container>
</div>
<div class="clr-col-sm-12">
<label>dyan sel</label>
<select name="dyan_sel" [(ngModel)]="rowSelected.dyan_sel">
<option [value]="null">Choose dyan_sel</option>
<option *ngFor=" let item of selectdyan_sel" [value]="item.id">{{item.name }}</option> </select> </div>
<div class="clr-col-sm-12">
<label> dyna mul</label>
<clr-combobox-container style="margin-top: 0; padding-top: 0;">
<clr-combobox [(ngModel)]="nodeEditPropertiesdyna_mul.editselectedAttributesdyna_mul" name="editselectedAttributesdyna_mul" clrMulti="true" >
<ng-container *clrOptionSelected="let selected">
{{selected}} </ng-container>
<clr-options>
<clr-option *clrOptionItems="let item of selectdyna_mul" [clrValue]="item.name">{{item.name}} </clr-option> </clr-options>
</clr-combobox>
</clr-combobox-container> </div>
<div class="clr-col-sm-12">
<label> autoc</label>
<input type="text" list="autocconfig" class="clr-input" name="autoc" [(ngModel)]="rowSelected.autoc">
<datalist id="autocconfig">
<option *ngFor="let item of selectautoc" [value]="item.id">{{item.name }}</option> </datalist> </div>
<div class="clr-col-sm-12">
<label> auto mul</label>
<clr-combobox-container style="margin-top: 0; padding-top: 0;">
<clr-combobox [(ngModel)]="nodeEditPropertiesauto_mul.editselectedAttributesauto_mul" name="editselectedAttributesauto_mul" clrMulti="true" >
<ng-container *clrOptionSelected="let selected">
{{selected}} </ng-container>
<clr-options>
<clr-option *clrOptionItems="let item of selectauto_mul" [clrValue]="item.name">{{item.name}} </clr-option> </clr-options>
</clr-combobox>
</clr-combobox-container> </div>
</div>
<!-- form code start -->
<div *ngIf="checkFormCode">
<h4 style="font-weight: 300;display: inline;">Extension</h4>
<br>
<hr>
<div class="clr-row">
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'text'" [type]="field.fieldType" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" class="clr-input" />
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'date'" [type]="field.fieldType" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" class="clr-input" />
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
<textarea *ngSwitchCase="'textarea'" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" col="10" row="2"></textarea>
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" class="clr-checkbox" />
</ng-container>
</div>
</div>
</div>
<!-- form code end --> <div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalEdit = false">Cancel</button>
<button type="submit" class="btn btn-primary" (click)="onUpdate(rowSelected.id)">Update</button>
</div>
</form>
</div>
</clr-modal>
<clr-modal [(clrModalOpen)]="modaldelete" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<div class="modal-body" *ngIf="rowSelected.id">
<h1 class="delete">Are You Sure Want to delete?</h1>
<h2 class="heading">{{rowSelected.id}}</h2>
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modaldelete = false">Cancel</button>
<button type="button" (click)="delete(rowSelected.id)" class="btn btn-primary" >Delete</button>
</div>
</div>
</clr-modal>
<!-- ADD FORM ..... -->
<clr-modal [(clrModalOpen)]="modalAdd" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Add Adv2s
<!-- aeroplane icon -->
&nbsp; &nbsp; &nbsp; &nbsp;
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
class="tooltip tooltip-sm tooltip-bottom-left">
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Adv2s_formCode' }">
<clr-icon shape="airplane" size="32"></clr-icon>
</a>
<span class="tooltip-content">Form Extension</span>
</a> </h3>
<div class="modal-body">
<form [formGroup]="entryForm" >
<div class="clr-row" style="height: fit-content;">
<div class="clr-col-sm-12">
<label> Name</label>
<input class="clr-input" type="text" formControlName="name" />
</div>
<div class="clr-col-sm-12">
<label>sta select</label>
<select formControlName="sta_select">
<option [value]="null">Select sta select </option>
<option> a </option>
<option> b </option>
</select></div>
<div class="clr-col-sm-12">
<label>stat mulsel</label>
<clr-combobox-container style="margin-top: 0; padding-top: 0;">
<clr-combobox [(ngModel)]="nodeEditPropertiesstat_mulsel.addselectedAttributesstat_mulsel" formControlName="stat_mulsel" clrMulti="true">
<ng-container *clrOptionSelected="let selected">
{{selected}} </ng-container>
<clr-options>
<clr-option *clrOptionItems="let item of selectstat_mulsel" [clrValue]="item"> {{item}}
</clr-option> </clr-options>
</clr-combobox>
</clr-combobox-container> </div>
<div class="clr-col-sm-12">
<label> dyan sel</label>
<select formControlName="dyan_sel">
<option [value]="null">Choose dyan sel</option>
<option *ngFor="let item of selectdyan_sel" [value]="item.id">{{item.name}}</option>
</select> </div>
<!-- order form start -->
<div *ngIf="isdyan_selorder" class="clr-col-sm-12" style="margin-bottom: 10px;">
<button type="button" class="btn btn-primary" (click)="adddyan_selOrder()">
+ Add to Order
</button>
</div>
<!-- Order Summary Table -->
<div class="clr-col-sm-12" *ngIf="dyan_selSummary.length > 0">
<h4>Order Summary</h4>
<table class="table table-bordered">
<thead>
<tr>
<th>Line</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of dyan_selSummary; let i = index">
<td>{{ item.line }}</td>
<td>
<button type="button" class="btn btn-danger btn-sm" (click)="removedyan_selOrder(i)">
🗑
</button>
</td>
</tr>
</tbody>
</table>
<div style="max-width: 350px; float: right; margin-top: 18px;">
<table style="width: 100%; font-size: 16px;">
<tr>
<td style="text-align: right; font-weight: 500; color: #333;">Subtotal:</td>
<td style="text-align: right; font-weight: 600; color: #222; width: 120px;">₹ {{ getdyan_selSubtotal() | number:'1.4-4' }}</td>
</tr>
<tr>
<td style="text-align: right; font-weight: 500; color: #333;">GST (18%):</td>
<td style="text-align: right; font-weight: 600; color: #007bff;">₹ {{ getdyan_selGST() | number:'1.4-4' }}</td>
</tr>
<tr>
<td colspan="2"><hr style="margin: 8px 0;"></td>
</tr>
<tr>
<td style="text-align: right; font-size: 18px; font-weight: 700; color: #1a237e;">Total:</td>
<td style="text-align: right; font-size: 20px; font-weight: 700; color: #1a237e;">₹ {{ getdyan_selGrandTotal() | number:'1.4-4' }}</td>
</tr>
</table>
</div>
</div>
<!-- order form end -->
<div class="clr-col-sm-12">
<label>dyna mul</label>
<clr-combobox-container style="margin-top: 0; padding-top: 0;">
<clr-combobox [(ngModel)]="nodeEditPropertiesdyna_mul.addselectedAttributesdyna_mul" formControlName="dyna_mul" clrMulti="true" >
<ng-container *clrOptionSelected="let selected">
{{selected}} </ng-container>
<clr-options>
<clr-option *clrOptionItems="let item of selectdyna_mul" [clrValue]="item. name"> {{item. name}}</clr-option></clr-options>
</clr-combobox>
</clr-combobox-container> </div>
<div class="clr-col-sm-12" >
<label> autoc</label>
<input type="text" list="autocconfig" class="clr-input" formControlName="autoc">
<datalist id="autocconfig"> <option *ngFor="let item of selectautoc" [value]="item.id">{{item. name }}</option> </datalist> </div>
<div class="clr-col-sm-12">
<label>auto mul</label>
<clr-combobox-container style="margin-top: 0; padding-top: 0;">
<clr-combobox [(ngModel)]="nodeEditPropertiesauto_mul.addselectedAttributesauto_mul" formControlName="auto_mul" clrMulti="true" >
<ng-container *clrOptionSelected="let selected">
{{selected}} </ng-container>
<clr-options>
<clr-option *clrOptionItems="let item of selectauto_mul" [clrValue]="item. name"> {{item. name}}</clr-option></clr-options>
</clr-combobox>
</clr-combobox-container> </div>
</div>
<!-- form code start -->
<div *ngIf="checkFormCode">
<h4 style="font-weight: 300;display: inline;">Extension</h4>
<br>
<hr>
<div class="clr-row">
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'text'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'date'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
<textarea *ngSwitchCase="'textarea'" [formControlName]="field.extValue" col="10" row="2"></textarea>
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-checkbox" />
</ng-container>
</div>
</div>
</div>
<!-- form code end --> <div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
<button type="submit" class="btn btn-primary" (click)="onSubmit()">ADD</button>
</div>
</form>
</div>
</clr-modal>
<!-- htmlpopup -->

View File

@@ -0,0 +1,85 @@
//@import "../../../../assets/scss/var";
.s-info-bar {
display: flex;
flex-direction: row;
justify-content: space-between;
button {
outline: none;
}
}
.delete,.heading{
text-align: center;
color: red;
}
.entry-pg {
width: 750px;
}
.button1::after {
content: none;
}
.button1:hover::after {
content: "ADD ROWS";
}
.section {
background-color: #dddddd;
height: 40px;
}
.section p {
//color: white;
padding: 10px;
font-size: 18px;
}
.clr-input {
color: #212529;
border: 1px solid #ced4da;
border-radius: 0.25rem;
padding: 0.75rem 0.75rem;
margin-top: 3px;
width: 100%;
margin-bottom: 10px;
}
.clr-file {
color: #212529;
border: 1px solid #ced4da;
border-radius: 0.25rem;
//padding: 0.6rem 0.75rem;
margin-top: 3px;
width: 100%;
margin-bottom: 10px;
}
.center {
text-align: center;
}
select{
width: 100%;
margin-top: 3px;
padding: 5px 5px;
border: 1px solid #ccc;
border-radius: 4px;
}
input[type=text],[type=date],[type=number],textarea {
width: 100%;
padding: 15px 15px;
background-color:rgb(255, 255, 255);
// margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.error_mess {
color: red;
}
.universal-section-header {
margin: 24px 0 10px 0;
font-weight: 600;
color: #1a237e;
letter-spacing: 0.5px;
font-size: 1.25rem;
}

View File

@@ -0,0 +1,537 @@
import { Component, OnInit } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { AlertService } from 'src/app/services/alert.service';
import { Adv2sservice} from './Adv2s.service';
import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms';
import { ExtensionService } from 'src/app/services/fnd/extension.service';
import { DashboardContentModel2 } from 'src/app/models/builder/dashboard';
import { Adv2scardvariable } from './Adv2s_cardvariable';
import { UserInfoService } from 'src/app/services/user-info.service';
declare var JsBarcode: any;
@Component({
selector: 'app-Adv2s',
templateUrl: './Adv2s.component.html',
styleUrls: ['./Adv2s.component.scss']
})
export class Adv2sComponent implements OnInit {
cardButton = Adv2scardvariable.cardButton;
cardmodeldata = Adv2scardvariable.cardmodeldata;
public dashboardArray: DashboardContentModel2[];
isCardview = Adv2scardvariable.cardButton;
cardmodal; changeView(){
this.isCardview = !this.isCardview;
}
beforeText(fieldtext: string): string { // Extract the text before the first '<'
const index = fieldtext.indexOf('<');
return index !== -1 ? fieldtext.substring(0, index) : fieldtext;
}
afterText(fieldtext: string): string { // Extract the text after the last '>'
const index = fieldtext.lastIndexOf('>');
return index !== -1 ? fieldtext.substring(index + 1) : '';
}
transform(fieldtext: string): string {
const match = fieldtext.match(/<([^>]*)>/);
return match ? match[1] : ''; // Extract the text between '<' and '>'
}
userrole;
rowSelected :any= {};
modaldelete=false;
modalEdit=false;
modalAdd= false;
public entryForm: FormGroup;
loading = false;
product;
modalOpenedforNewLine = false;
newLine:any;
additionalFieldsFromBackend: any[] = [];
formcode = 'Adv2s_formCode'
tableName = 'Adv2s'; checkFormCode; selected: any[] = []; constructor(
private extensionService: ExtensionService,
private userInfoService:UserInfoService,
private mainService:Adv2sservice,
private alertService: AlertService,
private toastr: ToastrService,
private _fb: FormBuilder,
) { }
private editInterval: any;
// component button
ngOnInit(): void {
if(this.cardmodeldata !== ''){
this.cardmodal = JSON.parse(this.cardmodeldata);
this.dashboardArray = this.cardmodal.dashboard.slice();
console.log(this.dashboardArray)
}
this.userrole=this.userInfoService.getRoles();
this.getData();
this.entryForm = this._fb.group({
name : [null],
sta_select : [null],
stat_mulsel : [null],
dyan_sel : [null],
dyna_mul : [null],
autoc : [null],
auto_mul : [null],
}); // component_button200
// form code start
this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => {
console.log(data);
const jsonArray = data.map((str) => JSON.parse(str));
this.additionalFieldsFromBackend = jsonArray;
this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Adv2s_formCode");
console.log(this.checkFormCode);
console.log(this.additionalFieldsFromBackend);
if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) {
this.additionalFieldsFromBackend.forEach(field => {
if (field.formCode === this.formcode) {
if (!this.entryForm.contains(field.extValue)) {
// Add the control only if it doesn't exist in the form
this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue));
}
}
});
}
});
console.log(this.entryForm.value);
// form code end
this.getalldyan_sel();
if (this.dyan_seldefault) {
// Listen for product changes to auto-fill description
this.entryForm.get('dyan_sel')?.valueChanges.subscribe(name => {
if (name && this.selectdyan_sel) {
const found = this.selectdyan_sel.find(p => p.name === name);
console.log('found is ', found);
// Auto-fill price when product is selected
if (found && found.default_field) {
this.entryForm.patchValue({ default_field: found.default_field_link });
} else {
this.entryForm.patchValue({ default_field: null });
}
}
});
}
this.getalldyna_mul();
this.getallautoc();
this.getallauto_mul();
}
ngOnDestroy(): void {
if (this.editInterval) {
clearInterval(this.editInterval);
}
}
error;
getData() {
this.mainService.getAll().subscribe((data) => {
console.log(data);
this.product = data;
this.product = [...this.product].reverse(); if(this.product.length==0){
this.error="No Data Available"
}
},(error) => {
console.log(error);
if(error){
this.error="Server Error";
}
});
}
onEdit(row) {
this.rowSelected = row;
this.nodeEditPropertiesstat_mulsel.editselectedAttributesstat_mulsel = JSON.parse(this.rowSelected.stat_mulsel );
this.nodeEditPropertiesdyna_mul.editselectedAttributesdyna_mul = JSON.parse(this.rowSelected.dyna_mul );
this.nodeEditPropertiesauto_mul.editselectedAttributesauto_mul = JSON.parse(this.rowSelected.auto_mul );
this.modalEdit = true;
}
onDelete(row) {
this.rowSelected = row;
this.modaldelete=true;
}
delete(id)
{
this.modaldelete = false;
console.log("in delete "+id);
this.mainService.delete(id).subscribe(
(data) => {
console.log(data);
this.ngOnInit();
if (data) { this.toastr.success('Deleted successfully'); }
});
}
onUpdate(id) {
this.modalEdit = false;
this.rowSelected.stat_mulsel = JSON.stringify(this.nodeEditPropertiesstat_mulsel.editselectedAttributesstat_mulsel );
this.rowSelected.dyna_mul = JSON.stringify(this.nodeEditPropertiesdyna_mul.editselectedAttributesdyna_mul );
this.rowSelected.auto_mul = JSON.stringify(this.nodeEditPropertiesauto_mul.editselectedAttributesauto_mul );
//console.log("in update");
console.log("id " + id);
console.log(this.rowSelected);
//console.log("out update");
this.mainService.update(id, this.rowSelected).subscribe(
(data) => {
console.log(data);
if (data || data.status >= 200 && data.status <= 299) {
this.toastr.success("Update Successfully");
}
setTimeout(() => {
this.ngOnInit();
}, 500);
}, (error) => {
console.log(error);
if (error.status >= 200 && error.status <= 299) {
// this.toastr.success("update Succesfully");
}
if (error.status >= 400 && error.status <= 499) {
this.toastr.error("Not Updated");
}
if (error.status >= 500 && error.status <= 599) {
this.toastr.error("Not Updated");
}
});
setTimeout(() => {
this.ngOnInit();
}, 500);
}
onCreate() {
this.modalAdd=false;
this.entryForm.value.stat_mulsel = JSON.stringify(this.nodeEditPropertiesstat_mulsel.addselectedAttributesstat_mulsel );
this.entryForm.value.dyna_mul = JSON.stringify(this.nodeEditPropertiesdyna_mul.addselectedAttributesdyna_mul );
this.entryForm.value.auto_mul = JSON.stringify(this.nodeEditPropertiesauto_mul.addselectedAttributesauto_mul );
this.mainService.create(this.entryForm.value).subscribe(
(data) => {
console.log(data);
if (data || data.status >= 200 && data.status <= 299) {
this.toastr.success("Added Successfully");
}
setTimeout(() => {
this.ngOnInit();
}, 500);
}, (error) => {
console.log(error);
if (error.status >= 200 && error.status <= 299) {
// this.toastr.success("Added Succesfully");
}
if (error.status >= 400 && error.status <= 499) {
this.toastr.error("Not Added");
}
if (error.status >= 500 && error.status <= 599) {
this.toastr.error("Not Added");
}
});
setTimeout(() => {
this.ngOnInit();
}, 500);
}
goToAdd(row) {
this.modalAdd = true; this.submitted = false;
this.nodeEditPropertiesdyna_mul.addselectedAttributesdyna_mul = ""
this.nodeEditPropertiesauto_mul.addselectedAttributesauto_mul = ""
}
submitted = false;
onSubmit() {
console.log(this.entryForm.value);
this.submitted = true;
if (this.entryForm.invalid) {
return;
}this.onCreate();
}
nodeEditPropertiesstat_mulsel = { addselectedAttributesstat_mulsel :"", editselectedAttributesstat_mulsel :"" }
selectstat_mulsel =[
'x',
'y',
'z',
];
dyan_seldefault=false
selectdyan_sel ;
getalldyan_sel() {
this.mainService.getAlldyan_sel().subscribe(data=>{
this.selectdyan_sel = data;
console.log(data);
},(error) => { console.log(error); }); }
// ================== ORDER SUMMARY LOGIC START ==================
/**
* Order Summary Array and Methods for Add to Order functionality
*/
dyan_selSummary: any[] = [];
dyan_seltotal;
isdyan_selorder =false;
/**
* Add selected product to order summary
*/
adddyan_selOrder() {
const formValue = this.entryForm.value;
if (!formValue.dyan_sel ) {
this.toastr.error('Please select dyan sel');
return;
}
// Get description from master (selectdyan_sel)
if (this.selectdyan_sel && Array.isArray(this.selectdyan_sel)) {
const found = this.selectdyan_sel.find(p => p.name === formValue.dyan_sel);
}
const line = this.dyan_selSummary.length + 1;
const orderItem = {
line: line,
// unitPrice: Number(formValue.price),
// quantity: Number(formValue.quantity),
// total: Number(formValue.price) * Number(formValue.quantity)
};
this.dyan_selSummary.push(orderItem);
this.dyan_seltotal = '';
}
/**
* Remove item from order summary by index
*/
removedyan_selOrder(index: number) {
this.dyan_selSummary.splice(index, 1);
// Recalculate line numbers
this.dyan_selSummary.forEach((item, i) => {
item.line = i + 1;
});
}
/**
* Calculate subtotal of all order items
*/
getdyan_selSubtotal(): number {
return this.dyan_selSummary.reduce((sum, item) => sum + item.total, 0);
}
/**
* Calculate GST (18%)
*/
getdyan_selGST(): number {
return this.getdyan_selSubtotal() * 0.18;
}
/**
* Calculate grand total (subtotal + GST)
*/
getdyan_selGrandTotal(): number {
return this.getdyan_selSubtotal() + this.getdyan_selGST();
}
// ================== ORDER SUMMARY LOGIC END ==================
selectdyna_mul;
getalldyna_mul () {
this.mainService.getAlldyna_mul().subscribe(data=>{
this.selectdyna_mul = data;
console.log(data);
},(error) => { console.log(error); }); }
nodeEditPropertiesdyna_mul = { addselectedAttributesdyna_mul:"", editselectedAttributesdyna_mul :"" }
selectautoc ;
getallautoc () {
this.mainService.getAllautoc().subscribe(data=>{
this.selectautoc = data; console.log(data);
},(error) => { console.log(error); }); }
selectauto_mul;
getallauto_mul () {
this.mainService.getAllauto_mul().subscribe(data=>{
this.selectauto_mul = data;
console.log(data);
},(error) => { console.log(error); }); }
nodeEditPropertiesauto_mul = { addselectedAttributesauto_mul:"", editselectedAttributesauto_mul :"" }
// updateaction
}

View File

@@ -0,0 +1,50 @@
import { Injectable } from '@angular/core';
import { Observable } from "rxjs";
import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http";
import { ApiRequestService } from "src/app/services/api/api-request.service";
import { environment } from 'src/environments/environment';
@Injectable({
providedIn: 'root'
})
export class Adv2sservice{
private baseURL = "Adv2s/Adv2s" ; constructor(
private http: HttpClient,
private apiRequest: ApiRequestService,
) { }
getAll(page?: number, size?: number): Observable<any> {
return this.apiRequest.get(this.baseURL);
}
getById(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.get(_http);
}
create(data: any): Observable<any> {
return this.apiRequest.post(this.baseURL, data);
}
update(id: number, data: any): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.put(_http, data);
}
delete(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.delete(_http);
}
getAlldyan_sel(): Observable<any> {
return this.apiRequest.get("Contry_ListFilter1/Contry_ListFilter1"); }
getAlldyna_mul(): Observable<any> { return this.apiRequest.get("Contry_ListFilter1/Contry_ListFilter1"); }
getAllautoc(): Observable<any> { return this.apiRequest.get("Contry_ListFilter1/Contry_ListFilter1"); }
getAllauto_mul(): Observable<any> { return this.apiRequest.get("Contry_ListFilter1/Contry_ListFilter1"); }
// updateaction
}

View File

@@ -0,0 +1,4 @@
export const Adv2scardvariable = {
"cardButton": false,
"cardmodeldata": ``
}

View File

@@ -0,0 +1,772 @@
<ol class="breadcrumb breadcrumb-arrow font-trirong">
<li><a href="javascript://"> Adv3</a></li>
</ol>
<div class="dg-wrapper">
<div class="clr-row">
<div class="clr-col-8">
<h3>Adv3 </h3>
</div>
<div class="clr-col-4" style="text-align: right;">
<button *ngIf="cardButton" id="add" class="btn btn-primary btn-icon" (click)="changeView()" >
<clr-icon *ngIf="!isCardview" shape="grid-view"></clr-icon> <clr-icon *ngIf="isCardview" shape="bars"></clr-icon>
</button>
<!-- button -->
<button id="add" class="btn btn-primary" (click)="goToAdd(product)" >
<clr-icon shape="plus"></clr-icon>ADD
</button>
</div></div>
<ng-container *ngIf="!isCardview"> <!-- GET ALL --> <clr-datagrid [clrDgLoading]="loading" [(clrDgSelected)]="selected">
<clr-dg-placeholder>
<ng-template #loadingSpinner>
<clr-spinner>Loading ... </clr-spinner>
</ng-template>
<div *ngIf="error;else loadingSpinner">{{error}}</div>
</clr-dg-placeholder>
<clr-dg-column [clrDgField]="'name'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Name
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'child.active'"> <ng-container *clrDgHideableColumn="{hidden: false}">active</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'child.description'"> <ng-container *clrDgHideableColumn="{hidden: false}">description</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'child.name'"> <ng-container *clrDgHideableColumn="{hidden: false}">name</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'age_1'"> <ng-container *clrDgHideableColumn="{hidden: false}"> age 1
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'age2'"> <ng-container *clrDgHideableColumn="{hidden: false}"> age2
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'contry'"> <ng-container *clrDgHideableColumn="{hidden: false}"> contry
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'state'"> <ng-container *clrDgHideableColumn="{hidden: false}"> state
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'distric'"> <ng-container *clrDgHideableColumn="{hidden: false}"> distric
</ng-container></clr-dg-column>
<!-- who column -->
<clr-dg-column> <ng-container *clrDgHideableColumn="{hidden: false}">
<clr-icon shape="bars"></clr-icon> Action
</ng-container></clr-dg-column>
<!-- end -->
<clr-dg-row *clrDgItems="let user of product" [clrDgItem]="user">
<clr-dg-cell>{{user.name }}</clr-dg-cell>
<clr-dg-cell>{{user.child?.active}}</clr-dg-cell>
<clr-dg-cell>{{user.child?.description}}</clr-dg-cell>
<clr-dg-cell>{{user.child?.name}}</clr-dg-cell>
<clr-dg-cell>{{user.age_1 }}</clr-dg-cell>
<clr-dg-cell>{{user.age2 }}</clr-dg-cell>
<clr-dg-cell>{{user.contryidentifier}}</clr-dg-cell>
<clr-dg-cell>{{user.state }}</clr-dg-cell>
<clr-dg-cell>{{user.distric }}</clr-dg-cell>
<!-- who column -->
<clr-dg-cell>
<clr-signpost>
<span style="cursor: pointer;" clrSignpostTrigger><clr-icon shape="help" class="success" style="color: rgb(0, 130, 236);"></clr-icon></span>
<clr-signpost-content [clrPosition]="'left-middle'" *clrIfOpen>
<h5 style="margin-top: 0">Who Column</h5>
<div>Account ID: <code class="clr-code">{{user.accountId}}</code></div>
<div>Created At: <code class="clr-code">{{user.createdAt| date}}</code></div>
<div>Created By: <code class="clr-code">{{user.createdBy}}</code></div>
<div>Updated At: <code class="clr-code">{{user.updatedAt | date}}</code></div>
<div>Updated By: <code class="clr-code">{{user.updatedBy}}</code></div>
</clr-signpost-content>
</clr-signpost>
</clr-dg-cell>
<!-- who colmn -->
<clr-dg-action-overflow>
<button class="action-item" (click)="onEdit(user)">Edit</button>
<button class="action-item" (click)="onDelete(user)">Delete</button>
</clr-dg-action-overflow>
</clr-dg-row>
<clr-dg-footer>
<clr-dg-pagination #pagination [clrDgPageSize]="10">
<clr-dg-page-size [clrPageSizeOptions]="[10,20,50,100]">Users per page</clr-dg-page-size>
{{pagination.firstItem + 1}} - {{pagination.lastItem + 1}}
of {{pagination.totalItems}} users
</clr-dg-pagination>
</clr-dg-footer>
</clr-datagrid> </ng-container>
<ng-template #showInfo>
<div class="alert alert-info" role="alert">
<div class="alert-items">
<div class="alert-item static">
<span class="alert-text">
<clr-icon class="alert-icon" shape="info-circle"></clr-icon>
Data could be found. Loading..
<clr-spinner [clrMedium]="true">Loading ...</clr-spinner>
</span>
</div>
</div>
</div>
</ng-template><ng-container *ngIf="isCardview">
<div *ngIf="product; else showInfo" class="clr-row clr-align-items-start clr-justify-content-start">
<div *ngFor="let app of product| filter:search; let index = i" class="clr-col-auto" >
<div class="clr-row">
<div class="clr-col-lg-12 clr-col-md-4 clr-col-sm-4 clr-col-12" style="width: 410px;">
<div class="card" style="padding: 10px; "[style.background-color]="cardmodal.cardColor !== '' ? cardmodal.cardColor : 'white'">
<div class="card-body" style="display: grid; grid-template-columns: repeat(13, 1fr); grid-template-rows: repeat(7, 1fr); gap: 5px;">
<ng-container *ngFor="let item of dashboardArray">
<div [style.gridColumn]="item.x + 1" [style.gridRow]="item.y + 1" [style.gridColumnEnd]="item.x + item.cols + 1"
[style.gridRowEnd]="item.y + item.rows + 1">
<div *ngIf="item.name === 'textField'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'" [style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
{{beforeText(item.fieldtext)}}
{{ app[transform(item.fieldtext) ] }}
{{afterText(item.fieldtext)}}
</div>
<div *ngIf="item.name === 'dateField'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'" [style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
{{beforeText(item.fieldtext)}}
{{ app[transform(item.fieldtext) ] | date}}
{{afterText(item.fieldtext)}}
</div>
<div *ngIf="item.name === 'numberField'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'" [style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
{{beforeText(item.fieldtext)}}
{{ app[transform(item.fieldtext) ]}}
{{afterText(item.fieldtext)}}
</div>
<div *ngIf="item.name === 'Line'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'">
<hr>
</div>
<div *ngIf="item.name === 'Icon'" class="icon-card"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'"
>
<clr-icon [attr.shape]="item.iconName"></clr-icon>
</div>
<div *ngIf="item.name == 'Image'"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'"
[style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor"> <img id="filePreview" [src]="item.imageURL" alt="File Preview"
[style.width]="item.imagewidth !== '' ? item.imagewidth + 'px' : '100px'"
[style.height]="item.imagewidth !== '' ? item.imagewidth + 'px' : '100px'"></div>
</div>
</ng-container>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-container>
</div>
<!-- // EDIT DATA......... -->
<clr-modal [(clrModalOpen)]="modalEdit" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Update Adv3
<!--update button -->
</h3>
<div class="modal-body" *ngIf="rowSelected.id">
<h2 class="heading">{{rowSelected.id}}</h2>
<!-- button -->
<form >
<div class="clr-row">
<div class="clr-col-sm-12">
<label>Name</label>
<input class="clr-input" type="text" [(ngModel)]="rowSelected.name" name="name" />
</div>
<div class="clr-col-sm-12">
<label>age 1</label>
<input id="name" class="clr-input" type="number" [(ngModel)]="rowSelected.age_1" name="age_1" />
</div>
<div class="clr-col-sm-12">
<label>age2</label>
<input id="name" class="clr-input" type="number" [(ngModel)]="rowSelected.age2" name="age2" />
</div>
<div class="clr-col-sm-12">
<label>calculated add</label>
<input class="clr-input" type="text" [value]="calculated_addtotal" readonly />
</div>
<div class="clr-col-sm-12">
<label>calculated sub</label>
<input class="clr-input" type="text" [value]="calculated_subtotal" readonly />
</div>
<div class="clr-col-sm-12">
<label>calculated mul</label>
<input class="clr-input" type="text" [value]="calculated_multotal" readonly />
</div>
<div class="clr-col-sm-12">
<label>calculated div</label>
<input class="clr-input" type="text" [value]="calculated_divtotal" readonly />
</div>
<div class="clr-col-sm-12">
<label>contry</label>
<select name="contry" [(ngModel)]="rowSelected.contry">
<option [value]="null">Choose contry</option>
<option *ngFor=" let item of selectcontry" [value]="item.name">{{item.name }}</option> </select> </div>
<!-- dependent dropdown field start -->
<div class="clr-col-sm-12">
<label> state Dependent</label>
<select name=" state" [(ngModel)]="rowSelected.state" class="clr-dropdown">
<option [ngValue]="null">Select Option</option>
<option *ngFor="let entity of statedependentData" [value]="entity.state_name">{{entity.state_name}}</option>
</select>
</div>
<!-- dependent dropdown field end -->
<!-- dependent dropdown field start -->
<div class="clr-col-sm-12">
<label> distric Dependent</label>
<select name=" distric" [(ngModel)]="rowSelected.distric" class="clr-dropdown">
<option [ngValue]="null">Select Option</option>
<option *ngFor="let entity of districdependentData" [value]="entity.distric_name">{{entity.distric_name}}</option>
</select>
</div>
<!-- dependent dropdown field end -->
</div>
<div class="clr-col-md-4 clr-col-sm-12"> <label>active</label>
<input class="clr-input" id="name" type="text" [(ngModel)]="rowSelected.child.active" name="active" />
</div>
<div class="clr-col-md-4 clr-col-sm-12"> <label>description</label>
<input class="clr-input" id="name" type="text" [(ngModel)]="rowSelected.child.description" name="description" />
</div>
<div class="clr-col-md-4 clr-col-sm-12"> <label>name</label>
<input class="clr-input" id="name" type="text" [(ngModel)]="rowSelected.child.name" name="name" />
</div>
<!-- form code start -->
<div *ngIf="checkFormCode">
<h4 style="font-weight: 300;display: inline;">Extension</h4>
<br>
<hr>
<div class="clr-row">
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'text'" [type]="field.fieldType" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" class="clr-input" />
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'date'" [type]="field.fieldType" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" class="clr-input" />
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
<textarea *ngSwitchCase="'textarea'" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" col="10" row="2"></textarea>
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" class="clr-checkbox" />
</ng-container>
</div>
</div>
</div>
<!-- form code end --> <div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalEdit = false">Cancel</button>
<button type="submit" class="btn btn-primary" (click)="onUpdate(rowSelected.id)">Update</button>
</div>
</form>
</div>
</clr-modal>
<clr-modal [(clrModalOpen)]="modaldelete" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<div class="modal-body" *ngIf="rowSelected.id">
<h1 class="delete">Are You Sure Want to delete?</h1>
<h2 class="heading">{{rowSelected.id}}</h2>
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modaldelete = false">Cancel</button>
<button type="button" (click)="delete(rowSelected.id)" class="btn btn-primary" >Delete</button>
</div>
</div>
</clr-modal>
<!-- ADD FORM ..... -->
<clr-modal [(clrModalOpen)]="modalAdd" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Add Adv3
<!-- aeroplane icon -->
&nbsp; &nbsp; &nbsp; &nbsp;
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
class="tooltip tooltip-sm tooltip-bottom-left">
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Adv3_formCode' }">
<clr-icon shape="airplane" size="32"></clr-icon>
</a>
<span class="tooltip-content">Form Extension</span>
</a> </h3>
<div class="modal-body">
<form [formGroup]="entryForm" >
<div class="clr-row" style="height: fit-content;">
<div class="clr-col-sm-12">
<label> Name</label>
<input class="clr-input" type="text" formControlName="name" />
</div>
<div class="clr-col-sm-12">
<label> age 1</label>
<input class="clr-input" type="number" formControlName="age_1" />
<div *ngIf="submitted && entryForm.controls.age_1.errors" class="error_mess">
<div *ngIf="submitted && entryForm.controls.age_1.errors.required" class="error_mess">*This field is Required</div>
</div>
</div>
<div class="clr-col-sm-12">
<label> age2</label>
<input class="clr-input" type="number" formControlName="age2" />
<div *ngIf="submitted && entryForm.controls.age2.errors" class="error_mess">
<div *ngIf="submitted && entryForm.controls.age2.errors.required" class="error_mess">*This field is Required</div>
</div>
</div>
<div class="clr-col-sm-12">
<label>calculated add</label>
<input class="clr-input" type="text" [value]="calculated_addtotal" readonly />
</div>
<div class="clr-col-sm-12">
<label>calculated sub</label>
<input class="clr-input" type="text" [value]="calculated_subtotal" readonly />
</div>
<div class="clr-col-sm-12">
<label>calculated mul</label>
<input class="clr-input" type="text" [value]="calculated_multotal" readonly />
</div>
<div class="clr-col-sm-12">
<label>calculated div</label>
<input class="clr-input" type="text" [value]="calculated_divtotal" readonly />
</div>
<div class="clr-col-sm-12">
<label> contry</label>
<select formControlName="contry">
<option [value]="null">Choose contry</option>
<option *ngFor="let item of selectcontry" [value]="item.name">{{item.name}}</option>
</select> </div>
<!-- order form start -->
<div *ngIf="iscontryorder" class="clr-col-sm-12" style="margin-bottom: 10px;">
<button type="button" class="btn btn-primary" (click)="addcontryOrder()">
+ Add to Order
</button>
</div>
<!-- Order Summary Table -->
<div class="clr-col-sm-12" *ngIf="contrySummary.length > 0">
<h4>Order Summary</h4>
<table class="table table-bordered">
<thead>
<tr>
<th>Line</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of contrySummary; let i = index">
<td>{{ item.line }}</td>
<td>
<button type="button" class="btn btn-danger btn-sm" (click)="removecontryOrder(i)">
🗑
</button>
</td>
</tr>
</tbody>
</table>
<div style="max-width: 350px; float: right; margin-top: 18px;">
<table style="width: 100%; font-size: 16px;">
<tr>
<td style="text-align: right; font-weight: 500; color: #333;">Subtotal:</td>
<td style="text-align: right; font-weight: 600; color: #222; width: 120px;">₹ {{ getcontrySubtotal() | number:'1.4-4' }}</td>
</tr>
<tr>
<td style="text-align: right; font-weight: 500; color: #333;">GST (18%):</td>
<td style="text-align: right; font-weight: 600; color: #007bff;">₹ {{ getcontryGST() | number:'1.4-4' }}</td>
</tr>
<tr>
<td colspan="2"><hr style="margin: 8px 0;"></td>
</tr>
<tr>
<td style="text-align: right; font-size: 18px; font-weight: 700; color: #1a237e;">Total:</td>
<td style="text-align: right; font-size: 20px; font-weight: 700; color: #1a237e;">₹ {{ getcontryGrandTotal() | number:'1.4-4' }}</td>
</tr>
</table>
</div>
</div>
<!-- order form end -->
<!-- dependent dropdown field start -->
<div class="clr-col-sm-12">
<label> state</label> <select formControlName="state" class="clr-dropdown">
<option [ngValue]="null">Select Option</option>
<option *ngFor="let entity of statedependentData" [value]="entity.state_name">{{ entity.state_name}}</option>
</select>
</div>
<!-- dependent dropdown field end -->
<!-- dependent dropdown field start -->
<div class="clr-col-sm-12">
<label> distric</label> <select formControlName="distric" class="clr-dropdown">
<option [ngValue]="null">Select Option</option>
<option *ngFor="let entity of districdependentData" [value]="entity.distric_name">{{ entity.distric_name}}</option>
</select>
</div>
<!-- dependent dropdown field end -->
</div>
<div style="margin-top: 30px;">
<h4 style="display: inline;">child </h4> </div> <hr>
<div class="clr-row" formArrayName="child">
<div class="clr-col-md-4 clr-col-sm-12">
<label> active</label>
<input class="clr-input" type="text" formControlName="active" /> </div>
<div class="clr-col-md-4 clr-col-sm-12">
<label> description</label>
<input class="clr-input" type="text" formControlName="description" /> </div>
<div class="clr-col-md-4 clr-col-sm-12">
<label> name</label>
<input class="clr-input" type="text" formControlName="name" /> </div>
</div>
<!-- form code start -->
<div *ngIf="checkFormCode">
<h4 style="font-weight: 300;display: inline;">Extension</h4>
<br>
<hr>
<div class="clr-row">
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'text'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'date'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
<textarea *ngSwitchCase="'textarea'" [formControlName]="field.extValue" col="10" row="2"></textarea>
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-checkbox" />
</ng-container>
</div>
</div>
</div>
<!-- form code end --> <div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
<button type="submit" class="btn btn-primary" (click)="onSubmit()">ADD</button>
</div>
</form>
</div>
</clr-modal>
<!-- htmlpopup -->

View File

@@ -0,0 +1,85 @@
//@import "../../../../assets/scss/var";
.s-info-bar {
display: flex;
flex-direction: row;
justify-content: space-between;
button {
outline: none;
}
}
.delete,.heading{
text-align: center;
color: red;
}
.entry-pg {
width: 750px;
}
.button1::after {
content: none;
}
.button1:hover::after {
content: "ADD ROWS";
}
.section {
background-color: #dddddd;
height: 40px;
}
.section p {
//color: white;
padding: 10px;
font-size: 18px;
}
.clr-input {
color: #212529;
border: 1px solid #ced4da;
border-radius: 0.25rem;
padding: 0.75rem 0.75rem;
margin-top: 3px;
width: 100%;
margin-bottom: 10px;
}
.clr-file {
color: #212529;
border: 1px solid #ced4da;
border-radius: 0.25rem;
//padding: 0.6rem 0.75rem;
margin-top: 3px;
width: 100%;
margin-bottom: 10px;
}
.center {
text-align: center;
}
select{
width: 100%;
margin-top: 3px;
padding: 5px 5px;
border: 1px solid #ccc;
border-radius: 4px;
}
input[type=text],[type=date],[type=number],textarea {
width: 100%;
padding: 15px 15px;
background-color:rgb(255, 255, 255);
// margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.error_mess {
color: red;
}
.universal-section-header {
margin: 24px 0 10px 0;
font-weight: 600;
color: #1a237e;
letter-spacing: 0.5px;
font-size: 1.25rem;
}

View File

@@ -0,0 +1,68 @@
import { Injectable } from '@angular/core';
import { Observable } from "rxjs";
import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http";
import { ApiRequestService } from "src/app/services/api/api-request.service";
import { environment } from 'src/environments/environment';
@Injectable({
providedIn: 'root'
})
export class Adv3service{
private baseURL = "Adv3/Adv3" ; constructor(
private http: HttpClient,
private apiRequest: ApiRequestService,
) { }
getAll(page?: number, size?: number): Observable<any> {
return this.apiRequest.get(this.baseURL);
}
getById(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.get(_http);
}
create(data: any): Observable<any> {
return this.apiRequest.post(this.baseURL, data);
}
update(id: number, data: any): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.put(_http, data);
}
delete(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.delete(_http);
}
getAllcontry(): Observable<any> {
return this.apiRequest.get("Contry_ListFilter1/Contry_ListFilter1"); }
getstateDependent(field: string): Observable<any> {
return this.apiRequest.get("State_ListFilter1/State_ListFilter11/" + field);
}
getdistricDependent(field: string): Observable<any> {
return this.apiRequest.get("Distric_ListFilter1/Distric_ListFilter11/" + field);
}
// updateaction
}

View File

@@ -0,0 +1,4 @@
export const Adv3cardvariable = {
"cardButton": false,
"cardmodeldata": ``
}

View File

@@ -0,0 +1,579 @@
<ol class="breadcrumb breadcrumb-arrow font-trirong">
<li><a href="javascript://"> Adv4</a></li>
</ol>
<div class="dg-wrapper">
<div class="clr-row">
<div class="clr-col-8">
<h3>Adv4 </h3>
</div>
<div class="clr-col-4" style="text-align: right;">
<button *ngIf="cardButton" id="add" class="btn btn-primary btn-icon" (click)="changeView()" >
<clr-icon *ngIf="!isCardview" shape="grid-view"></clr-icon> <clr-icon *ngIf="isCardview" shape="bars"></clr-icon>
</button>
<!-- button -->
<!-- insert button -->
<button id="insert" class="btn btn-primary" (click)="goToInsertButton_Field()">
<clr-icon shape="plus"></clr-icon>Insert Button_Field
</button>
<!-- insert end -->
<button id="add" class="btn btn-primary" (click)="goToAdd(product)" >
<clr-icon shape="plus"></clr-icon>ADD
</button>
</div></div>
<ng-container *ngIf="!isCardview"> <!-- GET ALL --> <clr-datagrid [clrDgLoading]="loading" [(clrDgSelected)]="selected">
<clr-dg-placeholder>
<ng-template #loadingSpinner>
<clr-spinner>Loading ... </clr-spinner>
</ng-template>
<div *ngIf="error;else loadingSpinner">{{error}}</div>
</clr-dg-placeholder>
<clr-dg-column [clrDgField]="'name'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Name
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'survey_form'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Survey Form
</ng-container></clr-dg-column>
<!-- who column -->
<clr-dg-column> <ng-container *clrDgHideableColumn="{hidden: false}">
<clr-icon shape="bars"></clr-icon> Action
</ng-container></clr-dg-column>
<!-- end -->
<clr-dg-row *clrDgItems="let user of product" [clrDgItem]="user">
<clr-dg-cell>{{user.name }}</clr-dg-cell>
<clr-dg-cell>{{user.survey_form }}</clr-dg-cell>
<!-- who column -->
<clr-dg-cell>
<clr-signpost>
<span style="cursor: pointer;" clrSignpostTrigger><clr-icon shape="help" class="success" style="color: rgb(0, 130, 236);"></clr-icon></span>
<clr-signpost-content [clrPosition]="'left-middle'" *clrIfOpen>
<h5 style="margin-top: 0">Who Column</h5>
<div>Account ID: <code class="clr-code">{{user.accountId}}</code></div>
<div>Created At: <code class="clr-code">{{user.createdAt| date}}</code></div>
<div>Created By: <code class="clr-code">{{user.createdBy}}</code></div>
<div>Updated At: <code class="clr-code">{{user.updatedAt | date}}</code></div>
<div>Updated By: <code class="clr-code">{{user.updatedBy}}</code></div>
</clr-signpost-content>
</clr-signpost>
</clr-dg-cell>
<!-- who colmn -->
<clr-dg-action-overflow>
<button class="action-item" (click)="onEdit(user)">Edit</button>
<button class="action-item" (click)="onDelete(user)">Delete</button>
</clr-dg-action-overflow>
</clr-dg-row>
<clr-dg-footer>
<clr-dg-pagination #pagination [clrDgPageSize]="10">
<clr-dg-page-size [clrPageSizeOptions]="[10,20,50,100]">Users per page</clr-dg-page-size>
{{pagination.firstItem + 1}} - {{pagination.lastItem + 1}}
of {{pagination.totalItems}} users
</clr-dg-pagination>
</clr-dg-footer>
</clr-datagrid> </ng-container>
<ng-template #showInfo>
<div class="alert alert-info" role="alert">
<div class="alert-items">
<div class="alert-item static">
<span class="alert-text">
<clr-icon class="alert-icon" shape="info-circle"></clr-icon>
Data could be found. Loading..
<clr-spinner [clrMedium]="true">Loading ...</clr-spinner>
</span>
</div>
</div>
</div>
</ng-template><ng-container *ngIf="isCardview">
<div *ngIf="product; else showInfo" class="clr-row clr-align-items-start clr-justify-content-start">
<div *ngFor="let app of product| filter:search; let index = i" class="clr-col-auto" >
<div class="clr-row">
<div class="clr-col-lg-12 clr-col-md-4 clr-col-sm-4 clr-col-12" style="width: 410px;">
<div class="card" style="padding: 10px; "[style.background-color]="cardmodal.cardColor !== '' ? cardmodal.cardColor : 'white'">
<div class="card-body" style="display: grid; grid-template-columns: repeat(13, 1fr); grid-template-rows: repeat(7, 1fr); gap: 5px;">
<ng-container *ngFor="let item of dashboardArray">
<div [style.gridColumn]="item.x + 1" [style.gridRow]="item.y + 1" [style.gridColumnEnd]="item.x + item.cols + 1"
[style.gridRowEnd]="item.y + item.rows + 1">
<div *ngIf="item.name === 'textField'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'" [style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
{{beforeText(item.fieldtext)}}
{{ app[transform(item.fieldtext) ] }}
{{afterText(item.fieldtext)}}
</div>
<div *ngIf="item.name === 'dateField'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'" [style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
{{beforeText(item.fieldtext)}}
{{ app[transform(item.fieldtext) ] | date}}
{{afterText(item.fieldtext)}}
</div>
<div *ngIf="item.name === 'numberField'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'" [style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
{{beforeText(item.fieldtext)}}
{{ app[transform(item.fieldtext) ]}}
{{afterText(item.fieldtext)}}
</div>
<div *ngIf="item.name === 'Line'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'">
<hr>
</div>
<div *ngIf="item.name === 'Icon'" class="icon-card"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'"
>
<clr-icon [attr.shape]="item.iconName"></clr-icon>
</div>
<div *ngIf="item.name == 'Image'"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'"
[style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor"> <img id="filePreview" [src]="item.imageURL" alt="File Preview"
[style.width]="item.imagewidth !== '' ? item.imagewidth + 'px' : '100px'"
[style.height]="item.imagewidth !== '' ? item.imagewidth + 'px' : '100px'"></div>
</div>
</ng-container>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-container>
</div>
<!-- // EDIT DATA......... -->
<clr-modal [(clrModalOpen)]="modalEdit" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Update Adv4
<!--update button -->
<!-- update button -->
<button id="Update" class="btn btn-primary" (click)="goToUpdateButton_Field()">
<clr-icon shape="plus"></clr-icon>Update Button_Field
</button>
<!-- update end -->
</h3>
<div class="modal-body" *ngIf="rowSelected.id">
<h2 class="heading">{{rowSelected.id}}</h2>
<!-- button -->
<form >
<div class="clr-row">
<div class="clr-col-sm-12">
<label>Name</label>
<input class="clr-input" type="text" [(ngModel)]="rowSelected.name" name="name" />
</div>
<div class="clr-col-sm-12">
<label>Survey Form</label>
<input class="clr-input" type="text" [(ngModel)]="rowSelected.survey_form" name="survey_form" />
</div>
</div>
<!-- one to many code start here -->
<div class="clr-row">
<div class="clr-col-lg-12">
<table class="table" style="width:100%;">
<thead>
<tr>
<th class="left" style="width:200px;">active</th>
<th class="left" style="width:200px;">description</th>
<th class="left" style="width:200px;">name</th>
<th class="right" style="width:200px;">{{ childcomponents?.length >= 1 ? 'Actions' : '' }}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let component of childcomponents; let i = index">
<td class="left"> <input type="text" name="active" [(ngModel)]="component.active" [ngModelOptions]=" {standalone: true}" placeholder="Enter active" class="clr-input">
</td>
<td class="left"> <input type="text" name="description" [(ngModel)]="component.description" [ngModelOptions]=" {standalone: true}" placeholder="Enter description" class="clr-input">
</td>
<td class="left"> <input type="text" name="name" [(ngModel)]="component.name" [ngModelOptions]=" {standalone: true}" placeholder="Enter name" class="clr-input">
</td>
<td> <a>
<clr-icon shape="trash" class="is-error" (click)="deleteRow(i)"></clr-icon>
</a> </td>
</tr>
</tbody>
<button type="button" class="btn btn-primary button1" (click)="oneditchild()" style="margin-left: 20px;">
<clr-icon shape="plus"></clr-icon> </button>
</table>
</div>
</div>
<!-- one to many code end here -->
<!-- form code start -->
<div *ngIf="checkFormCode">
<h4 style="font-weight: 300;display: inline;">Extension</h4>
<br>
<hr>
<div class="clr-row">
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'text'" [type]="field.fieldType" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" class="clr-input" />
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'date'" [type]="field.fieldType" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" class="clr-input" />
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
<textarea *ngSwitchCase="'textarea'" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" col="10" row="2"></textarea>
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" class="clr-checkbox" />
</ng-container>
</div>
</div>
</div>
<!-- form code end --> <div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalEdit = false">Cancel</button>
<button type="submit" class="btn btn-primary" (click)="onUpdate(rowSelected.id)">Update</button>
</div>
</form>
</div>
</clr-modal>
<clr-modal [(clrModalOpen)]="modaldelete" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<div class="modal-body" *ngIf="rowSelected.id">
<h1 class="delete">Are You Sure Want to delete?</h1>
<h2 class="heading">{{rowSelected.id}}</h2>
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modaldelete = false">Cancel</button>
<button type="button" (click)="delete(rowSelected.id)" class="btn btn-primary" >Delete</button>
</div>
</div>
</clr-modal>
<!-- ADD FORM ..... -->
<clr-modal [(clrModalOpen)]="modalAdd" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Add Adv4
<!-- aeroplane icon -->
&nbsp; &nbsp; &nbsp; &nbsp;
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
class="tooltip tooltip-sm tooltip-bottom-left">
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Adv4_formCode' }">
<clr-icon shape="airplane" size="32"></clr-icon>
</a>
<span class="tooltip-content">Form Extension</span>
</a> </h3>
<div class="modal-body">
<form [formGroup]="entryForm" >
<div class="clr-row" style="height: fit-content;">
<div class="clr-col-sm-12">
<label> Name</label>
<input class="clr-input" type="text" formControlName="name" />
</div>
<div class="clr-col-sm-12">
<label> Survey Form</label>
<input class="clr-input" type="text" formControlName="survey_form" />
</div>
</div>
<!-- one to many code start here -->
<div style="margin-top: 30px;"><h4 style="display: inline;">child </h4>
</div>
<hr>
<div class="clr-row">
<div class="clr-col-lg-12">
<table class="table" style="width:100%;" formArrayName="child">
<thead>
<tr>
<th class="left" style="width:125px;">active</th>
<th class="left" style="width:125px;">description</th>
<th class="left" style="width:125px;">name</th>
<th class="right" style="width:125px;">{{ childcontrols.length > 1 ? 'Actions' : '' }}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of childcontrols; let i=index" [formGroupName]="i">
<td class="left"> <input type="text" formControlName="active" placeholder="Enter active" style="width:180px"
class="clr-input"> </td>
<td class="left"> <input type="text" formControlName="description" placeholder="Enter description" style="width:180px"
class="clr-input"> </td>
<td class="left"> <input type="text" formControlName="name" placeholder="Enter name" style="width:180px"
class="clr-input"> </td>
<td style="width:40px;">
<a *ngIf="childcontrols.length > 1" (click)="onRemovechild(i)"><clr-icon shape="trash" class="is-error"></clr-icon>
</a>
</td>
</tr>
</tbody>
<button type="button" class="btn btn-primary button1" (click)="onAddchild()" >
<clr-icon shape="plus"></clr-icon> </button>
</table>
</div>
</div>
<!-- one to many code end here -->
<!-- form code start -->
<div *ngIf="checkFormCode">
<h4 style="font-weight: 300;display: inline;">Extension</h4>
<br>
<hr>
<div class="clr-row">
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'text'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'date'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
<textarea *ngSwitchCase="'textarea'" [formControlName]="field.extValue" col="10" row="2"></textarea>
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-checkbox" />
</ng-container>
</div>
</div>
</div>
<!-- form code end --> <div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
<button type="submit" class="btn btn-primary" (click)="onSubmit()">ADD</button>
</div>
</form>
</div>
</clr-modal>
<!-- htmlpopup -->
<clr-modal [(clrModalOpen)]="modalInsertButton_Field" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Insert Button_Field</h3>
<div class="modal-body">
<form [formGroup]="insertFormButton_Field" (ngSubmit)="onSubmitInsertButton_Field()">
<div class="clr-row">
<div class="clr-col-md-4 clr-col-sm-12">
<label for="description">Description:</label>
<input type="text" id="description" formControlName="description" name="description" placeholder="Enter Description" class="clr-input">
</div>
<div class="clr-col-md-4 clr-col-sm-12">
<label for="name">Name:</label>
<input type="text" id="name" formControlName="name" name="name" placeholder="Enter Name" class="clr-input">
</div>
</div>
<br>
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalInsertButton_Field = false">Cancel</button>
<button type="submit" class="btn btn-primary" >Insert</button>
</div>
</form>
</div>
</clr-modal>
<clr-modal [(clrModalOpen)]="modalUpdateButton_Field" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Update Button_Field</h3>
<div class="modal-body">
<form [formGroup]="UpdateFormButton_Field" (ngSubmit)="onSubmitUpdateButton_Field(rowSelected.id)">
<div class="clr-row">
<div class="clr-col-md-4 clr-col-sm-12">
<label for="active">Active:</label>
<input type="text" id="active" formControlName="active" name="active" placeholder="Enter Active" class="clr-input">
</div>
<div class="clr-col-md-4 clr-col-sm-12">
<label for="description">Description:</label>
<input type="text" id="description" formControlName="description" name="description" placeholder="Enter Description" class="clr-input">
</div>
<div class="clr-col-md-4 clr-col-sm-12">
<label for="name">Name:</label>
<input type="text" id="name" formControlName="name" name="name" placeholder="Enter Name" class="clr-input">
</div>
</div>
<br>
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalUpdateButton_Field = false">Cancel</button>
<button type="submit" class="btn btn-primary" >Update</button>
</div>
</form>
</div>
</clr-modal>

View File

@@ -0,0 +1,85 @@
//@import "../../../../assets/scss/var";
.s-info-bar {
display: flex;
flex-direction: row;
justify-content: space-between;
button {
outline: none;
}
}
.delete,.heading{
text-align: center;
color: red;
}
.entry-pg {
width: 750px;
}
.button1::after {
content: none;
}
.button1:hover::after {
content: "ADD ROWS";
}
.section {
background-color: #dddddd;
height: 40px;
}
.section p {
//color: white;
padding: 10px;
font-size: 18px;
}
.clr-input {
color: #212529;
border: 1px solid #ced4da;
border-radius: 0.25rem;
padding: 0.75rem 0.75rem;
margin-top: 3px;
width: 100%;
margin-bottom: 10px;
}
.clr-file {
color: #212529;
border: 1px solid #ced4da;
border-radius: 0.25rem;
//padding: 0.6rem 0.75rem;
margin-top: 3px;
width: 100%;
margin-bottom: 10px;
}
.center {
text-align: center;
}
select{
width: 100%;
margin-top: 3px;
padding: 5px 5px;
border: 1px solid #ccc;
border-radius: 4px;
}
input[type=text],[type=date],[type=number],textarea {
width: 100%;
padding: 15px 15px;
background-color:rgb(255, 255, 255);
// margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.error_mess {
color: red;
}
.universal-section-header {
margin: 24px 0 10px 0;
font-weight: 600;
color: #1a237e;
letter-spacing: 0.5px;
font-size: 1.25rem;
}

View File

@@ -0,0 +1,467 @@
import { Component, OnInit } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { AlertService } from 'src/app/services/alert.service';
import { Adv4service} from './Adv4.service';
import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms';
import { ExtensionService } from 'src/app/services/fnd/extension.service';
import { DashboardContentModel2 } from 'src/app/models/builder/dashboard';
import { Adv4cardvariable } from './Adv4_cardvariable';
import { UserInfoService } from 'src/app/services/user-info.service';
declare var JsBarcode: any;
@Component({
selector: 'app-Adv4',
templateUrl: './Adv4.component.html',
styleUrls: ['./Adv4.component.scss']
})
export class Adv4Component implements OnInit {
cardButton = Adv4cardvariable.cardButton;
cardmodeldata = Adv4cardvariable.cardmodeldata;
public dashboardArray: DashboardContentModel2[];
isCardview = Adv4cardvariable.cardButton;
cardmodal; changeView(){
this.isCardview = !this.isCardview;
}
beforeText(fieldtext: string): string { // Extract the text before the first '<'
const index = fieldtext.indexOf('<');
return index !== -1 ? fieldtext.substring(0, index) : fieldtext;
}
afterText(fieldtext: string): string { // Extract the text after the last '>'
const index = fieldtext.lastIndexOf('>');
return index !== -1 ? fieldtext.substring(index + 1) : '';
}
transform(fieldtext: string): string {
const match = fieldtext.match(/<([^>]*)>/);
return match ? match[1] : ''; // Extract the text between '<' and '>'
}
userrole;
rowSelected :any= {};
modaldelete=false;
modalEdit=false;
modalAdd= false;
public entryForm: FormGroup;
loading = false;
product;
modalOpenedforNewLine = false;
newLine:any;
additionalFieldsFromBackend: any[] = [];
formcode = 'Adv4_formCode'
tableName = 'Adv4'; checkFormCode; selected: any[] = []; constructor(
private extensionService: ExtensionService,
private userInfoService:UserInfoService,
private mainService:Adv4service,
private alertService: AlertService,
private toastr: ToastrService,
private _fb: FormBuilder,
) { }
private editInterval: any;
// component button
public insertFormButton_Field: FormGroup;
public UpdateFormButton_Field: FormGroup;
ngOnInit(): void {
if(this.cardmodeldata !== ''){
this.cardmodal = JSON.parse(this.cardmodeldata);
this.dashboardArray = this.cardmodal.dashboard.slice();
console.log(this.dashboardArray)
}
this.userrole=this.userInfoService.getRoles();
this.getData();
this.entryForm = this._fb.group({
name : [null],
child: this._fb.array([this.initchildForm()]),
survey_form : [null],
}); // component_button200
// inser code start
this.insertFormButton_Field = this._fb.group({
description: 'textarea',
name: '',
});
// insert code end
// inser code start
this.UpdateFormButton_Field = this._fb.group({
active: '',
description: '',
name: '',
});
// Update code end
// form code start
this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => {
console.log(data);
const jsonArray = data.map((str) => JSON.parse(str));
this.additionalFieldsFromBackend = jsonArray;
this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Adv4_formCode");
console.log(this.checkFormCode);
console.log(this.additionalFieldsFromBackend);
if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) {
this.additionalFieldsFromBackend.forEach(field => {
if (field.formCode === this.formcode) {
if (!this.entryForm.contains(field.extValue)) {
// Add the control only if it doesn't exist in the form
this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue));
}
}
});
}
});
console.log(this.entryForm.value);
// form code end
}
ngOnDestroy(): void {
if (this.editInterval) {
clearInterval(this.editInterval);
}
}
// one to many start
initchildForm() { return this._fb.group({
active: [null],
description: [null],
name: [null],
}); }
get childcontrols() {return (this.entryForm.get("child") as FormArray).controls; }
onAddchild() {
(<FormArray>this.entryForm.get("child")).push(this.initchildForm()); }
onRemovechild(index: number) {
(<FormArray>this.entryForm.get("child")).removeAt(index); }
oneditchild() { this.childcomponents.push({
active: "",
description: "",
name: "",
}); }
deletechildRow(index) {
this.childcomponents.splice(index, 1);
}
childcomponents;
// one to many end
error;
getData() {
this.mainService.getAll().subscribe((data) => {
console.log(data);
this.product = data;
this.product = [...this.product].reverse(); if(this.product.length==0){
this.error="No Data Available"
}
},(error) => {
console.log(error);
if(error){
this.error="Server Error";
}
});
}
onEdit(row) {
this.rowSelected = row;
this.childcomponents = row.child;
this.modalEdit = true;
}
onDelete(row) {
this.rowSelected = row;
this.modaldelete=true;
}
delete(id)
{
this.modaldelete = false;
console.log("in delete "+id);
this.mainService.delete(id).subscribe(
(data) => {
console.log(data);
this.ngOnInit();
if (data) { this.toastr.success('Deleted successfully'); }
});
}
onUpdate(id) {
this.modalEdit = false;
//console.log("in update");
console.log("id " + id);
console.log(this.rowSelected);
//console.log("out update");
this.mainService.update(id, this.rowSelected).subscribe(
(data) => {
console.log(data);
if (data || data.status >= 200 && data.status <= 299) {
this.toastr.success("Update Successfully");
}
setTimeout(() => {
this.ngOnInit();
}, 500);
}, (error) => {
console.log(error);
if (error.status >= 200 && error.status <= 299) {
// this.toastr.success("update Succesfully");
}
if (error.status >= 400 && error.status <= 499) {
this.toastr.error("Not Updated");
}
if (error.status >= 500 && error.status <= 599) {
this.toastr.error("Not Updated");
}
});
setTimeout(() => {
this.ngOnInit();
}, 500);
}
onCreate() {
this.modalAdd=false;
this.mainService.create(this.entryForm.value).subscribe(
(data) => {
console.log(data);
if (data || data.status >= 200 && data.status <= 299) {
this.toastr.success("Added Successfully");
}
setTimeout(() => {
this.ngOnInit();
}, 500);
}, (error) => {
console.log(error);
if (error.status >= 200 && error.status <= 299) {
// this.toastr.success("Added Succesfully");
}
if (error.status >= 400 && error.status <= 499) {
this.toastr.error("Not Added");
}
if (error.status >= 500 && error.status <= 599) {
this.toastr.error("Not Added");
}
});
setTimeout(() => {
this.ngOnInit();
}, 500);
}
goToAdd(row) {
this.modalAdd = true; this.submitted = false;
}
submitted = false;
onSubmit() {
console.log(this.entryForm.value);
this.submitted = true;
if (this.entryForm.invalid) {
return;
}this.onCreate();
}
// updateaction
// insert button
modalInsertButton_Field = false;
goToInsertButton_Field() {
this.modalInsertButton_Field=true;
}
onSubmitInsertButton_Field() {
console.log(this.insertFormButton_Field.value);
this.submitted=true;
if (this.insertFormButton_Field.invalid) {
return;
}
this.onInsertButton_Field();
}
onInsertButton_Field() {
this.modalInsertButton_Field=false;
this.mainService.insertButton_FieldSupport(this.insertFormButton_Field.value).subscribe(data => {
console.log('After add',data)
if (data.status >=200 && data.status <=209) {
this.toastr.success('Added successfully');
}
if (data && data.id != null) {
this.toastr.success('Added successfully');
} this.ngOnInit();
},(error) => {
console.error(error);
if ( error.status >= 200 && error.status <= 299) {
this.toastr.success("Update Successfully");
}
if ( error.status >= 400 && error.status <= 499) {
this.toastr.error("Update Failed");
}
if ( error.status >= 500 && error.status <= 599) {
this.toastr.error("Server Error");
}
this.ngOnInit();
});
this.insertFormButton_Field.reset();
}
// insert buuton code end
// update button
modalUpdateButton_Field = false;
goToUpdateButton_Field() {
this.modalUpdateButton_Field=true;
}
onSubmitUpdateButton_Field(id) {
console.log(this.UpdateFormButton_Field.value);
this.submitted=true;
if (this.UpdateFormButton_Field.invalid) {
return;
}
this.onUpdateButton_Field(id);
}
onUpdateButton_Field(id) {
this.modalUpdateButton_Field=false;
this.mainService.updateChild(id,this.UpdateFormButton_Field.value).subscribe(data => {
console.log(data)
if (data.status >=200 && data.status <=209) {
this.toastr.success('Added successfully');
}
this.ngOnInit();
},(error) => {
console.error(error);
if ( error.status >= 200 && error.status <= 299) {
this.toastr.success("Update Successfully");
}
if ( error.status >= 400 && error.status <= 499) {
this.toastr.error("Update Failed");
}
if ( error.status >= 500 && error.status <= 599) {
this.toastr.error("Server Error");
}
this.ngOnInit();
});
this.UpdateFormButton_Field.reset();
}
// update buuton code end
}

View File

@@ -0,0 +1,53 @@
import { Injectable } from '@angular/core';
import { Observable } from "rxjs";
import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http";
import { ApiRequestService } from "src/app/services/api/api-request.service";
import { environment } from 'src/environments/environment';
@Injectable({
providedIn: 'root'
})
export class Adv4service{
private baseURL = "Adv4/Adv4" ; constructor(
private http: HttpClient,
private apiRequest: ApiRequestService,
) { }
getAll(page?: number, size?: number): Observable<any> {
return this.apiRequest.get(this.baseURL);
}
getById(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.get(_http);
}
create(data: any): Observable<any> {
return this.apiRequest.post(this.baseURL, data);
}
update(id: number, data: any): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.put(_http, data);
}
delete(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.delete(_http);
}
// updateaction
// insert button code start
insertButton_FieldSupport(Support: any): Observable<any> {
return this.apiRequest.post(`Adv4/Adv4/Support_insert`, Support);
}
// update button code start
updateChild(id: number,Child: any): Observable<any> {
return this.apiRequest.put(`Child/Child_update/`+ id, Child);
}
}

View File

@@ -0,0 +1,4 @@
export const Adv4cardvariable = {
"cardButton": false,
"cardmodeldata": ``
}

View File

@@ -0,0 +1,376 @@
<ol class="breadcrumb breadcrumb-arrow font-trirong">
<li><a href="javascript://"> Child</a></li>
</ol>
<div class="dg-wrapper">
<div class="clr-row">
<div class="clr-col-8">
<h3>Child </h3>
</div>
<div class="clr-col-4" style="text-align: right;">
<button *ngIf="cardButton" id="add" class="btn btn-primary btn-icon" (click)="changeView()" >
<clr-icon *ngIf="!isCardview" shape="grid-view"></clr-icon> <clr-icon *ngIf="isCardview" shape="bars"></clr-icon>
</button>
<!-- button -->
<button id="add" class="btn btn-primary" (click)="goToAdd(product)" >
<clr-icon shape="plus"></clr-icon>ADD
</button>
</div></div>
<ng-container *ngIf="!isCardview"> <!-- GET ALL --> <clr-datagrid [clrDgLoading]="loading" [(clrDgSelected)]="selected">
<clr-dg-placeholder>
<ng-template #loadingSpinner>
<clr-spinner>Loading ... </clr-spinner>
</ng-template>
<div *ngIf="error;else loadingSpinner">{{error}}</div>
</clr-dg-placeholder>
<clr-dg-column [clrDgField]="'name'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Name
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'description'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Description
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'active'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Active
</ng-container></clr-dg-column>
<!-- who column -->
<clr-dg-column> <ng-container *clrDgHideableColumn="{hidden: false}">
<clr-icon shape="bars"></clr-icon> Action
</ng-container></clr-dg-column>
<!-- end -->
<clr-dg-row *clrDgItems="let user of product" [clrDgItem]="user">
<clr-dg-cell>{{user.name }}</clr-dg-cell>
<clr-dg-cell (click)="goToReplaceStringdescription (user.description)" style="cursor: pointer; align-items: center;"><clr-icon shape="details"></clr-icon>
</clr-dg-cell>
<clr-dg-cell>{{user.active }}</clr-dg-cell>
<!-- who column -->
<clr-dg-cell>
<clr-signpost>
<span style="cursor: pointer;" clrSignpostTrigger><clr-icon shape="help" class="success" style="color: rgb(0, 130, 236);"></clr-icon></span>
<clr-signpost-content [clrPosition]="'left-middle'" *clrIfOpen>
<h5 style="margin-top: 0">Who Column</h5>
<div>Account ID: <code class="clr-code">{{user.accountId}}</code></div>
<div>Created At: <code class="clr-code">{{user.createdAt| date}}</code></div>
<div>Created By: <code class="clr-code">{{user.createdBy}}</code></div>
<div>Updated At: <code class="clr-code">{{user.updatedAt | date}}</code></div>
<div>Updated By: <code class="clr-code">{{user.updatedBy}}</code></div>
</clr-signpost-content>
</clr-signpost>
</clr-dg-cell>
<!-- who colmn -->
<clr-dg-action-overflow>
<button class="action-item" (click)="onEdit(user)">Edit</button>
<button class="action-item" (click)="onDelete(user)">Delete</button>
</clr-dg-action-overflow>
</clr-dg-row>
<clr-dg-footer>
<clr-dg-pagination #pagination [clrDgPageSize]="10">
<clr-dg-page-size [clrPageSizeOptions]="[10,20,50,100]">Users per page</clr-dg-page-size>
{{pagination.firstItem + 1}} - {{pagination.lastItem + 1}}
of {{pagination.totalItems}} users
</clr-dg-pagination>
</clr-dg-footer>
</clr-datagrid> </ng-container>
<ng-template #showInfo>
<div class="alert alert-info" role="alert">
<div class="alert-items">
<div class="alert-item static">
<span class="alert-text">
<clr-icon class="alert-icon" shape="info-circle"></clr-icon>
Data could be found. Loading..
<clr-spinner [clrMedium]="true">Loading ...</clr-spinner>
</span>
</div>
</div>
</div>
</ng-template><ng-container *ngIf="isCardview">
<div *ngIf="product; else showInfo" class="clr-row clr-align-items-start clr-justify-content-start">
<div *ngFor="let app of product| filter:search; let index = i" class="clr-col-auto" >
<div class="clr-row">
<div class="clr-col-lg-12 clr-col-md-4 clr-col-sm-4 clr-col-12" style="width: 410px;">
<div class="card" style="padding: 10px; "[style.background-color]="cardmodal.cardColor !== '' ? cardmodal.cardColor : 'white'">
<div class="card-body" style="display: grid; grid-template-columns: repeat(13, 1fr); grid-template-rows: repeat(7, 1fr); gap: 5px;">
<ng-container *ngFor="let item of dashboardArray">
<div [style.gridColumn]="item.x + 1" [style.gridRow]="item.y + 1" [style.gridColumnEnd]="item.x + item.cols + 1"
[style.gridRowEnd]="item.y + item.rows + 1">
<div *ngIf="item.name === 'textField'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'" [style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
{{beforeText(item.fieldtext)}}
{{ app[transform(item.fieldtext) ] }}
{{afterText(item.fieldtext)}}
</div>
<div *ngIf="item.name === 'dateField'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'" [style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
{{beforeText(item.fieldtext)}}
{{ app[transform(item.fieldtext) ] | date}}
{{afterText(item.fieldtext)}}
</div>
<div *ngIf="item.name === 'numberField'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'" [style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
{{beforeText(item.fieldtext)}}
{{ app[transform(item.fieldtext) ]}}
{{afterText(item.fieldtext)}}
</div>
<div *ngIf="item.name === 'Line'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'">
<hr>
</div>
<div *ngIf="item.name === 'Icon'" class="icon-card"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'"
>
<clr-icon [attr.shape]="item.iconName"></clr-icon>
</div>
<div *ngIf="item.name == 'Image'"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'"
[style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor"> <img id="filePreview" [src]="item.imageURL" alt="File Preview"
[style.width]="item.imagewidth !== '' ? item.imagewidth + 'px' : '100px'"
[style.height]="item.imagewidth !== '' ? item.imagewidth + 'px' : '100px'"></div>
</div>
</ng-container>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-container>
</div>
<clr-modal [(clrModalOpen)]="rsModaldescription" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
<div class="modal-body">
<textarea class="form-control" style="width:100%; height: 400px;" readonly>{{rowSelected}}</textarea>
</div></clr-modal>
<!-- // EDIT DATA......... -->
<clr-modal [(clrModalOpen)]="modalEdit" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Update Child
<!--update button -->
</h3>
<div class="modal-body" *ngIf="rowSelected.id">
<h2 class="heading">{{rowSelected.id}}</h2>
<!-- button -->
<form >
<div class="clr-row">
<div class="clr-col-sm-12">
<label>Name</label>
<input class="clr-input" type="text" [(ngModel)]="rowSelected.name" name="name" />
</div>
<div class="clr-col-sm-12">
<label> Description</label>
<textarea cols="10" rows="2"[(ngModel)]="rowSelected.description" name="description " placeholder="Textarea"> </textarea>
</div>
<div class="clr-col-sm-12">
<label> Active</label>
<input type="checkbox" name="active" clrToggle [(ngModel)]="rowSelected.active" /> </div>
</div>
<!-- form code start -->
<div *ngIf="checkFormCode">
<h4 style="font-weight: 300;display: inline;">Extension</h4>
<br>
<hr>
<div class="clr-row">
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'text'" [type]="field.fieldType" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" class="clr-input" />
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'date'" [type]="field.fieldType" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" class="clr-input" />
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
<textarea *ngSwitchCase="'textarea'" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" col="10" row="2"></textarea>
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" class="clr-checkbox" />
</ng-container>
</div>
</div>
</div>
<!-- form code end --> <div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalEdit = false">Cancel</button>
<button type="submit" class="btn btn-primary" (click)="onUpdate(rowSelected.id)">Update</button>
</div>
</form>
</div>
</clr-modal>
<clr-modal [(clrModalOpen)]="modaldelete" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<div class="modal-body" *ngIf="rowSelected.id">
<h1 class="delete">Are You Sure Want to delete?</h1>
<h2 class="heading">{{rowSelected.id}}</h2>
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modaldelete = false">Cancel</button>
<button type="button" (click)="delete(rowSelected.id)" class="btn btn-primary" >Delete</button>
</div>
</div>
</clr-modal>
<!-- ADD FORM ..... -->
<clr-modal [(clrModalOpen)]="modalAdd" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Add Child
<!-- aeroplane icon -->
&nbsp; &nbsp; &nbsp; &nbsp;
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
class="tooltip tooltip-sm tooltip-bottom-left">
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Child_formCode' }">
<clr-icon shape="airplane" size="32"></clr-icon>
</a>
<span class="tooltip-content">Form Extension</span>
</a> </h3>
<div class="modal-body">
<form [formGroup]="entryForm" >
<div class="clr-row" style="height: fit-content;">
<div class="clr-col-sm-12">
<label> Name</label>
<input class="clr-input" type="text" formControlName="name" />
</div>
<div class="clr-col-sm-12">
<label> Description</label>
<textarea cols="10" rows="2" formControlName="description" placeholder="Textarea"> </textarea>
</div>
<div class="clr-col-sm-12">
<label> Active</label>
<input type="checkbox" formControlName="active" clrToggle/> </div>
</div>
<!-- form code start -->
<div *ngIf="checkFormCode">
<h4 style="font-weight: 300;display: inline;">Extension</h4>
<br>
<hr>
<div class="clr-row">
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'text'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'date'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
<textarea *ngSwitchCase="'textarea'" [formControlName]="field.extValue" col="10" row="2"></textarea>
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-checkbox" />
</ng-container>
</div>
</div>
</div>
<!-- form code end --> <div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
<button type="submit" class="btn btn-primary" (click)="onSubmit()">ADD</button>
</div>
</form>
</div>
</clr-modal>
<!-- htmlpopup -->

View File

@@ -0,0 +1,85 @@
//@import "../../../../assets/scss/var";
.s-info-bar {
display: flex;
flex-direction: row;
justify-content: space-between;
button {
outline: none;
}
}
.delete,.heading{
text-align: center;
color: red;
}
.entry-pg {
width: 750px;
}
.button1::after {
content: none;
}
.button1:hover::after {
content: "ADD ROWS";
}
.section {
background-color: #dddddd;
height: 40px;
}
.section p {
//color: white;
padding: 10px;
font-size: 18px;
}
.clr-input {
color: #212529;
border: 1px solid #ced4da;
border-radius: 0.25rem;
padding: 0.75rem 0.75rem;
margin-top: 3px;
width: 100%;
margin-bottom: 10px;
}
.clr-file {
color: #212529;
border: 1px solid #ced4da;
border-radius: 0.25rem;
//padding: 0.6rem 0.75rem;
margin-top: 3px;
width: 100%;
margin-bottom: 10px;
}
.center {
text-align: center;
}
select{
width: 100%;
margin-top: 3px;
padding: 5px 5px;
border: 1px solid #ccc;
border-radius: 4px;
}
input[type=text],[type=date],[type=number],textarea {
width: 100%;
padding: 15px 15px;
background-color:rgb(255, 255, 255);
// margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.error_mess {
color: red;
}
.universal-section-header {
margin: 24px 0 10px 0;
font-weight: 600;
color: #1a237e;
letter-spacing: 0.5px;
font-size: 1.25rem;
}

View File

@@ -0,0 +1,275 @@
import { Component, OnInit } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { AlertService } from 'src/app/services/alert.service';
import { Childservice} from './Child.service';
import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms';
import { ExtensionService } from 'src/app/services/fnd/extension.service';
import { DashboardContentModel2 } from 'src/app/models/builder/dashboard';
import { Childcardvariable } from './Child_cardvariable';
import { UserInfoService } from 'src/app/services/user-info.service';
declare var JsBarcode: any;
@Component({
selector: 'app-Child',
templateUrl: './Child.component.html',
styleUrls: ['./Child.component.scss']
})
export class ChildComponent implements OnInit {
cardButton = Childcardvariable.cardButton;
cardmodeldata = Childcardvariable.cardmodeldata;
public dashboardArray: DashboardContentModel2[];
isCardview = Childcardvariable.cardButton;
cardmodal; changeView(){
this.isCardview = !this.isCardview;
}
beforeText(fieldtext: string): string { // Extract the text before the first '<'
const index = fieldtext.indexOf('<');
return index !== -1 ? fieldtext.substring(0, index) : fieldtext;
}
afterText(fieldtext: string): string { // Extract the text after the last '>'
const index = fieldtext.lastIndexOf('>');
return index !== -1 ? fieldtext.substring(index + 1) : '';
}
transform(fieldtext: string): string {
const match = fieldtext.match(/<([^>]*)>/);
return match ? match[1] : ''; // Extract the text between '<' and '>'
}
userrole;
rowSelected :any= {};
modaldelete=false;
modalEdit=false;
modalAdd= false;
public entryForm: FormGroup;
loading = false;
product;
modalOpenedforNewLine = false;
newLine:any;
additionalFieldsFromBackend: any[] = [];
formcode = 'Child_formCode'
tableName = 'Child'; checkFormCode; selected: any[] = []; constructor(
private extensionService: ExtensionService,
private userInfoService:UserInfoService,
private mainService:Childservice,
private alertService: AlertService,
private toastr: ToastrService,
private _fb: FormBuilder,
) { }
private editInterval: any;
// component button
ngOnInit(): void {
if(this.cardmodeldata !== ''){
this.cardmodal = JSON.parse(this.cardmodeldata);
this.dashboardArray = this.cardmodal.dashboard.slice();
console.log(this.dashboardArray)
}
this.userrole=this.userInfoService.getRoles();
this.getData();
this.entryForm = this._fb.group({
name : [null],
description : [null],
active : [true],
}); // component_button200
// form code start
this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => {
console.log(data);
const jsonArray = data.map((str) => JSON.parse(str));
this.additionalFieldsFromBackend = jsonArray;
this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Child_formCode");
console.log(this.checkFormCode);
console.log(this.additionalFieldsFromBackend);
if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) {
this.additionalFieldsFromBackend.forEach(field => {
if (field.formCode === this.formcode) {
if (!this.entryForm.contains(field.extValue)) {
// Add the control only if it doesn't exist in the form
this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue));
}
}
});
}
});
console.log(this.entryForm.value);
// form code end
}
ngOnDestroy(): void {
if (this.editInterval) {
clearInterval(this.editInterval);
}
}
error;
getData() {
this.mainService.getAll().subscribe((data) => {
console.log(data);
this.product = data;
this.product = [...this.product].reverse(); if(this.product.length==0){
this.error="No Data Available"
}
},(error) => {
console.log(error);
if(error){
this.error="Server Error";
}
});
}
onEdit(row) {
this.rowSelected = row;
this.modalEdit = true;
}
onDelete(row) {
this.rowSelected = row;
this.modaldelete=true;
}
delete(id)
{
this.modaldelete = false;
console.log("in delete "+id);
this.mainService.delete(id).subscribe(
(data) => {
console.log(data);
this.ngOnInit();
if (data) { this.toastr.success('Deleted successfully'); }
});
}
onUpdate(id) {
this.modalEdit = false;
//console.log("in update");
console.log("id " + id);
console.log(this.rowSelected);
//console.log("out update");
this.mainService.update(id, this.rowSelected).subscribe(
(data) => {
console.log(data);
if (data || data.status >= 200 && data.status <= 299) {
this.toastr.success("Update Successfully");
}
setTimeout(() => {
this.ngOnInit();
}, 500);
}, (error) => {
console.log(error);
if (error.status >= 200 && error.status <= 299) {
// this.toastr.success("update Succesfully");
}
if (error.status >= 400 && error.status <= 499) {
this.toastr.error("Not Updated");
}
if (error.status >= 500 && error.status <= 599) {
this.toastr.error("Not Updated");
}
});
setTimeout(() => {
this.ngOnInit();
}, 500);
}
onCreate() {
this.modalAdd=false;
this.mainService.create(this.entryForm.value).subscribe(
(data) => {
console.log(data);
if (data || data.status >= 200 && data.status <= 299) {
this.toastr.success("Added Successfully");
}
setTimeout(() => {
this.ngOnInit();
}, 500);
}, (error) => {
console.log(error);
if (error.status >= 200 && error.status <= 299) {
// this.toastr.success("Added Succesfully");
}
if (error.status >= 400 && error.status <= 499) {
this.toastr.error("Not Added");
}
if (error.status >= 500 && error.status <= 599) {
this.toastr.error("Not Added");
}
});
setTimeout(() => {
this.ngOnInit();
}, 500);
}
goToAdd(row) {
this.modalAdd = true; this.submitted = false;
}
submitted = false;
onSubmit() {
console.log(this.entryForm.value);
this.submitted = true;
if (this.entryForm.invalid) {
return;
}this.onCreate();
}
rsModaldescription = false;
goToReplaceStringdescription(row){
this.rowSelected = row; this.rsModaldescription =true; }
// updateaction
}

View File

@@ -0,0 +1,39 @@
import { Injectable } from '@angular/core';
import { Observable } from "rxjs";
import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http";
import { ApiRequestService } from "src/app/services/api/api-request.service";
import { environment } from 'src/environments/environment';
@Injectable({
providedIn: 'root'
})
export class Childservice{
private baseURL = "Child/Child" ; constructor(
private http: HttpClient,
private apiRequest: ApiRequestService,
) { }
getAll(page?: number, size?: number): Observable<any> {
return this.apiRequest.get(this.baseURL);
}
getById(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.get(_http);
}
create(data: any): Observable<any> {
return this.apiRequest.post(this.baseURL, data);
}
update(id: number, data: any): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.put(_http, data);
}
delete(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.delete(_http);
}
// updateaction
}

View File

@@ -0,0 +1,4 @@
export const Childcardvariable = {
"cardButton": false,
"cardmodeldata": ``
}

View File

@@ -0,0 +1,376 @@
<ol class="breadcrumb breadcrumb-arrow font-trirong">
<li><a href="javascript://"> Contry</a></li>
</ol>
<div class="dg-wrapper">
<div class="clr-row">
<div class="clr-col-8">
<h3>Contry </h3>
</div>
<div class="clr-col-4" style="text-align: right;">
<button *ngIf="cardButton" id="add" class="btn btn-primary btn-icon" (click)="changeView()" >
<clr-icon *ngIf="!isCardview" shape="grid-view"></clr-icon> <clr-icon *ngIf="isCardview" shape="bars"></clr-icon>
</button>
<!-- button -->
<button id="add" class="btn btn-primary" (click)="goToAdd(product)" >
<clr-icon shape="plus"></clr-icon>ADD
</button>
</div></div>
<ng-container *ngIf="!isCardview"> <!-- GET ALL --> <clr-datagrid [clrDgLoading]="loading" [(clrDgSelected)]="selected">
<clr-dg-placeholder>
<ng-template #loadingSpinner>
<clr-spinner>Loading ... </clr-spinner>
</ng-template>
<div *ngIf="error;else loadingSpinner">{{error}}</div>
</clr-dg-placeholder>
<clr-dg-column [clrDgField]="'name'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Name
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'description'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Description
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'active'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Active
</ng-container></clr-dg-column>
<!-- who column -->
<clr-dg-column> <ng-container *clrDgHideableColumn="{hidden: false}">
<clr-icon shape="bars"></clr-icon> Action
</ng-container></clr-dg-column>
<!-- end -->
<clr-dg-row *clrDgItems="let user of product" [clrDgItem]="user">
<clr-dg-cell>{{user.name }}</clr-dg-cell>
<clr-dg-cell (click)="goToReplaceStringdescription (user.description)" style="cursor: pointer; align-items: center;"><clr-icon shape="details"></clr-icon>
</clr-dg-cell>
<clr-dg-cell>{{user.active }}</clr-dg-cell>
<!-- who column -->
<clr-dg-cell>
<clr-signpost>
<span style="cursor: pointer;" clrSignpostTrigger><clr-icon shape="help" class="success" style="color: rgb(0, 130, 236);"></clr-icon></span>
<clr-signpost-content [clrPosition]="'left-middle'" *clrIfOpen>
<h5 style="margin-top: 0">Who Column</h5>
<div>Account ID: <code class="clr-code">{{user.accountId}}</code></div>
<div>Created At: <code class="clr-code">{{user.createdAt| date}}</code></div>
<div>Created By: <code class="clr-code">{{user.createdBy}}</code></div>
<div>Updated At: <code class="clr-code">{{user.updatedAt | date}}</code></div>
<div>Updated By: <code class="clr-code">{{user.updatedBy}}</code></div>
</clr-signpost-content>
</clr-signpost>
</clr-dg-cell>
<!-- who colmn -->
<clr-dg-action-overflow>
<button class="action-item" (click)="onEdit(user)">Edit</button>
<button class="action-item" (click)="onDelete(user)">Delete</button>
</clr-dg-action-overflow>
</clr-dg-row>
<clr-dg-footer>
<clr-dg-pagination #pagination [clrDgPageSize]="10">
<clr-dg-page-size [clrPageSizeOptions]="[10,20,50,100]">Users per page</clr-dg-page-size>
{{pagination.firstItem + 1}} - {{pagination.lastItem + 1}}
of {{pagination.totalItems}} users
</clr-dg-pagination>
</clr-dg-footer>
</clr-datagrid> </ng-container>
<ng-template #showInfo>
<div class="alert alert-info" role="alert">
<div class="alert-items">
<div class="alert-item static">
<span class="alert-text">
<clr-icon class="alert-icon" shape="info-circle"></clr-icon>
Data could be found. Loading..
<clr-spinner [clrMedium]="true">Loading ...</clr-spinner>
</span>
</div>
</div>
</div>
</ng-template><ng-container *ngIf="isCardview">
<div *ngIf="product; else showInfo" class="clr-row clr-align-items-start clr-justify-content-start">
<div *ngFor="let app of product| filter:search; let index = i" class="clr-col-auto" >
<div class="clr-row">
<div class="clr-col-lg-12 clr-col-md-4 clr-col-sm-4 clr-col-12" style="width: 410px;">
<div class="card" style="padding: 10px; "[style.background-color]="cardmodal.cardColor !== '' ? cardmodal.cardColor : 'white'">
<div class="card-body" style="display: grid; grid-template-columns: repeat(13, 1fr); grid-template-rows: repeat(7, 1fr); gap: 5px;">
<ng-container *ngFor="let item of dashboardArray">
<div [style.gridColumn]="item.x + 1" [style.gridRow]="item.y + 1" [style.gridColumnEnd]="item.x + item.cols + 1"
[style.gridRowEnd]="item.y + item.rows + 1">
<div *ngIf="item.name === 'textField'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'" [style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
{{beforeText(item.fieldtext)}}
{{ app[transform(item.fieldtext) ] }}
{{afterText(item.fieldtext)}}
</div>
<div *ngIf="item.name === 'dateField'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'" [style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
{{beforeText(item.fieldtext)}}
{{ app[transform(item.fieldtext) ] | date}}
{{afterText(item.fieldtext)}}
</div>
<div *ngIf="item.name === 'numberField'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'" [style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
{{beforeText(item.fieldtext)}}
{{ app[transform(item.fieldtext) ]}}
{{afterText(item.fieldtext)}}
</div>
<div *ngIf="item.name === 'Line'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'">
<hr>
</div>
<div *ngIf="item.name === 'Icon'" class="icon-card"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'"
>
<clr-icon [attr.shape]="item.iconName"></clr-icon>
</div>
<div *ngIf="item.name == 'Image'"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'"
[style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor"> <img id="filePreview" [src]="item.imageURL" alt="File Preview"
[style.width]="item.imagewidth !== '' ? item.imagewidth + 'px' : '100px'"
[style.height]="item.imagewidth !== '' ? item.imagewidth + 'px' : '100px'"></div>
</div>
</ng-container>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-container>
</div>
<clr-modal [(clrModalOpen)]="rsModaldescription" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
<div class="modal-body">
<textarea class="form-control" style="width:100%; height: 400px;" readonly>{{rowSelected}}</textarea>
</div></clr-modal>
<!-- // EDIT DATA......... -->
<clr-modal [(clrModalOpen)]="modalEdit" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Update Contry
<!--update button -->
</h3>
<div class="modal-body" *ngIf="rowSelected.id">
<h2 class="heading">{{rowSelected.id}}</h2>
<!-- button -->
<form >
<div class="clr-row">
<div class="clr-col-sm-12">
<label>Name</label>
<input class="clr-input" type="text" [(ngModel)]="rowSelected.name" name="name" />
</div>
<div class="clr-col-sm-12">
<label> Description</label>
<textarea cols="10" rows="2"[(ngModel)]="rowSelected.description" name="description " placeholder="Textarea"> </textarea>
</div>
<div class="clr-col-sm-12">
<label> Active</label>
<input type="checkbox" name="active" clrToggle [(ngModel)]="rowSelected.active" /> </div>
</div>
<!-- form code start -->
<div *ngIf="checkFormCode">
<h4 style="font-weight: 300;display: inline;">Extension</h4>
<br>
<hr>
<div class="clr-row">
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'text'" [type]="field.fieldType" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" class="clr-input" />
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'date'" [type]="field.fieldType" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" class="clr-input" />
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
<textarea *ngSwitchCase="'textarea'" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" col="10" row="2"></textarea>
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" class="clr-checkbox" />
</ng-container>
</div>
</div>
</div>
<!-- form code end --> <div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalEdit = false">Cancel</button>
<button type="submit" class="btn btn-primary" (click)="onUpdate(rowSelected.id)">Update</button>
</div>
</form>
</div>
</clr-modal>
<clr-modal [(clrModalOpen)]="modaldelete" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<div class="modal-body" *ngIf="rowSelected.id">
<h1 class="delete">Are You Sure Want to delete?</h1>
<h2 class="heading">{{rowSelected.id}}</h2>
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modaldelete = false">Cancel</button>
<button type="button" (click)="delete(rowSelected.id)" class="btn btn-primary" >Delete</button>
</div>
</div>
</clr-modal>
<!-- ADD FORM ..... -->
<clr-modal [(clrModalOpen)]="modalAdd" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Add Contry
<!-- aeroplane icon -->
&nbsp; &nbsp; &nbsp; &nbsp;
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
class="tooltip tooltip-sm tooltip-bottom-left">
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Contry_formCode' }">
<clr-icon shape="airplane" size="32"></clr-icon>
</a>
<span class="tooltip-content">Form Extension</span>
</a> </h3>
<div class="modal-body">
<form [formGroup]="entryForm" >
<div class="clr-row" style="height: fit-content;">
<div class="clr-col-sm-12">
<label> Name</label>
<input class="clr-input" type="text" formControlName="name" />
</div>
<div class="clr-col-sm-12">
<label> Description</label>
<textarea cols="10" rows="2" formControlName="description" placeholder="Textarea"> </textarea>
</div>
<div class="clr-col-sm-12">
<label> Active</label>
<input type="checkbox" formControlName="active" clrToggle/> </div>
</div>
<!-- form code start -->
<div *ngIf="checkFormCode">
<h4 style="font-weight: 300;display: inline;">Extension</h4>
<br>
<hr>
<div class="clr-row">
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'text'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'date'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
<textarea *ngSwitchCase="'textarea'" [formControlName]="field.extValue" col="10" row="2"></textarea>
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-checkbox" />
</ng-container>
</div>
</div>
</div>
<!-- form code end --> <div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
<button type="submit" class="btn btn-primary" (click)="onSubmit()">ADD</button>
</div>
</form>
</div>
</clr-modal>
<!-- htmlpopup -->

View File

@@ -0,0 +1,85 @@
//@import "../../../../assets/scss/var";
.s-info-bar {
display: flex;
flex-direction: row;
justify-content: space-between;
button {
outline: none;
}
}
.delete,.heading{
text-align: center;
color: red;
}
.entry-pg {
width: 750px;
}
.button1::after {
content: none;
}
.button1:hover::after {
content: "ADD ROWS";
}
.section {
background-color: #dddddd;
height: 40px;
}
.section p {
//color: white;
padding: 10px;
font-size: 18px;
}
.clr-input {
color: #212529;
border: 1px solid #ced4da;
border-radius: 0.25rem;
padding: 0.75rem 0.75rem;
margin-top: 3px;
width: 100%;
margin-bottom: 10px;
}
.clr-file {
color: #212529;
border: 1px solid #ced4da;
border-radius: 0.25rem;
//padding: 0.6rem 0.75rem;
margin-top: 3px;
width: 100%;
margin-bottom: 10px;
}
.center {
text-align: center;
}
select{
width: 100%;
margin-top: 3px;
padding: 5px 5px;
border: 1px solid #ccc;
border-radius: 4px;
}
input[type=text],[type=date],[type=number],textarea {
width: 100%;
padding: 15px 15px;
background-color:rgb(255, 255, 255);
// margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.error_mess {
color: red;
}
.universal-section-header {
margin: 24px 0 10px 0;
font-weight: 600;
color: #1a237e;
letter-spacing: 0.5px;
font-size: 1.25rem;
}

View File

@@ -0,0 +1,275 @@
import { Component, OnInit } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { AlertService } from 'src/app/services/alert.service';
import { Contryservice} from './Contry.service';
import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms';
import { ExtensionService } from 'src/app/services/fnd/extension.service';
import { DashboardContentModel2 } from 'src/app/models/builder/dashboard';
import { Contrycardvariable } from './Contry_cardvariable';
import { UserInfoService } from 'src/app/services/user-info.service';
declare var JsBarcode: any;
@Component({
selector: 'app-Contry',
templateUrl: './Contry.component.html',
styleUrls: ['./Contry.component.scss']
})
export class ContryComponent implements OnInit {
cardButton = Contrycardvariable.cardButton;
cardmodeldata = Contrycardvariable.cardmodeldata;
public dashboardArray: DashboardContentModel2[];
isCardview = Contrycardvariable.cardButton;
cardmodal; changeView(){
this.isCardview = !this.isCardview;
}
beforeText(fieldtext: string): string { // Extract the text before the first '<'
const index = fieldtext.indexOf('<');
return index !== -1 ? fieldtext.substring(0, index) : fieldtext;
}
afterText(fieldtext: string): string { // Extract the text after the last '>'
const index = fieldtext.lastIndexOf('>');
return index !== -1 ? fieldtext.substring(index + 1) : '';
}
transform(fieldtext: string): string {
const match = fieldtext.match(/<([^>]*)>/);
return match ? match[1] : ''; // Extract the text between '<' and '>'
}
userrole;
rowSelected :any= {};
modaldelete=false;
modalEdit=false;
modalAdd= false;
public entryForm: FormGroup;
loading = false;
product;
modalOpenedforNewLine = false;
newLine:any;
additionalFieldsFromBackend: any[] = [];
formcode = 'Contry_formCode'
tableName = 'Contry'; checkFormCode; selected: any[] = []; constructor(
private extensionService: ExtensionService,
private userInfoService:UserInfoService,
private mainService:Contryservice,
private alertService: AlertService,
private toastr: ToastrService,
private _fb: FormBuilder,
) { }
private editInterval: any;
// component button
ngOnInit(): void {
if(this.cardmodeldata !== ''){
this.cardmodal = JSON.parse(this.cardmodeldata);
this.dashboardArray = this.cardmodal.dashboard.slice();
console.log(this.dashboardArray)
}
this.userrole=this.userInfoService.getRoles();
this.getData();
this.entryForm = this._fb.group({
name : [null],
description : [null],
active : [true],
}); // component_button200
// form code start
this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => {
console.log(data);
const jsonArray = data.map((str) => JSON.parse(str));
this.additionalFieldsFromBackend = jsonArray;
this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Contry_formCode");
console.log(this.checkFormCode);
console.log(this.additionalFieldsFromBackend);
if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) {
this.additionalFieldsFromBackend.forEach(field => {
if (field.formCode === this.formcode) {
if (!this.entryForm.contains(field.extValue)) {
// Add the control only if it doesn't exist in the form
this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue));
}
}
});
}
});
console.log(this.entryForm.value);
// form code end
}
ngOnDestroy(): void {
if (this.editInterval) {
clearInterval(this.editInterval);
}
}
error;
getData() {
this.mainService.getAll().subscribe((data) => {
console.log(data);
this.product = data;
this.product = [...this.product].reverse(); if(this.product.length==0){
this.error="No Data Available"
}
},(error) => {
console.log(error);
if(error){
this.error="Server Error";
}
});
}
onEdit(row) {
this.rowSelected = row;
this.modalEdit = true;
}
onDelete(row) {
this.rowSelected = row;
this.modaldelete=true;
}
delete(id)
{
this.modaldelete = false;
console.log("in delete "+id);
this.mainService.delete(id).subscribe(
(data) => {
console.log(data);
this.ngOnInit();
if (data) { this.toastr.success('Deleted successfully'); }
});
}
onUpdate(id) {
this.modalEdit = false;
//console.log("in update");
console.log("id " + id);
console.log(this.rowSelected);
//console.log("out update");
this.mainService.update(id, this.rowSelected).subscribe(
(data) => {
console.log(data);
if (data || data.status >= 200 && data.status <= 299) {
this.toastr.success("Update Successfully");
}
setTimeout(() => {
this.ngOnInit();
}, 500);
}, (error) => {
console.log(error);
if (error.status >= 200 && error.status <= 299) {
// this.toastr.success("update Succesfully");
}
if (error.status >= 400 && error.status <= 499) {
this.toastr.error("Not Updated");
}
if (error.status >= 500 && error.status <= 599) {
this.toastr.error("Not Updated");
}
});
setTimeout(() => {
this.ngOnInit();
}, 500);
}
onCreate() {
this.modalAdd=false;
this.mainService.create(this.entryForm.value).subscribe(
(data) => {
console.log(data);
if (data || data.status >= 200 && data.status <= 299) {
this.toastr.success("Added Successfully");
}
setTimeout(() => {
this.ngOnInit();
}, 500);
}, (error) => {
console.log(error);
if (error.status >= 200 && error.status <= 299) {
// this.toastr.success("Added Succesfully");
}
if (error.status >= 400 && error.status <= 499) {
this.toastr.error("Not Added");
}
if (error.status >= 500 && error.status <= 599) {
this.toastr.error("Not Added");
}
});
setTimeout(() => {
this.ngOnInit();
}, 500);
}
goToAdd(row) {
this.modalAdd = true; this.submitted = false;
}
submitted = false;
onSubmit() {
console.log(this.entryForm.value);
this.submitted = true;
if (this.entryForm.invalid) {
return;
}this.onCreate();
}
rsModaldescription = false;
goToReplaceStringdescription(row){
this.rowSelected = row; this.rsModaldescription =true; }
// updateaction
}

View File

@@ -0,0 +1,39 @@
import { Injectable } from '@angular/core';
import { Observable } from "rxjs";
import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http";
import { ApiRequestService } from "src/app/services/api/api-request.service";
import { environment } from 'src/environments/environment';
@Injectable({
providedIn: 'root'
})
export class Contryservice{
private baseURL = "Contry/Contry" ; constructor(
private http: HttpClient,
private apiRequest: ApiRequestService,
) { }
getAll(page?: number, size?: number): Observable<any> {
return this.apiRequest.get(this.baseURL);
}
getById(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.get(_http);
}
create(data: any): Observable<any> {
return this.apiRequest.post(this.baseURL, data);
}
update(id: number, data: any): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.put(_http, data);
}
delete(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.delete(_http);
}
// updateaction
}

View File

@@ -0,0 +1,4 @@
export const Contrycardvariable = {
"cardButton": false,
"cardmodeldata": ``
}

View File

@@ -0,0 +1,405 @@
<ol class="breadcrumb breadcrumb-arrow font-trirong">
<li><a href="javascript://"> Distric</a></li>
</ol>
<div class="dg-wrapper">
<div class="clr-row">
<div class="clr-col-8">
<h3>Distric </h3>
</div>
<div class="clr-col-4" style="text-align: right;">
<button *ngIf="cardButton" id="add" class="btn btn-primary btn-icon" (click)="changeView()" >
<clr-icon *ngIf="!isCardview" shape="grid-view"></clr-icon> <clr-icon *ngIf="isCardview" shape="bars"></clr-icon>
</button>
<!-- button -->
<button id="add" class="btn btn-primary" (click)="goToAdd(product)" >
<clr-icon shape="plus"></clr-icon>ADD
</button>
</div></div>
<ng-container *ngIf="!isCardview"> <!-- GET ALL --> <clr-datagrid [clrDgLoading]="loading" [(clrDgSelected)]="selected">
<clr-dg-placeholder>
<ng-template #loadingSpinner>
<clr-spinner>Loading ... </clr-spinner>
</ng-template>
<div *ngIf="error;else loadingSpinner">{{error}}</div>
</clr-dg-placeholder>
<clr-dg-column [clrDgField]="'distric_name'"> <ng-container *clrDgHideableColumn="{hidden: false}"> distric Name
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'description'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Description
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'active'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Active
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="'state_name'"> <ng-container *clrDgHideableColumn="{hidden: false}"> state name
</ng-container></clr-dg-column>
<!-- who column -->
<clr-dg-column> <ng-container *clrDgHideableColumn="{hidden: false}">
<clr-icon shape="bars"></clr-icon> Action
</ng-container></clr-dg-column>
<!-- end -->
<clr-dg-row *clrDgItems="let user of product" [clrDgItem]="user">
<clr-dg-cell>{{user.distric_name }}</clr-dg-cell>
<clr-dg-cell (click)="goToReplaceStringdescription (user.description)" style="cursor: pointer; align-items: center;"><clr-icon shape="details"></clr-icon>
</clr-dg-cell>
<clr-dg-cell>{{user.active }}</clr-dg-cell>
<clr-dg-cell>{{user.state_name }}</clr-dg-cell>
<!-- who column -->
<clr-dg-cell>
<clr-signpost>
<span style="cursor: pointer;" clrSignpostTrigger><clr-icon shape="help" class="success" style="color: rgb(0, 130, 236);"></clr-icon></span>
<clr-signpost-content [clrPosition]="'left-middle'" *clrIfOpen>
<h5 style="margin-top: 0">Who Column</h5>
<div>Account ID: <code class="clr-code">{{user.accountId}}</code></div>
<div>Created At: <code class="clr-code">{{user.createdAt| date}}</code></div>
<div>Created By: <code class="clr-code">{{user.createdBy}}</code></div>
<div>Updated At: <code class="clr-code">{{user.updatedAt | date}}</code></div>
<div>Updated By: <code class="clr-code">{{user.updatedBy}}</code></div>
</clr-signpost-content>
</clr-signpost>
</clr-dg-cell>
<!-- who colmn -->
<clr-dg-action-overflow>
<button class="action-item" (click)="onEdit(user)">Edit</button>
<button class="action-item" (click)="onDelete(user)">Delete</button>
</clr-dg-action-overflow>
</clr-dg-row>
<clr-dg-footer>
<clr-dg-pagination #pagination [clrDgPageSize]="10">
<clr-dg-page-size [clrPageSizeOptions]="[10,20,50,100]">Users per page</clr-dg-page-size>
{{pagination.firstItem + 1}} - {{pagination.lastItem + 1}}
of {{pagination.totalItems}} users
</clr-dg-pagination>
</clr-dg-footer>
</clr-datagrid> </ng-container>
<ng-template #showInfo>
<div class="alert alert-info" role="alert">
<div class="alert-items">
<div class="alert-item static">
<span class="alert-text">
<clr-icon class="alert-icon" shape="info-circle"></clr-icon>
Data could be found. Loading..
<clr-spinner [clrMedium]="true">Loading ...</clr-spinner>
</span>
</div>
</div>
</div>
</ng-template><ng-container *ngIf="isCardview">
<div *ngIf="product; else showInfo" class="clr-row clr-align-items-start clr-justify-content-start">
<div *ngFor="let app of product| filter:search; let index = i" class="clr-col-auto" >
<div class="clr-row">
<div class="clr-col-lg-12 clr-col-md-4 clr-col-sm-4 clr-col-12" style="width: 410px;">
<div class="card" style="padding: 10px; "[style.background-color]="cardmodal.cardColor !== '' ? cardmodal.cardColor : 'white'">
<div class="card-body" style="display: grid; grid-template-columns: repeat(13, 1fr); grid-template-rows: repeat(7, 1fr); gap: 5px;">
<ng-container *ngFor="let item of dashboardArray">
<div [style.gridColumn]="item.x + 1" [style.gridRow]="item.y + 1" [style.gridColumnEnd]="item.x + item.cols + 1"
[style.gridRowEnd]="item.y + item.rows + 1">
<div *ngIf="item.name === 'textField'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'" [style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
{{beforeText(item.fieldtext)}}
{{ app[transform(item.fieldtext) ] }}
{{afterText(item.fieldtext)}}
</div>
<div *ngIf="item.name === 'dateField'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'" [style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
{{beforeText(item.fieldtext)}}
{{ app[transform(item.fieldtext) ] | date}}
{{afterText(item.fieldtext)}}
</div>
<div *ngIf="item.name === 'numberField'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'" [style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor">
{{beforeText(item.fieldtext)}}
{{ app[transform(item.fieldtext) ]}}
{{afterText(item.fieldtext)}}
</div>
<div *ngIf="item.name === 'Line'" class="title-card card-title"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'">
<hr>
</div>
<div *ngIf="item.name === 'Icon'" class="icon-card"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'"
>
<clr-icon [attr.shape]="item.iconName"></clr-icon>
</div>
<div *ngIf="item.name == 'Image'"
[style.text-align]="item.alignment !== '' ? item.alignment : 'left'"
[style.line-height]="item.textlineheight !== '' ? item.textlineheight : '1'"
[style.font-family]="item.fontName !== '' ? item.fontName : 'Metropolis'"
[style.font-size]="item.fontSize !== '' ? item.fontSize : '100%'"
[style.font-style]="item.italic == true ? 'Italic' : 'normal'"
[style.font-weight]="item.bold == true ? 'bold' : 'normal'" [style.text-decoration]="(item.underline && item.strikethough) ? 'underline line-through' :
(item.underline ? 'underline' : (item.strikethough ? 'line-through' : 'none'))"
[style.background-color]="item.backgroundcolor !== '' ? item.backgroundcolor : 'white'"
[style.color]="item.textcolor !== '' ? item.textcolor : 'black'"
[style.background-color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditionbackgroundcolor : item.backgroundcolor"
[style.color]="item.conditionValue == app[transform(item.fieldtext) ] ? item.conditiontextcolor : item.textcolor"> <img id="filePreview" [src]="item.imageURL" alt="File Preview"
[style.width]="item.imagewidth !== '' ? item.imagewidth + 'px' : '100px'"
[style.height]="item.imagewidth !== '' ? item.imagewidth + 'px' : '100px'"></div>
</div>
</ng-container>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-container>
</div>
<clr-modal [(clrModalOpen)]="rsModaldescription" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
<div class="modal-body">
<textarea class="form-control" style="width:100%; height: 400px;" readonly>{{rowSelected}}</textarea>
</div></clr-modal>
<!-- // EDIT DATA......... -->
<clr-modal [(clrModalOpen)]="modalEdit" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Update Distric
<!--update button -->
</h3>
<div class="modal-body" *ngIf="rowSelected.id">
<h2 class="heading">{{rowSelected.id}}</h2>
<!-- button -->
<form >
<div class="clr-row">
<div class="clr-col-sm-12">
<label>distric Name</label>
<input class="clr-input" type="text" [(ngModel)]="rowSelected.distric_name" name="distric_name" />
</div>
<div class="clr-col-sm-12">
<label> Description</label>
<textarea cols="10" rows="2"[(ngModel)]="rowSelected.description" name="description " placeholder="Textarea"> </textarea>
</div>
<div class="clr-col-sm-12">
<label> Active</label>
<input type="checkbox" name="active" clrToggle [(ngModel)]="rowSelected.active" /> </div>
<div class="clr-col-sm-12">
<label>state name</label>
<input class="clr-input" type="text" [(ngModel)]="rowSelected.state_name" name="state_name" />
</div>
</div>
<!-- form code start -->
<div *ngIf="checkFormCode">
<h4 style="font-weight: 300;display: inline;">Extension</h4>
<br>
<hr>
<div class="clr-row">
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'text'" [type]="field.fieldType" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" class="clr-input" />
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'date'" [type]="field.fieldType" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" class="clr-input" />
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
<textarea *ngSwitchCase="'textarea'" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" col="10" row="2"></textarea>
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" name="{{ field.extValue }}" [(ngModel)]="rowSelected[field.extValue]" class="clr-checkbox" />
</ng-container>
</div>
</div>
</div>
<!-- form code end --> <div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalEdit = false">Cancel</button>
<button type="submit" class="btn btn-primary" (click)="onUpdate(rowSelected.id)">Update</button>
</div>
</form>
</div>
</clr-modal>
<clr-modal [(clrModalOpen)]="modaldelete" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<div class="modal-body" *ngIf="rowSelected.id">
<h1 class="delete">Are You Sure Want to delete?</h1>
<h2 class="heading">{{rowSelected.id}}</h2>
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modaldelete = false">Cancel</button>
<button type="button" (click)="delete(rowSelected.id)" class="btn btn-primary" >Delete</button>
</div>
</div>
</clr-modal>
<!-- ADD FORM ..... -->
<clr-modal [(clrModalOpen)]="modalAdd" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Add Distric
<!-- aeroplane icon -->
&nbsp; &nbsp; &nbsp; &nbsp;
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
class="tooltip tooltip-sm tooltip-bottom-left">
<a id="build_extension" [routerLink]="['../extension/all']" [queryParams]="{ formCode: 'Distric_formCode' }">
<clr-icon shape="airplane" size="32"></clr-icon>
</a>
<span class="tooltip-content">Form Extension</span>
</a> </h3>
<div class="modal-body">
<form [formGroup]="entryForm" >
<div class="clr-row" style="height: fit-content;">
<div class="clr-col-sm-12">
<label> distric Name</label>
<input class="clr-input" type="text" formControlName="distric_name" />
</div>
<div class="clr-col-sm-12">
<label> Description</label>
<textarea cols="10" rows="2" formControlName="description" placeholder="Textarea"> </textarea>
</div>
<div class="clr-col-sm-12">
<label> Active</label>
<input type="checkbox" formControlName="active" clrToggle/> </div>
<div class="clr-col-sm-12">
<label> state name</label>
<input class="clr-input" type="text" formControlName="state_name" />
</div>
</div>
<!-- form code start -->
<div *ngIf="checkFormCode">
<h4 style="font-weight: 300;display: inline;">Extension</h4>
<br>
<hr>
<div class="clr-row">
<div class="clr-col-4" *ngFor="let field of additionalFieldsFromBackend">
<ng-container *ngIf="field.formCode === formcode" [ngSwitch]="field.fieldType">
<!-- Text Input --> <label *ngSwitchCase="'text'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'text'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Date Input --> <label *ngSwitchCase="'date'">{{ field.fieldName }}</label>
<input *ngSwitchCase="'date'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-input" />
<!-- Textarea --> <label *ngSwitchCase="'textarea'">{{ field.fieldName }}</label>
<textarea *ngSwitchCase="'textarea'" [formControlName]="field.extValue" col="10" row="2"></textarea>
<!-- Checkbox --> <label *ngSwitchCase="'checkbox'">{{ field.fieldName }}</label><br>
<input *ngSwitchCase="'checkbox'" [type]="field.fieldType" [formControlName]="field.extValue"
class="clr-checkbox" />
</ng-container>
</div>
</div>
</div>
<!-- form code end --> <div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
<button type="submit" class="btn btn-primary" (click)="onSubmit()">ADD</button>
</div>
</form>
</div>
</clr-modal>
<!-- htmlpopup -->

View File

@@ -0,0 +1,85 @@
//@import "../../../../assets/scss/var";
.s-info-bar {
display: flex;
flex-direction: row;
justify-content: space-between;
button {
outline: none;
}
}
.delete,.heading{
text-align: center;
color: red;
}
.entry-pg {
width: 750px;
}
.button1::after {
content: none;
}
.button1:hover::after {
content: "ADD ROWS";
}
.section {
background-color: #dddddd;
height: 40px;
}
.section p {
//color: white;
padding: 10px;
font-size: 18px;
}
.clr-input {
color: #212529;
border: 1px solid #ced4da;
border-radius: 0.25rem;
padding: 0.75rem 0.75rem;
margin-top: 3px;
width: 100%;
margin-bottom: 10px;
}
.clr-file {
color: #212529;
border: 1px solid #ced4da;
border-radius: 0.25rem;
//padding: 0.6rem 0.75rem;
margin-top: 3px;
width: 100%;
margin-bottom: 10px;
}
.center {
text-align: center;
}
select{
width: 100%;
margin-top: 3px;
padding: 5px 5px;
border: 1px solid #ccc;
border-radius: 4px;
}
input[type=text],[type=date],[type=number],textarea {
width: 100%;
padding: 15px 15px;
background-color:rgb(255, 255, 255);
// margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.error_mess {
color: red;
}
.universal-section-header {
margin: 24px 0 10px 0;
font-weight: 600;
color: #1a237e;
letter-spacing: 0.5px;
font-size: 1.25rem;
}

Some files were not shown because too many files have changed in this diff Show More