build_app

This commit is contained in:
string 2024-11-05 05:58:12 +00:00
parent 93a9b0447e
commit 56afad0182
19 changed files with 1549 additions and 3 deletions

@ -72,6 +72,12 @@ public class BuilderService {
addCustomMenu( "Child", "Transcations");
addCustomMenu( "Formc", "Transcations");
addCustomMenu( "Child", "Transcations");
addCustomMenu( "Formc", "Transcations");

@ -0,0 +1,131 @@
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.http.ResponseEntity;
import org.springframework.data.domain.Pageable;
import org.springframework.beans.factory.annotation.*;
import com.realnet.basicp1.Entity.Formc;
import com.realnet.basicp1.Services.FormcService ;
@RequestMapping(value = "/Formc")
@CrossOrigin("*")
@RestController
public class FormcController {
@Autowired
private FormcService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Formc")
public Formc Savedata(@RequestBody Formc data) {
Formc save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Formc/{id}")
public Formc update(@RequestBody Formc data,@PathVariable Integer id ) {
Formc update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Formc/getall/page")
public Page<Formc> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Formc> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Formc")
public List<Formc> getdetails() {
List<Formc> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Formc")
public List<Formc> getallwioutsec() {
List<Formc> get = Service.getdetails();
return get;
}
@GetMapping("/Formc/{id}")
public Formc getdetailsbyId(@PathVariable Integer id ) {
Formc get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Formc/{id}")
public void delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
}
}

@ -0,0 +1,51 @@
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 Formc extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String textt;
private String selectv;
private Integer selectb;
private String selectbname;
private String selectmul;
private String dyamul;
private Integer selectautocom;
private String selectautocomname;
private String autocommul;
}

@ -0,0 +1,29 @@
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.Formc;
@Repository
public interface FormcRepository extends JpaRepository<Formc, Integer> {
}

@ -0,0 +1,151 @@
package com.realnet.basicp1.Services;
import com.realnet.basicp1.Repository.FormcRepository;
import com.realnet.basicp1.Entity.Formc;import java.util.List;
import java.util.ArrayList;
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 org.springframework.http.ResponseEntity;
import com.realnet.users.service1.AppUserServiceImpl;
import org.springframework.http.HttpStatus;
import com.realnet.users.entity1.AppUser;
import com.realnet.basicp1.Entity.Formc;
import com.realnet.basicp1.Services.FormcService;
import com.realnet.basicp1.Entity.Formc;
import com.realnet.basicp1.Services.FormcService;
import org.springframework.stereotype.Service;
@Service
public class FormcService {
@Autowired
private FormcRepository Repository;
@Autowired
private AppUserServiceImpl userService;
@Autowired
private FormcService selectbserv;
@Autowired
private FormcService selectautocomserv;
public Formc Savedata(Formc data) {
if (data.getSelectb() != null) {
Formc get = selectbserv.getdetailsbyId(data.getSelectb());
data.setSelectbname(get.getTextt());
}
if (data.getSelectautocom() != null) {
Formc get = selectautocomserv.getdetailsbyId(data.getSelectautocom());
data.setSelectautocomname(get.getTextt());
}
Formc save = Repository.save(data);
return save;
}
// get all with pagination
public Page<Formc> getAllWithPagination(Pageable page) {
return Repository.findAll(page);
}
public List<Formc> getdetails() {
return (List<Formc>) Repository.findAll();
}
public Formc getdetailsbyId(Integer id) {
return Repository.findById(id).get();
}
public void delete_by_id(Integer id) {
Repository.deleteById(id);
}
public Formc update(Formc data,Integer id) {
Formc old = Repository.findById(id).get();
old.setTextt(data.getTextt());
old.setSelectv(data.getSelectv());
old.setSelectb(data.getSelectb());
old.setSelectmul(data.getSelectmul());
old.setDyamul(data.getDyamul());
old.setSelectautocom(data.getSelectautocom());
old.setAutocommul(data.getAutocommul());
final Formc test = Repository.save(old);
return test;}
public AppUser getUser() {
AppUser user = userService.getLoggedInUser();
return user;
}}

@ -1,7 +1,7 @@
package com.realnet.basicp1.Services;
import java.util.*;
import com.realnet.back.Repository.FormcRepository;
import com.realnet.back.Entity.Formc;
import com.realnet.basicp1.Repository.FormcRepository;
import com.realnet.basicp1.Entity.Formc;
import com.realnet.basicp1.Entity.Formc_ListFilter1;
import java.util.List;

@ -1,4 +1,4 @@
CREATE TABLE db.Formc(id BIGINT NOT NULL AUTO_INCREMENT, textt VARCHAR(400), PRIMARY KEY (id));
CREATE TABLE db.Formc(id BIGINT NOT NULL AUTO_INCREMENT, selectmul VARCHAR(400), selectb int, dyamul VARCHAR(400), selectautocom int, autocommul VARCHAR(400), textt VARCHAR(400), selectv VARCHAR(400), PRIMARY KEY (id));
CREATE TABLE db.Child(id BIGINT NOT NULL AUTO_INCREMENT, namen VARCHAR(400), PRIMARY KEY (id));

@ -0,0 +1,121 @@
<div class="dg-wrapper">
<div class="row">
<div class="col-2">
<h3>Formc </h3>&nbsp;
</div>
<div class="col-6">
<div class="input-group " style="width: 40%; margin-bottom: 10px;">
<span class="input-group-text" id="basic-addon2"><i class="bi bi-search"></i></span>
<input placeholder="Search" type="text" name="searchFilter" [(ngModel)]="searchFilter" class="form-control" aria-label="Recipient's username" aria-describedby="basic-addon2">
</div>
</div> <div class="col-4" style="text-align: right;">
<div class="btn-group" role="group" aria-label="Basic example">
<button type="button" class="btn btn-primary" (click)="goToAdd()">Add</button>
</div>
</div>
</div>
<div style="max-height: 500px; overflow: auto;">
<table class="table">
<thead class="table-primary">
<tr>
<th>Textt</th>
<th>selectv</th>
<th>selectb</th>
<th>selectmul</th>
<th>dyamul</th>
<th>selectautocom</th>
<th>autocommul</th>
<th>Action</th> </tr>
</thead>
<tbody>
<tr *ngFor="let data of givendata?.slice()?.reverse() | searchFilter:searchFilter; let i = index">
<td>{{data.textt}}</td>
<td>{{data.selectv}}</td>
<td>{{data.selectb}}</td>
<td>{{data.selectmul}}</td>
<td>{{data.dyamul}}</td>
<td>{{data.selectautocom}}</td>
<td>{{data.autocommul}}</td>
<td><i class="bi bi-pencil" style="cursor: pointer; padding-right: 10px"(click)="goToEdit(data.id)"></i><i class="bi bi-trash" style="cursor: pointer;" data-bs-toggle="modal" data-bs-target="#deleteModal" (click)="onDelete(data)"></i></td>
</tr>
</tbody>
</table></div>
</div>
<div class="modal fade" id="deleteModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true" data-bs-backdrop="false">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" *ngIf="rowSelected.id">
<h5 class="modal-title" id="exampleModalLabel">Delete</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>Are You Sure Want to delete?</p>
<h2 class="heading">{{rowSelected.id}}</h2>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" (click)="delete(rowSelected.id)">Delete</button>
</div>
</div>
</div>
</div>

@ -0,0 +1,4 @@
.delete,.heading{
text-align: center;
color: red;
}

@ -0,0 +1,100 @@
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 { FormcService } from './Formc.service';
import { ToastrService } from 'ngx-toastr';
@Component({
selector: 'app-Formc',
templateUrl: './Formc.component.html',
styleUrls: ['./Formc.component.scss']
})
export class FormcComponent 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:FormcService,
) {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(["../Formcadd"],{relativeTo:this.route});
}
goToEdit(id: any){
this.router.navigate(["../Formcedit/"+ 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');
}
}
);
}
}

@ -0,0 +1,45 @@
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 FormcService {
private baseURL = "Formc/Formc" ; 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);
}
updatenew(id: number, data: any): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.put(_http, data);
}
deleteusr(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.delete(_http);
}
getAllselectb(): Observable<any> {
return this.apiRequest.get("Formc_ListFilter1/Formc_ListFilter1"); }
getAlldyamul(): Observable<any> { return this.apiRequest.get("Formc_ListFilter1/Formc_ListFilter1"); }
getAllselectautocom(): Observable<any> { return this.apiRequest.get("Formc_ListFilter1/Formc_ListFilter1"); }
getAllautocommul(): Observable<any> { return this.apiRequest.get("Formc_ListFilter1/Formc_ListFilter1"); }
// updateaction
}

@ -0,0 +1,140 @@
<h4 style="font-weight: 500;display: inline;"> Formc</h4>
<span class="label label-light-blue" style="display: inline;margin-left: 30px;">Add Mode</span>
<br>
<hr>
<div class="main" >
<form [formGroup]="entryForm">
<div class="row"><div class="col-md-4 col-sm-12">
<label for="name"> textt </label>
<input type="text" class="input" formControlName="textt" >
<div *ngIf="submitted && entryForm.controls.textt.errors" class="error_mess">
<div *ngIf="submitted && entryForm.controls.textt.errors.required" class="error_mess">*This field is Required</div>
</div>
</div>
<div class="col-md-4 col-sm-12">
<label>selectv </label>
<select formControlName="selectv">
<option [value]="null">Select selectv </option>
<option> b </option>
<option> k </option>
</select></div>
<div class="col-md-4 col-sm-12">
<label> selectb </label>
<select formControlName="selectb">
<option [value]="null">Choose selectb</option>
<option *ngFor="let item of selectselectb" [value]="item.id">{{item.textt}}</option>
</select> </div>
<div class="col-md-4 col-sm-12">
<label>selectmul</label>
<ng-multiselect-dropdown #multiSelect
formControlName="selectmul"
[placeholder]="'Select selectmul'"
[data]="selectselectmul"
[(ngModel)]="selectedselectmuldata"
[settings]="selectmulsettings"
[disabled]="false">
</ng-multiselect-dropdown>
</div>
<div class="col-md-4 col-sm-12">
<label for="name"> dyamul </label>
<input type="text" class="input" formControlName="dyamul" >
<div *ngIf="submitted && entryForm.controls.dyamul.errors" class="error_mess">
<div *ngIf="submitted && entryForm.controls.dyamul.errors.required" class="error_mess">*This field is Required</div>
</div>
</div>
<div class="col-md-4 col-sm-12" >
<label> selectautocom </label>
<input type="text" list="selectautocomconfig" class="input" formControlName="selectautocom">
<datalist id="selectautocomconfig"> <option *ngFor="let item of selectselectautocom" [ngValue]="item.id">{{item. textt }}</option> </datalist> </div>
<div class="col-md-4 col-sm-12">
<label>autocommul </label>
<ng-multiselect-dropdown #multiSelect
formControlName="autocommul"
[placeholder]="'Select autocommul'"
[data]="selectautocommul"
[(ngModel)]="selectedautocommuldata"
[settings]="settings"
[disabled]="false">
</ng-multiselect-dropdown>
</div>
</div>
</form>
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="goback()">Cancel</button>
<button type="submit" class="btn btn-primary" (click)="onSubmit()">ADD</button>
</div>
</div>

@ -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;
}

@ -0,0 +1,245 @@
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 { FormcService } from '../Formc.service';
@Component({
selector: 'app-Formcadd',
templateUrl: './Formcadd.component.html',
styleUrls: ['./Formcadd.component.scss']
})
export class FormcaddComponent implements OnInit {
public entryForm: FormGroup;
loading = false;
tableName = 'Formc';
error;
submitted=false;
constructor(private _fb: FormBuilder,
private mainservice:FormcService,
private router: Router,private accesstype:AccesstypeService,
private route: ActivatedRoute,
private toastr: ToastrService ) { }
ngOnInit(): void {
this.entryForm = this._fb.group({
textt :[null],
selectv :[null],
selectb :[null],
selectmul :[null],
dyamul :[null],
selectautocom :[null],
autocommul :[null],
});
this.getallselectb();
this.selectmulsettings = {
singleSelection: false,
enableCheckAll: true,
selectAllText: 'Select All',
unSelectAllText: 'Unselect All',
allowSearchFilter: true,
limitSelection: -1,
clearSearchFilter: true,
maxHeight: 197,
itemsShowLimit: 6,
searchPlaceholderText: 'Search selectmul',
noDataAvailablePlaceholderText: 'no data available',
closeDropDownOnSelection: false,
showSelectedItemsAtTop: false,
defaultOpen: false,
};
this.getallselectautocom();
this.settings = {
idField: 'textt',
textField: 'textt',
singleSelection: false,
enableCheckAll: true,
selectAllText: 'Select All',
unSelectAllText: 'Unselect All',
allowSearchFilter: true,
limitSelection: -1,
clearSearchFilter: true,
maxHeight: 197,
itemsShowLimit: 6,
searchPlaceholderText: 'Search autocommul',
noDataAvailablePlaceholderText: 'no data available',
closeDropDownOnSelection: false,
showSelectedItemsAtTop: false,
defaultOpen: false,
};
this.selectedautocommuldata = [];
this.getallautocommul();
}
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;
}
this.entryForm.value.selectmul = JSON.stringify(this.selectedselectmuldata);
this.entryForm.value.autocommul = JSON.stringify(this.selectedautocommuldata );
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(["../Formc"], { relativeTo: this.route });
}
goback(){
this.router.navigate(["../Formc"], { relativeTo: this.route });
}
selectselectb ;
getallselectb() {
this.mainservice.getAllselectb().subscribe(data=>{
this.selectselectb = data;
console.log(data);
},(error) => { console.log(error); }); }
selectedselectmuldata:any = [];
selectmulsettings;
selectselectmul =[
'a',
'b',
'c',
];
selectselectautocom ;
getallselectautocom () {
this.mainservice.getAllselectautocom().subscribe(data=>{
this.selectselectautocom = data; console.log(data);
},(error) => { console.log(error); }); }
selectautocommul;
settings;
getallautocommul () {
this.mainservice.getAllautocommul().subscribe(data=>{
this.selectautocommul = data;
console.log(data);
},(error) => { console.log(error); }); }
selectedautocommuldata:any = [];
}

@ -0,0 +1,141 @@
<h4 style="font-weight: 500;display: inline;">table_name</h4>
<span class="label label-light-blue" style="display: inline;margin-left: 30px;">Edit Mode</span>
<br>
<hr>
<div class="main" >
<form *ngIf="data1">
<div class="row">
<div class="col-md-4 col-sm-12">
<label for="name"> textt</label>
<input type="text" class="input" name="textt" [(ngModel)]="data1.textt" >
</div>
<div class="col-md-4 col-sm-12">
<label> selectv </label>
<select name="selectv" [(ngModel)]="data1.selectv">
<option [value]="null">Selectselectv
</option>
<option> b </option>
<option> k </option>
</select> </div>
<div class="col-md-4 col-sm-12">
<label>selectb</label>
<select name="selectb" [(ngModel)]="data1.selectb">
<option [value]="null">Choose selectb</option>
<option *ngFor=" let item of selectselectb" [value]="item.id">{{item.textt }}</option> </select> </div>
<div class="col-md-4 col-sm-12">
<label> selectmul </label>
<ng-multiselect-dropdown #multiSelect
[placeholder]="'Select selectmul'"
[data]="selectselectmul"
[(ngModel)]="selectedselectmuldata"
name="selectedselectmuldata"
[settings]="selectmulsettings"
[disabled]="false">
</ng-multiselect-dropdown>
</div>
<div class="col-md-4 col-sm-12">
<label for="name"> dyamul</label>
<input type="text" class="input" name="dyamul" [(ngModel)]="data1.dyamul" >
</div>
<div class="col-md-4 col-sm-12">
<label> selectautocom</label>
<input type="text" list="selectautocomconfig" class="input" name="selectautocom" [(ngModel)]="data1.selectautocom">
<datalist id="selectautocomconfig">
<option *ngFor="let item of selectselectautocom" [ngValue]="item.id">{{item.textt }}</option> </datalist> </div>
<div class="col-md-4 col-sm-12">
<label> autocommul </label>
<ng-multiselect-dropdown #multiSelect
[placeholder]="'Select autocommul'"
[data]="selectautocommul"
[(ngModel)]="selectedautocommuldata"
name="selectedautocommuldata"
[settings]="settings"
[disabled]="false">
</ng-multiselect-dropdown>
</div>
</div>
</form>
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="goback()">Close</button>
<button type="button" class="btn btn-primary" (click)="update()">Update</button>
</div>
</div>

@ -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;
}

@ -0,0 +1,216 @@
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 { FormcService } from '../Formc.service';
@Component({
selector: 'app-Formcedit',
templateUrl: './Formcedit.component.html',
styleUrls: ['./Formcedit.component.scss']
})
export class FormceditComponent implements OnInit {
id:number;
data1:any={};
loading = false;
tableName = 'Formc';
error;
constructor( private route:ActivatedRoute,
private mainservice:FormcService,
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);
//
this.getallselectb();
this.selectmulsettings = {
singleSelection: false,
enableCheckAll: true,
selectAllText: 'Select All',
unSelectAllText: 'Unselect All',
allowSearchFilter: true,
limitSelection: -1,
clearSearchFilter: true,
maxHeight: 197,
itemsShowLimit: 6,
searchPlaceholderText: 'Search selectmul',
noDataAvailablePlaceholderText: 'no data available',
closeDropDownOnSelection: false,
showSelectedItemsAtTop: false,
defaultOpen: false,
};
this.getallselectautocom();
this.settings = {
idField: 'textt',
textField: 'textt',
singleSelection: false,
enableCheckAll: true,
selectAllText: 'Select All',
unSelectAllText: 'Unselect All',
allowSearchFilter: true,
limitSelection: -1,
clearSearchFilter: true,
maxHeight: 197,
itemsShowLimit: 6,
searchPlaceholderText: 'Search autocommul',
noDataAvailablePlaceholderText: 'no data available',
closeDropDownOnSelection: false,
showSelectedItemsAtTop: false,
defaultOpen: false,
};
this.selectedautocommuldata = [];
this.getallautocommul();
}
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.selectedselectmuldata = JSON.parse(this.data1.selectmul );
this.selectedautocommuldata = JSON.parse(this.data1.autocommul );
console.log(this.data1);
});
}
update(){
this.data1.selectmul = JSON.stringify(this.selectedselectmuldata );
this.data1.autocommul = JSON.stringify(this.selectedautocommuldata );
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(["../../Formc"], { 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(["../../Formc"], { relativeTo: this.route });
}
selectselectb ;
getallselectb() {
this.mainservice.getAllselectb().subscribe(data=>{
this.selectselectb = data;
console.log(data);
},(error) => { console.log(error); }); }
selectedselectmuldata:any = [];
selectmulsettings;
selectselectmul =[
'a',
'b',
'c',
];
selectselectautocom ;
getallselectautocom () {
this.mainservice.getAllselectautocom().subscribe(data=>{
this.selectselectautocom = data; console.log(data);
},(error) => { console.log(error); }); }
selectautocommul;
settings;
getallautocommul () {
this.mainservice.getAllautocommul().subscribe(data=>{
this.selectautocommul = data;
console.log(data);
},(error) => { console.log(error); }); }
selectedautocommuldata:any = [];
}

@ -1,3 +1,9 @@
import { FormceditComponent } from './BuilderComponents/basicp1/Formc/Formcedit/Formcedit.component';
import { FormcaddComponent } from './BuilderComponents/basicp1/Formc/Formcadd/Formcadd.component';
import { FormcComponent } from './BuilderComponents/basicp1/Formc/Formc.component';
import { ChildeditComponent } from './BuilderComponents/basicp1/Child/Childedit/Childedit.component';
import { ChildaddComponent } from './BuilderComponents/basicp1/Child/Childadd/Childadd.component';
import { ChildComponent } from './BuilderComponents/basicp1/Child/Child.component';
@ -124,6 +130,24 @@ const routes: Routes = [
{path:'Formcadd',component:FormcaddComponent},
{path:'Formc',component:FormcComponent},
{path:'Childedit/:id',component:ChildeditComponent},
{path:'Childadd',component:ChildaddComponent},
{path:'Child',component:ChildComponent},
{path:'Formcedit/:id',component:FormceditComponent},
{path:'Formcadd',component:FormcaddComponent},
{path:'Formc',component:FormcComponent},

@ -1,3 +1,9 @@
import { FormceditComponent } from './BuilderComponents/basicp1/Formc/Formcedit/Formcedit.component';
import { FormcaddComponent } from './BuilderComponents/basicp1/Formc/Formcadd/Formcadd.component';
import { FormcComponent } from './BuilderComponents/basicp1/Formc/Formc.component';
import { ChildeditComponent } from './BuilderComponents/basicp1/Child/Childedit/Childedit.component';
import { ChildaddComponent } from './BuilderComponents/basicp1/Child/Childadd/Childadd.component';
import { ChildComponent } from './BuilderComponents/basicp1/Child/Child.component';
@ -123,6 +129,24 @@ FormcaddComponent,
FormcComponent,
ChildeditComponent,
ChildaddComponent,
ChildComponent,
FormceditComponent,
FormcaddComponent,
FormcComponent,