diff --git a/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java index 5b4b8cb..b75749b 100644 --- a/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java +++ b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java @@ -68,6 +68,12 @@ public class BuilderService { public void callotherService() { // ADD OTHER SERVICE +addCustomMenu( "Formbtest", "Transcations"); + + +addCustomMenu( "Formatest", "Transcations"); + + executeDump(true, "dump.sql"); diff --git a/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/FormatestController.java b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/FormatestController.java new file mode 100644 index 0000000..bd38841 --- /dev/null +++ b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/FormatestController.java @@ -0,0 +1,90 @@ +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.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.beans.factory.annotation.*; +import com.realnet.basicp1.Entity.Formatest; +import com.realnet.basicp1.Services.FormatestService ; +@RequestMapping(value = "/Formatest") + @CrossOrigin("*") +@RestController +public class FormatestController { + @Autowired + private FormatestService Service; + +@Value("${projectPath}") + private String projectPath; + + + + + + + + + + @PostMapping("/Formatest") + public Formatest Savedata(@RequestBody Formatest data) { + Formatest save = Service.Savedata(data) ; + + + + + + + + System.out.println("data saved..." + save); + + return save; + } +@PutMapping("/Formatest/{id}") + public Formatest update(@RequestBody Formatest data,@PathVariable Integer id ) { + Formatest update = Service.update(data,id); + System.out.println("data update..." + update); + return update; + } +// get all with pagination + @GetMapping("/Formatest/getall/page") + public Page getall(@RequestParam(value = "page", required = false) Integer page, + @RequestParam(value = "size", required = false) Integer size) { + Pageable paging = PageRequest.of(page, size); + Page get = Service.getAllWithPagination(paging); + + return get; + + } + @GetMapping("/Formatest") + public List getdetails() { + List get = Service.getdetails(); + return get; +} +// get all without authentication + + @GetMapping("/token/Formatest") + public List getallwioutsec() { + List get = Service.getdetails(); + return get; +} +@GetMapping("/Formatest/{id}") + public Formatest getdetailsbyId(@PathVariable Integer id ) { + Formatest get = Service.getdetailsbyId(id); + return get; + } +@DeleteMapping("/Formatest/{id}") + public void delete_by_id(@PathVariable Integer id ) { + Service.delete_by_id(id); + + } + +} \ No newline at end of file diff --git a/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/Formatest_ListFilter1Controller.java b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/Formatest_ListFilter1Controller.java new file mode 100644 index 0000000..d859460 --- /dev/null +++ b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/Formatest_ListFilter1Controller.java @@ -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.Formatest_ListFilter1; +import com.realnet.basicp1.Services.Formatest_ListFilter1Service ; +@RequestMapping(value = "/Formatest_ListFilter1") +@RestController +public class Formatest_ListFilter1Controller { + + @Autowired + private Formatest_ListFilter1Service Service; + + @GetMapping("/Formatest_ListFilter1") + public List getlist() { + List get = Service.getlistbuilder(); + return get; +} + @GetMapping("/Formatest_ListFilter11") + public List getlistwithparam( ) { + List get = Service.getlistbuilderparam( ); + return get; +} +} \ No newline at end of file diff --git a/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/FormbtestController.java b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/FormbtestController.java new file mode 100644 index 0000000..6b8d812 --- /dev/null +++ b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/FormbtestController.java @@ -0,0 +1,94 @@ +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.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.beans.factory.annotation.*; +import com.realnet.basicp1.Entity.Formbtest; +import com.realnet.basicp1.Services.FormbtestService ; +@RequestMapping(value = "/Formbtest") + @CrossOrigin("*") +@RestController +public class FormbtestController { + @Autowired + private FormbtestService Service; + +@Value("${projectPath}") + private String projectPath; + + + + + + + + + + + + @PostMapping("/Formbtest") + public Formbtest Savedata(@RequestBody Formbtest data) { + Formbtest save = Service.Savedata(data) ; + + + + + + + + + + System.out.println("data saved..." + save); + + return save; + } +@PutMapping("/Formbtest/{id}") + public Formbtest update(@RequestBody Formbtest data,@PathVariable Integer id ) { + Formbtest update = Service.update(data,id); + System.out.println("data update..." + update); + return update; + } +// get all with pagination + @GetMapping("/Formbtest/getall/page") + public Page getall(@RequestParam(value = "page", required = false) Integer page, + @RequestParam(value = "size", required = false) Integer size) { + Pageable paging = PageRequest.of(page, size); + Page get = Service.getAllWithPagination(paging); + + return get; + + } + @GetMapping("/Formbtest") + public List getdetails() { + List get = Service.getdetails(); + return get; +} +// get all without authentication + + @GetMapping("/token/Formbtest") + public List getallwioutsec() { + List get = Service.getdetails(); + return get; +} +@GetMapping("/Formbtest/{id}") + public Formbtest getdetailsbyId(@PathVariable Integer id ) { + Formbtest get = Service.getdetailsbyId(id); + return get; + } +@DeleteMapping("/Formbtest/{id}") + public void delete_by_id(@PathVariable Integer id ) { + Service.delete_by_id(id); + + } + +} \ No newline at end of file diff --git a/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Entity/Formatest.java b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Entity/Formatest.java new file mode 100644 index 0000000..eee7667 --- /dev/null +++ b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Entity/Formatest.java @@ -0,0 +1,46 @@ +package com.realnet.basicp1.Entity; + import lombok.*; +import com.realnet.WhoColumn.Extension; + import javax.persistence.*; + import java.time.LocalDateTime; + import java.util.*; + + + + + + + + + + @Entity + @Data + public class Formatest extends Extension { + /** + * + */ + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + +private String names; + +private String colour; + + private String gender; + + + + +private boolean pune; + + + +private boolean nagpur; + + + + +} diff --git a/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Entity/Formatest_ListFilter1.java b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Entity/Formatest_ListFilter1.java new file mode 100644 index 0000000..51ec5f6 --- /dev/null +++ b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Entity/Formatest_ListFilter1.java @@ -0,0 +1,14 @@ +package com.realnet.basicp1.Entity; + import lombok.*; + import javax.persistence.*; + import java.time.LocalDateTime; + import java.util.*; + + @Data + public class Formatest_ListFilter1 { + + private Integer id; + + + private String names; +} diff --git a/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Entity/Formbtest.java b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Entity/Formbtest.java new file mode 100644 index 0000000..5d94b1a --- /dev/null +++ b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Entity/Formbtest.java @@ -0,0 +1,45 @@ +package com.realnet.basicp1.Entity; + import lombok.*; +import com.realnet.WhoColumn.Extension; + import javax.persistence.*; + import java.time.LocalDateTime; + import java.util.*; + + + + + + + + + + + + @Entity + @Data + public class Formbtest extends Extension { + /** + * + */ + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + +private String namekk; + +private String filetestname; +private String filetestpath ; + +private String imagetestname; +private String imagetestpath ; + +private String audiotestname; +private String audiotestpath ; + +private String videotestname; +private String videotestpath ; + + +} diff --git a/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Repository/FormatestRepository.java b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Repository/FormatestRepository.java new file mode 100644 index 0000000..d1969aa --- /dev/null +++ b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Repository/FormatestRepository.java @@ -0,0 +1,23 @@ +package com.realnet.basicp1.Repository; + + +import org.springframework.data.jpa.repository.JpaRepository; + +import org.springframework.stereotype.Repository; +import java.util.*; + + + + + + + + + + + +import com.realnet.basicp1.Entity.Formatest; + +@Repository +public interface FormatestRepository extends JpaRepository { +} \ No newline at end of file diff --git a/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Repository/FormbtestRepository.java b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Repository/FormbtestRepository.java new file mode 100644 index 0000000..f41f64e --- /dev/null +++ b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Repository/FormbtestRepository.java @@ -0,0 +1,25 @@ +package com.realnet.basicp1.Repository; + + +import org.springframework.data.jpa.repository.JpaRepository; + +import org.springframework.stereotype.Repository; +import java.util.*; + + + + + + + + + + + + + +import com.realnet.basicp1.Entity.Formbtest; + +@Repository +public interface FormbtestRepository extends JpaRepository { +} \ No newline at end of file diff --git a/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Services/FormatestService.java b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Services/FormatestService.java new file mode 100644 index 0000000..5c9c1f9 --- /dev/null +++ b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Services/FormatestService.java @@ -0,0 +1,94 @@ +package com.realnet.basicp1.Services; +import com.realnet.basicp1.Repository.FormatestRepository; +import com.realnet.basicp1.Entity.Formatest;import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import com.realnet.SequenceGenerator.Service.SequenceService; +import com.realnet.Notification.Entity.NotificationService; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import com.realnet.users.service1.AppUserServiceImpl; +import com.realnet.users.entity1.AppUser; + + + + + + + + + import org.springframework.stereotype.Service; + +@Service + public class FormatestService { +@Autowired +private FormatestRepository Repository; + @Autowired + private AppUserServiceImpl userService; + + + + + + + +public Formatest Savedata(Formatest data) { + + + + + + + + +Formatest save = Repository.save(data); + return save; + } + + +// get all with pagination + public Page getAllWithPagination(Pageable page) { + return Repository.findAll(page); + } +public List getdetails() { + return (List) Repository.findAll(); + } + + +public Formatest getdetailsbyId(Integer id) { + return Repository.findById(id).get(); + } + + + public void delete_by_id(Integer id) { + Repository.deleteById(id); +} + + +public Formatest update(Formatest data,Integer id) { + Formatest old = Repository.findById(id).get(); +old.setNames(data.getNames()); + +old.setColour(data.getColour()); + +old.setGender(data.getGender()); + + + +old.setPune(data.isPune()); + + + +old.setNagpur(data.isNagpur()); + + + + + +final Formatest test = Repository.save(old); + return test;} + public AppUser getUser() { + AppUser user = userService.getLoggedInUser(); + return user; + + }} diff --git a/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Services/Formatest_ListFilter1Service.java b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Services/Formatest_ListFilter1Service.java new file mode 100644 index 0000000..0ced8bc --- /dev/null +++ b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Services/Formatest_ListFilter1Service.java @@ -0,0 +1,47 @@ +package com.realnet.basicp1.Services; +import java.util.*; +import com.realnet.basicp1.Repository.FormatestRepository; +import com.realnet.basicp1.Entity.Formatest; + +import com.realnet.basicp1.Entity.Formatest_ListFilter1; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; + import org.springframework.stereotype.Service; + +@Service + public class Formatest_ListFilter1Service { +@Autowired +private FormatestRepository Repository; + + + + + public List getlistbuilder() { + List list= Repository.findAll(); + ArrayList l = new ArrayList<>(); + for (Formatest data : list) { +{ +Formatest_ListFilter1 dummy = new Formatest_ListFilter1(); + dummy.setId(data.getId()); + dummy.setNames(data.getNames()); + l.add(dummy); +} +} +return l;} + + + + public List getlistbuilderparam( ) { + List list= Repository.findAll(); + ArrayList l = new ArrayList<>(); + for (Formatest data : list) { +{ +Formatest_ListFilter1 dummy = new Formatest_ListFilter1(); + dummy.setId(data.getId()); + dummy.setNames(data.getNames()); + l.add(dummy); +} +} +return l;} +} \ No newline at end of file diff --git a/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Services/FormbtestService.java b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Services/FormbtestService.java new file mode 100644 index 0000000..ea72684 --- /dev/null +++ b/prod204ab-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Services/FormbtestService.java @@ -0,0 +1,92 @@ +package com.realnet.basicp1.Services; +import com.realnet.basicp1.Repository.FormbtestRepository; +import com.realnet.basicp1.Entity.Formbtest;import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import com.realnet.SequenceGenerator.Service.SequenceService; +import com.realnet.Notification.Entity.NotificationService; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import com.realnet.users.service1.AppUserServiceImpl; +import com.realnet.users.entity1.AppUser; + + + + + + + + + + + import org.springframework.stereotype.Service; + +@Service + public class FormbtestService { +@Autowired +private FormbtestRepository Repository; + @Autowired + private AppUserServiceImpl userService; + + + + + + + + + +public Formbtest Savedata(Formbtest data) { + + + + + + + + + + +Formbtest save = Repository.save(data); + return save; + } + + +// get all with pagination + public Page getAllWithPagination(Pageable page) { + return Repository.findAll(page); + } +public List getdetails() { + return (List) Repository.findAll(); + } + + +public Formbtest getdetailsbyId(Integer id) { + return Repository.findById(id).get(); + } + + + public void delete_by_id(Integer id) { + Repository.deleteById(id); +} + + +public Formbtest update(Formbtest data,Integer id) { + Formbtest old = Repository.findById(id).get(); +old.setNamekk(data.getNamekk()); + + + + + + + + + +final Formbtest test = Repository.save(old); + return test;} + public AppUser getUser() { + AppUser user = userService.getLoggedInUser(); + return user; + + }} diff --git a/prod204ab-db-d/authsec_mysql/mysql/wf_table/wf_table.sql b/prod204ab-db-d/authsec_mysql/mysql/wf_table/wf_table.sql new file mode 100755 index 0000000..fc5a020 --- /dev/null +++ b/prod204ab-db-d/authsec_mysql/mysql/wf_table/wf_table.sql @@ -0,0 +1,4 @@ +CREATE TABLE db.Formatest(id BIGINT NOT NULL AUTO_INCREMENT, Names VARCHAR(400), colour VARCHAR(400), gender VARCHAR(400), city VARCHAR(400), PRIMARY KEY (id)); + +CREATE TABLE db.Formbtest(id BIGINT NOT NULL AUTO_INCREMENT, Imagetest VARCHAR(400), Namekk VARCHAR(400), videotest VARCHAR(400), audiotest VARCHAR(400), Filetest VARCHAR(400), PRIMARY KEY (id)); + diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatest.component.html b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatest.component.html new file mode 100644 index 0000000..8c9e848 --- /dev/null +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatest.component.html @@ -0,0 +1,113 @@ + + + + +
+
+
+

Formatest

  +
+
+
+ + +
+
+
+ + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NamescolourgenderpunenagpurAction
{{data.names}}{{data.colour}}{{data.gender}}{{data.pune}}{{data.nagpur}}
+ + + + + + + +
+ + + + + + + + + + + + + + + diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatest.component.scss b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatest.component.scss new file mode 100644 index 0000000..4084453 --- /dev/null +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatest.component.scss @@ -0,0 +1,4 @@ +.delete,.heading{ + text-align: center; + color: red; +} \ No newline at end of file diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatest.component.ts b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatest.component.ts new file mode 100644 index 0000000..f52988d --- /dev/null +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatest.component.ts @@ -0,0 +1,108 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import * as moment from 'moment'; +import * as bootstrap from 'bootstrap'; +import { FormatestService } from './Formatest.service'; + +import { ToastrService } from 'ngx-toastr'; + + +@Component({ + selector: 'app-Formatest', + templateUrl: './Formatest.component.html', + styleUrls: ['./Formatest.component.scss'] +}) +export class FormatestComponent implements OnInit { + loading = false; + loading1=false; + public entryForm: FormGroup; + givendata; + orders; + modalAdd= false; + modaledit=false; +mcreate; +medit; +mdelete; +showdata; +error; +modaldelete=false; +rowSelected :any= {}; + searchFilter; + constructor( + private _fb: FormBuilder, + private router: Router, private toastr:ToastrService, + private route: ActivatedRoute, + + private mainservice:FormatestService, + ) {this.loading1 = true; + setTimeout(() => { + this.loading1 = false; + }, 1000); } + + ngOnInit(): void { + this.getData(); + + } + getData(){ + this.mainservice.getAll().subscribe((data) => { + console.log(data); + this.givendata = data; + if(this.givendata.length==0){ + this.error="No data Available"; + console.log(this.error) + } + + + + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + + + goToAdd() { + this.router.navigate(["../Formatestadd"],{relativeTo:this.route}); + } + goToEdit(id: any){ + this.router.navigate(["../Formatestedit/"+ id], { relativeTo: this.route }); + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainservice.deleteusr(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data == null || data) { + this.toastr.success('Deleted successfully'); + } + }, + (error) => { + console.log('Error in adding data...',+error); + if(error){ + this.toastr.error('Not Deleted Data Getting Some Error'); + } + } + ); + + + } + + + + + + + + +} \ No newline at end of file diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatest.service.ts b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatest.service.ts new file mode 100644 index 0000000..7b2bb40 --- /dev/null +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatest.service.ts @@ -0,0 +1,38 @@ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import { ApiRequestService } from 'src/app/services/api/api-request.service'; +import baseUrl from 'src/app/services/api/helper'; +@Injectable({ + providedIn: 'root' +}) +export class FormatestService { + private baseURL = "Formatest/Formatest" ; constructor(private http: HttpClient, private apiRequest:ApiRequestService) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getbyid(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + updatenew(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + deleteusr(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + + + +// updateaction +} \ No newline at end of file diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatestadd/Formatestadd.component.html b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatestadd/Formatestadd.component.html new file mode 100644 index 0000000..db6520f --- /dev/null +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatestadd/Formatestadd.component.html @@ -0,0 +1,109 @@ + +

Formatest

+ Add Mode + + + + + + + +
+
+
+
+ +
+ + +
+
*This field is Required
+
+
+ +
+ +
+ +
+ + + +
+ + +
+ + + +
+ + +
+ + +
+ + + +
+ + + +
+ + +
+ + + +
+ + +
+ + +
+ + +
+ + + + + + + + +
+ + +
+ + + + + + + + + + diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatestadd/Formatestadd.component.scss b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatestadd/Formatestadd.component.scss new file mode 100644 index 0000000..94079ce --- /dev/null +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatestadd/Formatestadd.component.scss @@ -0,0 +1,63 @@ +input[type=text],[type=date],[type=password],[type=number],[type=email],[type=url],[type=datetime-local],textarea { + width: 100%; + padding: 5px 20px; + // margin: 3px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.required-field{ + color: red; +font-size: 18px; + +} +.green{ + background-color: rgb(156, 231, 156); + color: black; +} +.blue{ + background-color: #57abcf;//rgb(82, 87, 161); + color: black; +} +.td-title { + text-align: center; + width: 150px; +color: white; + font-weight: bold; + background-color: rgba(63, 122, 231, 0.863); + //color: rgb(24, 13, 13); +} +th{ + background-color:rgb(170, 169, 169); + font-weight: bold; +} +.td-content{ + text-align: left; +} +.delete,.heading{ + text-align: center; + color: red; +} +.section p { +background-color: rgb(206, 201, 201); + padding: 10px; + font-size: 18px; +} + +select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} + + +input.ng-invalid.ng-touched { + border-color: red; +} + +.error_mess { + color: red; +} \ No newline at end of file diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatestadd/Formatestadd.component.ts b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatestadd/Formatestadd.component.ts new file mode 100644 index 0000000..f190961 --- /dev/null +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatestadd/Formatestadd.component.ts @@ -0,0 +1,142 @@ +import { Component, OnInit } from '@angular/core'; +import { FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { AbstractControl, ValidationErrors } from '@angular/forms'; +declare var JsBarcode: any; +import { AccesstypeService } from 'src/app/services/admin/accesstype.service'; +import { FormatestService } from '../Formatest.service'; + + + +@Component({ + selector: 'app-Formatestadd', + templateUrl: './Formatestadd.component.html', + styleUrls: ['./Formatestadd.component.scss'] +}) +export class FormatestaddComponent implements OnInit { + public entryForm: FormGroup; + + loading = false; +tableName = 'Formatest'; + + error; + submitted=false; + + constructor(private _fb: FormBuilder, + private mainservice:FormatestService, + private router: Router,private accesstype:AccesstypeService, + private route: ActivatedRoute, + + private toastr: ToastrService ) { } + + ngOnInit(): void { + this.entryForm = this._fb.group({ +names :[null], + +colour :[null], + +gender :[null], + + + +pune:[false], + + + +nagpur:[false], + + + + + + + + + + + + + }); + + + + + + + + + } + givendata; + getData(){ + this.mainservice.getAll().subscribe((data) => { + console.log(data); + this.givendata = data; + },(error) => { + console.log(error); + }); + } + onSubmit(){ + this.submitted=true + if (this.entryForm.invalid) { + return; + } + + + + + + + + + console.log(this.entryForm.value); + this.mainservice.create(this.entryForm.value).subscribe(data => { + console.log(data) + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } + + + + + + + + + + }, + (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"); + } + }); + this.router.navigate(["../Formatest"], { relativeTo: this.route }); + } + +goback(){ + this.router.navigate(["../Formatest"], { relativeTo: this.route }); +} + + + +updategender (gender : string): void { + this.entryForm.get('gender').setValue(gender); }; + + + + +} + + + + + + + diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatestedit/Formatestedit.component.html b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatestedit/Formatestedit.component.html new file mode 100644 index 0000000..30603a1 --- /dev/null +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatestedit/Formatestedit.component.html @@ -0,0 +1,109 @@ +

table_name

+ Edit Mode + + + + + + + +
+
+
+
+
+ +
+ + +
+ +
+ +
+ +
+ + + +
+ + +
+ + + +
+ + +
+ + +
+ + +
+ + + +
+ + +
+ + + +
+ + +
+ + +
+ + +
+ + + + + + + + +
+ + +
+ + + + + + + + + diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatestedit/Formatestedit.component.scss b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatestedit/Formatestedit.component.scss new file mode 100644 index 0000000..fe29251 --- /dev/null +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatestedit/Formatestedit.component.scss @@ -0,0 +1,55 @@ +input[type=text],[type=date],[type=password],[type=number],[type=email],[type=url],[type=datetime-local],textarea { + width: 100%; + padding: 5px 20px; + // margin: 3px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.required-field{ + color: red; +font-size: 18px; + +} +.green{ + background-color: rgb(156, 231, 156); + color: black; +} +.blue{ + background-color: #57abcf;//rgb(82, 87, 161); + color: black; +} +.td-title { + text-align: center; + width: 150px; +color: white; + font-weight: bold; + background-color: rgba(63, 122, 231, 0.863); + //color: rgb(24, 13, 13); +} +th{ + background-color:rgb(170, 169, 169); + font-weight: bold; +} +.td-content{ + text-align: left; +} +.delete,.heading{ + text-align: center; + color: red; +} +.section p { +background-color: rgb(206, 201, 201); + padding: 10px; + font-size: 18px; +} + +select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} + diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatestedit/Formatestedit.component.ts b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatestedit/Formatestedit.component.ts new file mode 100644 index 0000000..dbd19a0 --- /dev/null +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formatest/Formatestedit/Formatestedit.component.ts @@ -0,0 +1,116 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { AbstractControl, ValidationErrors } from '@angular/forms'; + +declare var JsBarcode: any; +import { FormatestService } from '../Formatest.service'; + +@Component({ + selector: 'app-Formatestedit', + templateUrl: './Formatestedit.component.html', + styleUrls: ['./Formatestedit.component.scss'] +}) +export class FormatesteditComponent implements OnInit { + id:number; + data1:any={}; + loading = false; +tableName = 'Formatest'; + + error; + constructor( private route:ActivatedRoute, + private mainservice:FormatestService, + private router: Router, + + private toastr: ToastrService, ) { } + + ngOnInit(): void { + this.id = this.route.snapshot.params["id"]; + console.log("update with id = ", this.id); + this.getById(this.id); + // + + + + + + + + + + } + givendata; + getData(){ + this.mainservice.getAll().subscribe((data) => { + console.log(data); + this.givendata = data; + },(error) => { + console.log(error); + }); + } +getById(id:number){ +this.mainservice.getbyid(id).subscribe((data)=>{ + this.data1=data; + + + + + + + + + + console.log(this.data1); +}); +} +update(){ + + + + + + + + + console.log(this.data1); + this.mainservice.updatenew(this.id,this.data1).subscribe((data)=>{ +console.log(data); if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } + + + + + + + + + + +this.router.navigate(["../../Formatest"], { relativeTo: this.route }); + },(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"); + } + + }); + +} +goback(){ + this.router.navigate(["../../Formatest"], { relativeTo: this.route }); +} + + + +updategenderEdit(gender : string): void { this.data1.gender = gender } + + + + + } \ No newline at end of file diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtest.component.html b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtest.component.html new file mode 100644 index 0000000..785764d --- /dev/null +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtest.component.html @@ -0,0 +1,101 @@ + + + + +
+
+
+

Formbtest

  +
+
+
+ + +
+
+
+ + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NamekkaudiotestvideotestAction
{{data.namekk}}{{data.audiotestname}}{{data.videotestname}}
+ + + + + + + +
+ + + + + + + + + + + + + + + + + diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtest.component.scss b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtest.component.scss new file mode 100644 index 0000000..4084453 --- /dev/null +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtest.component.scss @@ -0,0 +1,4 @@ +.delete,.heading{ + text-align: center; + color: red; +} \ No newline at end of file diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtest.component.ts b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtest.component.ts new file mode 100644 index 0000000..6ec8e95 --- /dev/null +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtest.component.ts @@ -0,0 +1,110 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import * as moment from 'moment'; +import * as bootstrap from 'bootstrap'; +import { FormbtestService } from './Formbtest.service'; + +import { ToastrService } from 'ngx-toastr'; + + +@Component({ + selector: 'app-Formbtest', + templateUrl: './Formbtest.component.html', + styleUrls: ['./Formbtest.component.scss'] +}) +export class FormbtestComponent implements OnInit { + loading = false; + loading1=false; + public entryForm: FormGroup; + givendata; + orders; + modalAdd= false; + modaledit=false; +mcreate; +medit; +mdelete; +showdata; +error; +modaldelete=false; +rowSelected :any= {}; + searchFilter; + constructor( + private _fb: FormBuilder, + private router: Router, private toastr:ToastrService, + private route: ActivatedRoute, + + private mainservice:FormbtestService, + ) {this.loading1 = true; + setTimeout(() => { + this.loading1 = false; + }, 1000); } + + ngOnInit(): void { + this.getData(); + + } + getData(){ + this.mainservice.getAll().subscribe((data) => { + console.log(data); + this.givendata = data; + if(this.givendata.length==0){ + this.error="No data Available"; + console.log(this.error) + } + + + + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + + + goToAdd() { + this.router.navigate(["../Formbtestadd"],{relativeTo:this.route}); + } + goToEdit(id: any){ + this.router.navigate(["../Formbtestedit/"+ id], { relativeTo: this.route }); + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainservice.deleteusr(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data == null || data) { + this.toastr.success('Deleted successfully'); + } + }, + (error) => { + console.log('Error in adding data...',+error); + if(error){ + this.toastr.error('Not Deleted Data Getting Some Error'); + } + } + ); + + + } + + + + + + + + + + +} \ No newline at end of file diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtest.service.ts b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtest.service.ts new file mode 100644 index 0000000..d20eef4 --- /dev/null +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtest.service.ts @@ -0,0 +1,96 @@ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import { ApiRequestService } from 'src/app/services/api/api-request.service'; +import baseUrl from 'src/app/services/api/helper'; +@Injectable({ + providedIn: 'root' +}) +export class FormbtestService { + private baseURL = "Formbtest/Formbtest" ; constructor(private http: HttpClient, private apiRequest:ApiRequestService) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getbyid(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } +create(data: any, file: any): Observable { + const formData = new FormData(); + formData.append('data', JSON.stringify(data)); + formData.append('file', file); + return this.apiRequest.postFormData(this.baseURL, formData); + } + + updatenew(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + deleteusr(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + uploadfilefiletest(ref:any, Formbtest:any, file:any): Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Formbtest}`, formData); + } + + uploadfilegetByIdfiletest(ref:any, Formbtest:any,): Observable { + return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Formbtest}`); + } + + + uploadfiledeletefiletest(id: number): Observable { + return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); + } + + uploadImagetest(ref:any, Formbtest:any, file:any): Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Formbtest}`, formData); + } + + uploadImagetestgetById(ref:any, Formbtest:any,): Observable { + return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Formbtest}`); + } + + + uploadImagetestdelete(id: number): Observable { + return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); + } + + uploadAudiotest(ref:any, Formbtest:any, file:any): Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Formbtest}`, formData); + } + + uploadAudiotestgetById(ref:any, Formbtest:any,): Observable { + return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Formbtest}`); + } + + + uploadAudiotestdelete(id: number): Observable { + return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); + } + + uploadVideotest(ref:any, Formbtest:any, file:any): Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Formbtest}`, formData); + } + + uploadVideotestgetById(ref:any, Formbtest:any,): Observable { + return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Formbtest}`); + } + + + uploadVideotestdelete(id: number): Observable { + return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); + } + +// updateaction +} \ No newline at end of file diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtestadd/Formbtestadd.component.html b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtestadd/Formbtestadd.component.html new file mode 100644 index 0000000..5c342a4 --- /dev/null +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtestadd/Formbtestadd.component.html @@ -0,0 +1,135 @@ + +

Formbtest

+ Add Mode + + + + + + + + + +
+
+
+
+ +
+ + +
+
*This field is Required
+
+
+ + + + + +
+
+ +
+ +
+
+ +
+ +
+ + +
List of filetest
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
No FileFile NamePreviewCancel
+ {{attach.uploadedfile_name}} File Preview + + + +
+ +
List of imagetest
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
No FileFile NamePreviewCancel
+ {{attach.uploadedfile_name}} File Preview + + + +
+ + + + + +
+ + +
+ + + + + + + + + + + + diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtestadd/Formbtestadd.component.scss b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtestadd/Formbtestadd.component.scss new file mode 100644 index 0000000..94079ce --- /dev/null +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtestadd/Formbtestadd.component.scss @@ -0,0 +1,63 @@ +input[type=text],[type=date],[type=password],[type=number],[type=email],[type=url],[type=datetime-local],textarea { + width: 100%; + padding: 5px 20px; + // margin: 3px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.required-field{ + color: red; +font-size: 18px; + +} +.green{ + background-color: rgb(156, 231, 156); + color: black; +} +.blue{ + background-color: #57abcf;//rgb(82, 87, 161); + color: black; +} +.td-title { + text-align: center; + width: 150px; +color: white; + font-weight: bold; + background-color: rgba(63, 122, 231, 0.863); + //color: rgb(24, 13, 13); +} +th{ + background-color:rgb(170, 169, 169); + font-weight: bold; +} +.td-content{ + text-align: left; +} +.delete,.heading{ + text-align: center; + color: red; +} +.section p { +background-color: rgb(206, 201, 201); + padding: 10px; + font-size: 18px; +} + +select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} + + +input.ng-invalid.ng-touched { + border-color: red; +} + +.error_mess { + color: red; +} \ No newline at end of file diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtestadd/Formbtestadd.component.ts b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtestadd/Formbtestadd.component.ts new file mode 100644 index 0000000..33107af --- /dev/null +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtestadd/Formbtestadd.component.ts @@ -0,0 +1,221 @@ +import { Component, OnInit } from '@angular/core'; +import { FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { AbstractControl, ValidationErrors } from '@angular/forms'; +declare var JsBarcode: any; +import { AccesstypeService } from 'src/app/services/admin/accesstype.service'; +import { FormbtestService } from '../Formbtest.service'; + + + +@Component({ + selector: 'app-Formbtestadd', + templateUrl: './Formbtestadd.component.html', + styleUrls: ['./Formbtestadd.component.scss'] +}) +export class FormbtestaddComponent implements OnInit { + public entryForm: FormGroup; + + loading = false; +tableName = 'Formbtest'; + + error; + submitted=false; + + constructor(private _fb: FormBuilder, + private mainservice:FormbtestService, + private router: Router,private accesstype:AccesstypeService, + private route: ActivatedRoute, + + private toastr: ToastrService ) { } + + ngOnInit(): void { + this.entryForm = this._fb.group({ +namekk :[null], + + + + + + + + + + + + + + + + + + + + + }); + + + + + + + + + + + } + givendata; + getData(){ + this.mainservice.getAll().subscribe((data) => { + console.log(data); + this.givendata = data; + },(error) => { + console.log(error); + }); + } + onSubmit(){ + this.submitted=true + if (this.entryForm.invalid) { + return; + } + + + + + + + + + + + console.log(this.entryForm.value); + this.mainservice.create(this.entryForm.value, this.selectedvideotest).subscribe(data => { + console.log(data) + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } + + }, + (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"); + } + }); + this.router.navigate(["../Formbtest"], { relativeTo: this.route }); + } + +goback(){ + this.router.navigate(["../Formbtest"], { relativeTo: this.route }); +} + +filePreviewfiletest: string | ArrayBuffer | null = null; +FileDatafiletest: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array +selectedfiletest: File[]=[]; +public onFileChangedfiletest(event, index) { + const files = event.target.files; + for (let i = 0; i < files.length; i++) { + const file = files[i]; + this.FileDatafiletest[index].uploadedfile_name = files[i].name; + this.selectedfiletest.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.FileDatafiletest[index] = { + ...this.FileDatafiletest[index], // Preserve existing properties + filePreview: filePreview // Update only the filePreview property + }; + }; + reader.readAsDataURL(file); + } + } +} + onAddLinesfiletest(){ + this.FileDatafiletest.push({ + uploadedfile_name: "", + filePreview: "", + // f3: "", + }); + } + + deleteRowfiletest(index,id) { + this.FileDatafiletest.splice(index, 1); + + if(id){ + this.mainservice.uploadfiledelete(id).subscribe(data =>{ + console.log(data); + }) + } + } + +filePreviewimagetest: string | ArrayBuffer | null = null; +FileDataimagetest: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array +selectedimagetest: File[]=[]; +public onFileChangedimagetest(event, index) { + const files = event.target.files; + for (let i = 0; i < files.length; i++) { + const file = files[i]; + this.FileDataimagetest[index].uploadedfile_name = files[i].name; + this.selectedimagetest.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.FileDataimagetest[index] = { + ...this.FileDataimagetest[index], // Preserve existing properties + filePreview: filePreview // Update only the filePreview property + }; + }; + reader.readAsDataURL(file); + } + } +} + onAddLinesimagetest(){ + this.FileDataimagetest.push({ + uploadedfile_name: "", + filePreview: "", + // f3: "", + }); + } + + deleteRowimagetest(index,id) { + this.FileDataimagetest.splice(index, 1); + + if(id){ + this.mainservice.uploadfiledelete(id).subscribe(data =>{ + console.log(data); + }) + } + } + +selectedaudiotest: File[]=[]; public onFileChanged(event) { + console.log(event); +this.selectedaudiotest = event.target.files[0]; + } + +selectedvideotest: File[]=[]; public onFileChanged(event) { + console.log(event); +this.selectedvideotest = event.target.files[0]; + } + + +} + + + + + + + + + diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtestedit/Formbtestedit.component.html b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtestedit/Formbtestedit.component.html new file mode 100644 index 0000000..695c2f4 --- /dev/null +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtestedit/Formbtestedit.component.html @@ -0,0 +1,155 @@ +

table_name

+ Edit Mode + + + + + + + + + +
+
+
+
+
+ +
+ + +
+ + + + + + + + + +
+ + +
List of filetest
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
No FileFile NamePreviewCancel
+ {{attach.uploadedfile_name}} File Preview + + +
+ +
List of imagetest
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
No FileFile NamePreviewCancel
+ {{attach.uploadedfile_name}} File Preview + + +
+ + + + + +
+ + +
+ + + + + + + + + + + diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtestedit/Formbtestedit.component.scss b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtestedit/Formbtestedit.component.scss new file mode 100644 index 0000000..fe29251 --- /dev/null +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtestedit/Formbtestedit.component.scss @@ -0,0 +1,55 @@ +input[type=text],[type=date],[type=password],[type=number],[type=email],[type=url],[type=datetime-local],textarea { + width: 100%; + padding: 5px 20px; + // margin: 3px 0; + background-color:rgb(255, 255, 255); + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.required-field{ + color: red; +font-size: 18px; + +} +.green{ + background-color: rgb(156, 231, 156); + color: black; +} +.blue{ + background-color: #57abcf;//rgb(82, 87, 161); + color: black; +} +.td-title { + text-align: center; + width: 150px; +color: white; + font-weight: bold; + background-color: rgba(63, 122, 231, 0.863); + //color: rgb(24, 13, 13); +} +th{ + background-color:rgb(170, 169, 169); + font-weight: bold; +} +.td-content{ + text-align: left; +} +.delete,.heading{ + text-align: center; + color: red; +} +.section p { +background-color: rgb(206, 201, 201); + padding: 10px; + font-size: 18px; +} + +select{ + width: 100%; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} + diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtestedit/Formbtestedit.component.ts b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtestedit/Formbtestedit.component.ts new file mode 100644 index 0000000..eadc6c6 --- /dev/null +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/BuilderComponents/basicp1/Formbtest/Formbtestedit/Formbtestedit.component.ts @@ -0,0 +1,242 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { AbstractControl, ValidationErrors } from '@angular/forms'; + +declare var JsBarcode: any; +import { FormbtestService } from '../Formbtest.service'; + +@Component({ + selector: 'app-Formbtestedit', + templateUrl: './Formbtestedit.component.html', + styleUrls: ['./Formbtestedit.component.scss'] +}) +export class FormbtesteditComponent implements OnInit { + id:number; + data1:any={}; + loading = false; +tableName = 'Formbtest'; + + error; + constructor( private route:ActivatedRoute, + private mainservice:FormbtestService, + private router: Router, + + private toastr: ToastrService, ) { } + + ngOnInit(): void { + this.id = this.route.snapshot.params["id"]; + console.log("update with id = ", this.id); + this.getById(this.id); + // + + + + + + + + + + + + } + givendata; + getData(){ + this.mainservice.getAll().subscribe((data) => { + console.log(data); + this.givendata = data; + },(error) => { + console.log(error); + }); + } +getById(id:number){ +this.mainservice.getbyid(id).subscribe((data)=>{ + this.data1=data; + + + this.selectedfiletest = []; + this.mainservice.uploadfilegetById(data.id,this.tableName).subscribe(uploaddata =>{ + console.log(uploaddata); + this.FileDatafiletest = uploaddata; + + }) + + this.selectedimagetest = []; + this.mainservice.uploadfilegetById(data.id,this.tableName).subscribe(uploaddata =>{ + console.log(uploaddata); + this.FileDataimagetest = uploaddata; + + }) + + + + + + + console.log(this.data1); +}); +} +update(){ + + + + + + + + + + + console.log(this.data1); + this.mainservice.updatenew(this.id,this.data1).subscribe((data)=>{ +console.log(data); if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } + + + +for (let i = 0; i < this.selectedfiletest.length; i++){ + + this.mainservice.uploadfile(data.id,this.tableName,this.selectedfiletest[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + +for (let i = 0; i < this.selectedimagetest.length; i++){ + + this.mainservice.uploadfile(data.id,this.tableName,this.selectedimagetest[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + + + + + + +this.router.navigate(["../../Formbtest"], { relativeTo: this.route }); + },(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"); + } + + }); + +} +goback(){ + this.router.navigate(["../../Formbtest"], { relativeTo: this.route }); +} + +filePreviewfiletest: string | ArrayBuffer | null = null; +FileDatafiletest: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array +selectedfiletest: File[]=[]; +public onFileChangedfiletest(event, index) { + const files = event.target.files; + for (let i = 0; i < files.length; i++) { + const file = files[i]; + this.FileDatafiletest[index].uploadedfile_name = files[i].name; + this.selectedfiletest.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.FileDatafiletest[index] = { + ...this.FileDatafiletest[index], // Preserve existing properties + filePreview: filePreview // Update only the filePreview property + }; + }; + reader.readAsDataURL(file); + } + } +} + onAddLinesfiletest(){ + this.FileDatafiletest.push({ + uploadedfile_name: "", + filePreview: "", + // f3: "", + }); + } + rowSelected :any= {}; + deleteRowfiletest(index,id) { + this.modalissue.removeAllBackdrops(); + const row:any = { + index: index, + id: id + } + this.rowSelected = row; + } + + deletefiletest(index,id) { + this.FileDatafiletest.splice(index, 1); + + if(id){ + this.mainservice.uploadfiledelete(id).subscribe(data =>{ + console.log(data); + }) + } + } + +filePreviewimagetest: string | ArrayBuffer | null = null; +FileDataimagetest: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array +selectedimagetest: File[]=[]; +public onFileChangedimagetest(event, index) { + const files = event.target.files; + for (let i = 0; i < files.length; i++) { + const file = files[i]; + this.FileDataimagetest[index].uploadedfile_name = files[i].name; + this.selectedimagetest.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.FileDataimagetest[index] = { + ...this.FileDataimagetest[index], // Preserve existing properties + filePreview: filePreview // Update only the filePreview property + }; + }; + reader.readAsDataURL(file); + } + } +} + onAddLinesimagetest(){ + this.FileDataimagetest.push({ + uploadedfile_name: "", + filePreview: "", + // f3: "", + }); + } + rowSelected :any= {}; + deleteRowimagetest(index,id) { + this.modalissue.removeAllBackdrops(); + const row:any = { + index: index, + id: id + } + this.rowSelected = row; + } + + deleteimagetest(index,id) { + this.FileDataimagetest.splice(index, 1); + + if(id){ + this.mainservice.uploadfiledelete(id).subscribe(data =>{ + console.log(data); + }) + } + } + + + + + + + } \ No newline at end of file diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/main-routing.module.ts b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/main-routing.module.ts index b1c05ef..fa3c639 100644 --- a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/main-routing.module.ts +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/main-routing.module.ts @@ -1,3 +1,9 @@ +import { FormbtesteditComponent } from './BuilderComponents/basicp1/Formbtest/Formbtestedit/Formbtestedit.component'; +import { FormbtestaddComponent } from './BuilderComponents/basicp1/Formbtest/Formbtestadd/Formbtestadd.component'; +import { FormbtestComponent } from './BuilderComponents/basicp1/Formbtest/Formbtest.component'; +import { FormatesteditComponent } from './BuilderComponents/basicp1/Formatest/Formatestedit/Formatestedit.component'; +import { FormatestaddComponent } from './BuilderComponents/basicp1/Formatest/Formatestadd/Formatestadd.component'; +import { FormatestComponent } from './BuilderComponents/basicp1/Formatest/Formatest.component'; import { Component, NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; @@ -103,6 +109,24 @@ const routes: Routes = [ }, // buildercomponents +{path:'Formbtestedit/:id',component:FormbtesteditComponent}, + + +{path:'Formbtestadd',component:FormbtestaddComponent}, + + +{path:'Formbtest',component:FormbtestComponent}, + + +{path:'Formatestedit/:id',component:FormatesteditComponent}, + + +{path:'Formatestadd',component:FormatestaddComponent}, + + +{path:'Formatest',component:FormatestComponent}, + + { diff --git a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/main.module.ts b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/main.module.ts index 42ff25c..0423f2c 100644 --- a/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/main.module.ts +++ b/prod204ab-front-f/authsec_angular_bootsstrap/angular-bootstrap/src/app/modules/main/main.module.ts @@ -1,3 +1,9 @@ +import { FormbtesteditComponent } from './BuilderComponents/basicp1/Formbtest/Formbtestedit/Formbtestedit.component'; +import { FormbtestaddComponent } from './BuilderComponents/basicp1/Formbtest/Formbtestadd/Formbtestadd.component'; +import { FormbtestComponent } from './BuilderComponents/basicp1/Formbtest/Formbtest.component'; +import { FormatesteditComponent } from './BuilderComponents/basicp1/Formatest/Formatestedit/Formatestedit.component'; +import { FormatestaddComponent } from './BuilderComponents/basicp1/Formatest/Formatestadd/Formatestadd.component'; +import { FormatestComponent } from './BuilderComponents/basicp1/Formatest/Formatest.component'; import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { CommonModule } from '@angular/common'; @@ -99,6 +105,24 @@ import { SearchFilterPipe } from 'src/app/pipes/search-filter.pipe'; MenumaintanceComponent, OauthComponent, QueryComponent, SubmenuComponent, AccesstypeComponent, ModulesComponent, SessionloggerComponent, LogreaderComponent, ExceptionComponent, AuditreportComponent, AudithistoryComponent, // buildercomponents +FormbtesteditComponent, + + +FormbtestaddComponent, + + +FormbtestComponent, + + +FormatesteditComponent, + + +FormatestaddComponent, + + +FormatestComponent, + +