accesstye
This commit is contained in:
		
							parent
							
								
									6f3c5d857e
								
							
						
					
					
						commit
						f7c801e835
					
				| @ -12,171 +12,178 @@ import { AccesstypeService } from 'src/app/services/admin/accesstype.service'; | ||||
| export class AccesstypeComponent implements OnInit { | ||||
|   loading = false; | ||||
|   selected: any[] = []; | ||||
|   rowSelected :any= {}; | ||||
|   modaldelete=false; | ||||
|   modalAdd= false; | ||||
|   modaledit=false; | ||||
|   moduleAdd=false; | ||||
|   rowSelected: any = {}; | ||||
|   modaldelete = false; | ||||
|   modalAdd = false; | ||||
|   modaledit = false; | ||||
|   moduleAdd = false; | ||||
|   error; | ||||
|   data; | ||||
|   module; | ||||
|   moduledata; | ||||
|   submitted=false; | ||||
|   submitted = false; | ||||
|   selected1 = "true"; | ||||
|   public entryForm: FormGroup; | ||||
|   public mentryForm:FormGroup; | ||||
|   constructor( private _fb: FormBuilder,private toastr:ToastrService, | ||||
|     private router: Router,private accesstype:AccesstypeService, | ||||
|   public mentryForm: FormGroup; | ||||
|   constructor(private _fb: FormBuilder, private toastr: ToastrService, | ||||
|     private router: Router, private accesstype: AccesstypeService, | ||||
|     private route: ActivatedRoute, | ||||
|    ) { } | ||||
|   ) { } | ||||
| 
 | ||||
|   ngOnInit(): void { | ||||
|     this.entryForm = this._fb.group({ | ||||
| 
 | ||||
|       name:['',[Validators.required]], | ||||
|       defaultvalue:['',[Validators.required]] , | ||||
|        description:['',[Validators.required]] , | ||||
|       name: ['', [Validators.required]], | ||||
|       defaultvalue: ['', [Validators.required]], | ||||
|       description: ['', [Validators.required]], | ||||
| 
 | ||||
|        }); | ||||
|        this.mentryForm=this._fb.group({ | ||||
|         modulename:[null], | ||||
|        }) | ||||
|        this.getdata(); | ||||
|        this.getdata1(); | ||||
|     }); | ||||
|     this.mentryForm = this._fb.group({ | ||||
|       modulename: [null], | ||||
|     }) | ||||
|     this.getdata(); | ||||
|     this.getdata1(); | ||||
|   } | ||||
|   getdata(){ | ||||
|   getdata() { | ||||
|     this.accesstype.getAll().subscribe(resp => { | ||||
|       this.data = resp; | ||||
|       console.log('menus: ', this.data); | ||||
|       if(this.data.length==0){ | ||||
|         this.error="No data Available"; | ||||
|       if (this.data.length == 0) { | ||||
|         this.error = "No data Available"; | ||||
|         console.log(this.error) | ||||
|       } | ||||
|   },(error) => { | ||||
|     console.log(error); | ||||
|     if(error){ | ||||
|      this.error="Server Error"; | ||||
|    } | ||||
|   }) | ||||
|     }, (error) => { | ||||
|       console.log(error); | ||||
|       if (error) { | ||||
|         this.error = "Server Error"; | ||||
|       } | ||||
|     }) | ||||
|   } | ||||
|   getdata1(){ | ||||
|   getdata1() { | ||||
|     this.accesstype.getAll1().subscribe(resp => { | ||||
|       this.moduledata = resp; | ||||
|       console.log('menus: ', this.moduledata); | ||||
|       if(this.moduledata.length==0){ | ||||
|         this.error="No data Available"; | ||||
|       if (this.moduledata.length == 0) { | ||||
|         this.error = "No data Available"; | ||||
|         console.log(this.error) | ||||
|       } | ||||
|   },(error) => { | ||||
|     console.log(error); | ||||
|     if(error){ | ||||
|      this.error="Server Error"; | ||||
|    } | ||||
|   }) | ||||
|     }, (error) => { | ||||
|       console.log(error); | ||||
|       if (error) { | ||||
|         this.error = "Server Error"; | ||||
|       } | ||||
|     }) | ||||
|   } | ||||
|   goToAdd(){ | ||||
|     this.modalAdd=true; | ||||
|   goToAdd() { | ||||
|     this.modalAdd = true; | ||||
|   } | ||||
|   onSubmit(){ | ||||
|   onSubmit() { | ||||
|     console.log(this.entryForm.value); | ||||
|     this.submitted=true; | ||||
|     this.submitted = true; | ||||
|     if (this.entryForm.invalid) { | ||||
|       return; | ||||
|     } | ||||
|     console.log(this.entryForm.value); | ||||
|     this.accesstype.create(this.entryForm.value).subscribe((data)=>{ | ||||
|     this.accesstype.create(this.entryForm.value).subscribe((data) => { | ||||
|       console.log(data); | ||||
|       if (data) { | ||||
|         this.toastr.success('Added successfully'); | ||||
|             } | ||||
|       } | ||||
|       this.ngOnInit(); | ||||
|     }, | ||||
|     (error) => { | ||||
|     console.log('Error in adding data...',+error); | ||||
|     if(error){ | ||||
|       this.toastr.error('Not added Data Getting Some Error'); | ||||
|     } | ||||
|       (error) => { | ||||
|         console.log('Error in adding data...', error); | ||||
|         if (error) { | ||||
|           this.toastr.error('Not added Data Getting Some Error'); | ||||
|         } | ||||
|         this.ngOnInit(); | ||||
| 
 | ||||
|     }); | ||||
|     this.modalAdd=false; | ||||
|       }); | ||||
|     this.modalAdd = false; | ||||
|   } | ||||
|   goToEdit(row) { | ||||
|     this.rowSelected = row; | ||||
|     console.log(row) | ||||
|     this.modaledit=true; | ||||
|     this.modaledit = true; | ||||
|     //this.router.navigate(["../edit/" + id], { relativeTo: this.route });
 | ||||
|   } | ||||
|   onDelete(row) { | ||||
|     this.rowSelected = row; | ||||
|      this.modaldelete=true; | ||||
|     this.modaldelete = true; | ||||
|   } | ||||
| 
 | ||||
|   delete(id) | ||||
|   { | ||||
|   delete(id) { | ||||
|     this.modaldelete = false; | ||||
|     console.log("in delete  "+id); | ||||
|     this.accesstype.delete(id).subscribe((data)=>{ | ||||
|     console.log("in delete  " + id); | ||||
|     this.accesstype.delete(id).subscribe((data) => { | ||||
|       console.log(data); | ||||
|       if (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'); | ||||
|       } | ||||
|     }); | ||||
|       this.ngOnInit(); | ||||
|     }, | ||||
|       (error) => { | ||||
|         console.log('Error in adding data...', error); | ||||
|         if (error) { | ||||
|           this.toastr.error('Not Deleted Data Getting Some Error'); | ||||
|         } | ||||
|         this.ngOnInit(); | ||||
|       }); | ||||
| 
 | ||||
|   } | ||||
|   onUpdate(id){ | ||||
|     this.modaledit=false; | ||||
| this.accesstype.update(id,this.rowSelected).subscribe((data)=>{ | ||||
| console.log(data); | ||||
| if (data) { | ||||
|   this.toastr.success('Updated successfully'); | ||||
|   onUpdate(id) { | ||||
|     this.modaledit = false; | ||||
|     this.accesstype.update(id, this.rowSelected).subscribe((data) => { | ||||
|       console.log(data); | ||||
|       if (data) { | ||||
|         this.toastr.success('Updated successfully'); | ||||
|       } | ||||
| }, | ||||
| (error) => { | ||||
| console.log('Error in adding data...',+error); | ||||
| if(error){ | ||||
|   this.toastr.error('Not updated Data Getting Some Error'); | ||||
| } | ||||
| }); | ||||
|       this.ngOnInit(); | ||||
|     }, | ||||
|       (error) => { | ||||
|         console.log('Error in adding data...', error); | ||||
|         if (error) { | ||||
|           this.toastr.error('Not updated Data Getting Some Error'); | ||||
|         } | ||||
|         this.ngOnInit(); | ||||
|       }); | ||||
|   } | ||||
|   goTomodules(){ | ||||
|   goTomodules() { | ||||
|     this.router.navigate(["../acmodules"], { relativeTo: this.route }); | ||||
|   } | ||||
|   accessid; | ||||
|   gomodules(row){ | ||||
|   gomodules(row) { | ||||
|     this.rowSelected = row; | ||||
|     this.moduleAdd=true; | ||||
|     this.accessid=row.id | ||||
|     this.moduleAdd = true; | ||||
|     this.accessid = row.id | ||||
|     this.getallidmodules(this.accessid) | ||||
|   } | ||||
|   moduledata1; | ||||
|   getallidmodules(id){ | ||||
|     this.accesstype.getById(id).subscribe((data)=>{ | ||||
|   getallidmodules(id) { | ||||
|     this.accesstype.getById(id).subscribe((data) => { | ||||
|       console.log(data); | ||||
|       this.moduledata1=data; | ||||
|       if(this.moduledata1.length==0){ | ||||
|         this.error="No data Available"; | ||||
|       this.moduledata1 = data; | ||||
|       if (this.moduledata1.length == 0) { | ||||
|         this.error = "No data Available"; | ||||
|         console.log(this.error) | ||||
|       } | ||||
|     }) | ||||
|   } | ||||
|   addmodules(id){ | ||||
|   addmodules(id) { | ||||
|     console.log(this.mentryForm.value); | ||||
| this.accesstype.addById(id,this.mentryForm.value).subscribe((data)=>{ | ||||
|   console.log(data); | ||||
|   if(data){ | ||||
|     this.toastr.success("Added Successfully"); | ||||
|   } | ||||
| },(error) => { | ||||
|   console.log('Error in adding data...',+error); | ||||
|   if(error){ | ||||
|     this.toastr.error('Not Added Data Getting Some Error'); | ||||
|   } | ||||
|   }) | ||||
| this.moduleAdd=false; | ||||
|     this.accesstype.addById(id, this.mentryForm.value).subscribe((data) => { | ||||
|       console.log(data); | ||||
|       if (data) { | ||||
|         this.toastr.success("Added Successfully"); | ||||
|       } | ||||
|       this.ngOnInit(); | ||||
|     }, (error) => { | ||||
|       console.log('Error in adding data...', error); | ||||
|       if (error) { | ||||
|         this.toastr.error('Not Added Data Getting Some Error'); | ||||
|       } | ||||
|       this.ngOnInit(); | ||||
|     }) | ||||
|     this.moduleAdd = false; | ||||
|   } | ||||
| } | ||||
|  | ||||
| @ -4,9 +4,6 @@ | ||||
|   <li><a href="javascript://">{{ 'MENU_ACCESS_CONTROL' | translate }}</a></li> | ||||
| </ol> | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| <div class="clr-row"> | ||||
|   <div class="clr-col-6" style="display:flex ;"> | ||||
|     <div style="margin-right: 25px;"> | ||||
| @ -20,8 +17,10 @@ | ||||
|     {{ 'FOR' | translate }} <select id="" style="height: 30px;" (change)="idofselected($event.target.value)"> | ||||
|       <option *ngFor="let sub of givendata" [value]="sub.usrGrp" [selected]="sub.usrGrp== 40">{{sub.groupName}}</option> | ||||
|     </select> | ||||
|     <button id="add" class="btn btn-primary" style="margin-left: 20px;" (click)="getbyuseriddata()">  {{ 'RELOAD' | translate }} </button> | ||||
|     <span *ngIf="!toggle">{{ 'SHOW_ALL' | translate }} </span><span *ngIf="toggle">{{ 'ONLY_MAIN_MENU' | translate }}</span> | ||||
|     <button id="add" class="btn btn-primary" style="margin-left: 20px;" (click)="getbyuseriddata()"> {{ 'RELOAD' | | ||||
|       translate }} </button> | ||||
|     <span *ngIf="!toggle">{{ 'SHOW_ALL' | translate }} </span><span *ngIf="toggle">{{ 'ONLY_MAIN_MENU' | translate | ||||
|       }}</span> | ||||
|     <label class="switch"> | ||||
|       <input type="checkbox" ([ngModel])="toggle" checked (click)="toggleCheckbox()"> | ||||
|       <span class="slider round"></span> | ||||
| @ -34,15 +33,16 @@ | ||||
|   <div class="clr-row"> | ||||
| 
 | ||||
|     <div class="clr-col-12" style="text-align: right;"> | ||||
|       <button id="add" class="btn btn-primary" style="margin-left: 20px;" (click)="modaladd()"> | ||||
| 
 | ||||
|       <button id="add" class="btn btn-primary" style="margin-left: 20px;" (click)="modaladd()" [disabled]="!toggle"> | ||||
|         <clr-icon shape="plus"></clr-icon>{{ 'ADD' | translate }} </button> | ||||
|       <div *ngIf="!toggle" class="error-message" style="color: red; font-size: 14px; margin-top: 5px;"> | ||||
|         {{ ' Close toggle to activate Add button. ' | translate }} | ||||
|       </div> | ||||
|     </div> | ||||
|   </div> | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|   <clr-datagrid [clrDgLoading]="loading" *ngIf="!toggle"> | ||||
|     <clr-dg-placeholder> | ||||
|       <ng-template #loadingSpinner><clr-spinner>Loading ... </clr-spinner></ng-template> | ||||
| @ -50,29 +50,29 @@ | ||||
|     </clr-dg-placeholder> | ||||
| 
 | ||||
|     <clr-dg-column [clrDgField]="'no'"> <ng-container *clrDgHideableColumn="{hidden: false}"> | ||||
|       {{ 'NO' | translate }} | ||||
|         {{ 'NO' | translate }} | ||||
|       </ng-container></clr-dg-column> | ||||
|     <clr-dg-column [clrDgField]="'menuname'"> <ng-container *clrDgHideableColumn="{hidden: false}"> | ||||
|       {{ 'MENU_ITEM_NAME' | translate }} | ||||
|         {{ 'MENU_ITEM_NAME' | translate }} | ||||
|       </ng-container></clr-dg-column> | ||||
|     <clr-dg-column [clrDgField]="'mvisible'"><ng-container *clrDgHideableColumn="{hidden: false}"> | ||||
|       {{ 'VIEW' | translate }} | ||||
|         {{ 'VIEW' | translate }} | ||||
|       </ng-container></clr-dg-column> | ||||
|     <clr-dg-column [clrDgField]="'mcreate'"> <ng-container *clrDgHideableColumn="{hidden: false}"> | ||||
|       {{ 'CREATE' | translate }} | ||||
|         {{ 'CREATE' | translate }} | ||||
|       </ng-container></clr-dg-column> | ||||
|     <clr-dg-column [clrDgField]="'medit'"> <ng-container *clrDgHideableColumn="{hidden: false}"> | ||||
|       {{ 'EDIT' | translate }} | ||||
|         {{ 'EDIT' | translate }} | ||||
|       </ng-container></clr-dg-column> | ||||
|     <clr-dg-column [clrDgField]="'mdelete'"> <ng-container *clrDgHideableColumn="{hidden: false}"> | ||||
|       {{ 'DELETE' | translate }} | ||||
|         {{ 'DELETE' | translate }} | ||||
|         <!-- <input type="checkbox" clrCheckbox name="mdelete" [checked]="colvalue" (change)="changedelete($event.target.checked)"> --> | ||||
|       </ng-container></clr-dg-column> | ||||
|     <clr-dg-column [clrDgField]="'mquery'"> <ng-container *clrDgHideableColumn="{hidden: false}"> | ||||
|       {{ 'QUERY' | translate }} | ||||
|         {{ 'QUERY' | translate }} | ||||
|       </ng-container></clr-dg-column> | ||||
|     <clr-dg-column [clrDgField]="'mexport'"> <ng-container *clrDgHideableColumn="{hidden: false}"> | ||||
|       {{ 'EXPORT' | translate }} | ||||
|         {{ 'EXPORT' | translate }} | ||||
|       </ng-container></clr-dg-column> | ||||
| 
 | ||||
|     <clr-dg-row *ngFor="let all of alldata;let i=index"> | ||||
| @ -89,9 +89,10 @@ | ||||
|       <clr-dg-action-overflow> | ||||
|         <button class="action-item" (click)="modalEdit(all)">{{ 'EDIT' | translate }} <clr-icon shape="edit" | ||||
|             class="is-error"></clr-icon></button> | ||||
|         <button class="action-item" *ngIf="all.menuId!==0" (click)="modalDelete(all)">{{ 'DELETE' | translate }} <clr-icon shape="trash" | ||||
|             class="is-error"></clr-icon></button> | ||||
|         <button class="action-item" *ngIf="all.menuId==0" (click)="modaldeletemainmenu(all)">{{ 'DELETE_MENU_SUBMENU' | translate }} | ||||
|         <button class="action-item" *ngIf="all.menuId!==0" (click)="modalDelete(all)">{{ 'DELETE' | translate }} | ||||
|           <clr-icon shape="trash" class="is-error"></clr-icon></button> | ||||
|         <button class="action-item" *ngIf="all.menuId==0" (click)="modaldeletemainmenu(all)">{{ 'DELETE_MENU_SUBMENU' | | ||||
|           translate }} | ||||
|           <clr-icon shape="edit" class="is-error"></clr-icon></button> | ||||
| 
 | ||||
|       </clr-dg-action-overflow> | ||||
|  | ||||
| @ -15,19 +15,19 @@ export class MenuaccesscontrolComponent implements OnInit { | ||||
|   loading = false; | ||||
|   givendata; | ||||
|   alldata; | ||||
|   colvalue="true"; | ||||
|   usergrpid=1; | ||||
|   colvalue = "true"; | ||||
|   usergrpid = 1; | ||||
|   secmenuaccessdata; | ||||
|   modalAdd= false; | ||||
|   modaledit=false; | ||||
|   modaldelete=false; | ||||
|   modaldelete1=false; | ||||
|   rowSelected :any= {}; | ||||
|   modalAdd = false; | ||||
|   modaledit = false; | ||||
|   modaldelete = false; | ||||
|   modaldelete1 = false; | ||||
|   rowSelected: any = {}; | ||||
|   public entryForm: FormGroup; | ||||
|   selected = "true"; | ||||
|   menudata; | ||||
|   menus; | ||||
|   menuselectid=1; | ||||
|   menuselectid = 1; | ||||
|   msg; | ||||
|   error; | ||||
|   mcreate; | ||||
| @ -36,197 +36,211 @@ export class MenuaccesscontrolComponent implements OnInit { | ||||
|   toggle: boolean = false; | ||||
|   maindata; | ||||
|   showdata; | ||||
|   constructor(private mainservice:UsermaintanceService, | ||||
|   constructor(private mainservice: UsermaintanceService, | ||||
|     private _fb: FormBuilder, | ||||
|     private toastr:ToastrService, | ||||
|     private route:ActivatedRoute, | ||||
|     private usergrpservice:UsergrpmaintainceService, | ||||
|     private toastr: ToastrService, | ||||
|     private route: ActivatedRoute, | ||||
|     private usergrpservice: UsergrpmaintainceService, | ||||
|     private menuGroupService: MenuGroupService, | ||||
|     private menuservice:MenumaintanceService,) { } | ||||
|     private menuservice: MenumaintanceService,) { } | ||||
| 
 | ||||
|   ngOnInit(): void { | ||||
|     this.showdata = this.menuGroupService.getdata(); | ||||
|     console.log(this.showdata); | ||||
|       this.mcreate=this.showdata.mcreate; | ||||
|       console.log(this.mcreate); | ||||
|       this.mdelete=this.showdata.mdelete | ||||
|       console.log(this.mdelete); | ||||
|       this.medit=this.showdata.medit | ||||
|       console.log(this.medit); | ||||
|     this.mcreate = this.showdata.mcreate; | ||||
|     console.log(this.mcreate); | ||||
|     this.mdelete = this.showdata.mdelete | ||||
|     console.log(this.mdelete); | ||||
|     this.medit = this.showdata.medit | ||||
|     console.log(this.medit); | ||||
|     this.dropddowngetdata(); | ||||
|    // this.getall();
 | ||||
| this.getbyuseriddata(); | ||||
|     // this.getall();
 | ||||
|     this.getbyuseriddata(); | ||||
| 
 | ||||
| this.entryForm=this._fb.group({ | ||||
|   grpid:this.usergrpid , | ||||
|   gmenuid:this.menuselectid , | ||||
|   }); | ||||
| 
 | ||||
| } | ||||
| dropddowngetdata(){ | ||||
|   this.usergrpservice.getAll().subscribe((data) => { | ||||
|     console.log(data); | ||||
|     this.givendata = data; | ||||
|   }); | ||||
| } | ||||
| getdata(){ | ||||
|   this.menuservice.getByCurrentUserMenuGroupId1().subscribe(resp => { | ||||
|     this.menus = resp; | ||||
|     console.log('menus: ', this.menus); | ||||
| }) | ||||
| } | ||||
| getall(){ | ||||
|   this.usergrpservice.getall().subscribe((data)=>{ | ||||
|     this.secmenuaccessdata=data | ||||
|     console.log(data); | ||||
|   }) | ||||
| } | ||||
| idofselected(val){ | ||||
|   console.log(val); | ||||
|   this.usergrpid=val; | ||||
| 
 | ||||
| } | ||||
| idselected(val){ | ||||
|   console.log(val) | ||||
|   this.menuselectid=val; | ||||
| } | ||||
| getbyuseriddata(){ | ||||
|   this.usergrpservice.getbyusergrpid(this.usergrpid).subscribe((data)=>{ | ||||
|     this.alldata=data; | ||||
|     console.log(this.alldata); | ||||
|     if(this.alldata.array?.length === 0){ | ||||
|       this.msg='No Data Availabel' | ||||
|     } | ||||
|     for(this.alldata; this.alldata>=100;this.alldata++){ | ||||
|       this.maindata=this.alldata.menuId === 0 | ||||
|       console.log(this.maindata) | ||||
|     } | ||||
| 
 | ||||
|    // console.log(this.menudata)
 | ||||
|   }, | ||||
|   (error) => { | ||||
|     console.log('Error in adding data...',+error); | ||||
|       if(error){ | ||||
|         this.error="No data Available" | ||||
|       } | ||||
|   }); | ||||
| } | ||||
| modaladd(){ | ||||
|   this.modalAdd=true; | ||||
|   this.getdata(); | ||||
| } | ||||
| onSubmit(){ | ||||
|   this.modalAdd=false; | ||||
|   this.entryForm.value.grpid=this.usergrpid; | ||||
|   this.entryForm.value.gmenuid=this.menuselectid; | ||||
|   console.log(this.entryForm.value); | ||||
|   this.menuservice.create2(this.entryForm.value).subscribe((data)=>{ | ||||
|     console.log(data); | ||||
|     if (data) { | ||||
|       this.toastr.success('Added successfully'); | ||||
|           } | ||||
|   }, | ||||
|     (error) => { | ||||
|       console.log('Error in adding data...',+error); | ||||
|         if(error){ | ||||
|           this.toastr.error('Not added Data Getting Some Error'); | ||||
|         } | ||||
|     this.entryForm = this._fb.group({ | ||||
|       grpid: this.usergrpid, | ||||
|       gmenuid: this.menuselectid, | ||||
|     }); | ||||
| 
 | ||||
| } | ||||
| modalEdit(row){ | ||||
| this.rowSelected=row; | ||||
| console.log(this.rowSelected); | ||||
| this.modaledit=true; | ||||
| } | ||||
| modalDelete(row){ | ||||
|   this.rowSelected=row; | ||||
|   console.log(this.rowSelected) | ||||
| this.modaldelete=true; | ||||
| } | ||||
| delete(id,usrgrp){ | ||||
|   this.modaldelete=false; | ||||
| this.usergrpservice.delete(id,usrgrp).subscribe((data)=>{ | ||||
|   console.log(data); | ||||
|   if (data) { | ||||
|     this.toastr.success('Deleted successfully'); | ||||
|   } | ||||
|   dropddowngetdata() { | ||||
|     this.usergrpservice.getAll().subscribe((data) => { | ||||
|       console.log(data); | ||||
|       this.givendata = data; | ||||
|     }); | ||||
|   } | ||||
|   getdata() { | ||||
|     this.menuservice.getByCurrentUserMenuGroupId1().subscribe(resp => { | ||||
|       this.menus = resp; | ||||
|       console.log('menus: ', this.menus); | ||||
|     }) | ||||
|   } | ||||
|   getall() { | ||||
|     this.usergrpservice.getall().subscribe((data) => { | ||||
|       this.secmenuaccessdata = data | ||||
|       console.log(data); | ||||
|     }) | ||||
|   } | ||||
|   idofselected(val) { | ||||
|     console.log(val); | ||||
|     this.usergrpid = val; | ||||
| 
 | ||||
|   } | ||||
|   idselected(val) { | ||||
|     console.log(val) | ||||
|     this.menuselectid = val; | ||||
|   } | ||||
|   getbyuseriddata() { | ||||
|     this.usergrpservice.getbyusergrpid(this.usergrpid).subscribe((data) => { | ||||
|       this.alldata = data; | ||||
|       console.log(this.alldata); | ||||
|       if (this.alldata.array?.length === 0) { | ||||
|         this.msg = 'No Data Availabel' | ||||
|       } | ||||
|       for (this.alldata; this.alldata >= 100; this.alldata++) { | ||||
|         this.maindata = this.alldata.menuId === 0 | ||||
|         console.log(this.maindata) | ||||
|       } | ||||
| 
 | ||||
|       // console.log(this.menudata)
 | ||||
|     }, | ||||
|       (error) => { | ||||
|         console.log('Error in adding data...', error); | ||||
|         if (error) { | ||||
|           this.error = "No data Available" | ||||
|         } | ||||
| },(error) => { | ||||
|   console.log('Error in adding data...',+error); | ||||
|     if(error){ | ||||
|       this.toastr.error('Not Deleted Data Getting Some Error'); | ||||
|     } | ||||
| }); | ||||
| } | ||||
| modaldeletemainmenu(row){ | ||||
| this.rowSelected=row; | ||||
| console.log(this.rowSelected) | ||||
| this.modaldelete1=true; | ||||
| } | ||||
| delete1(id,usrgrp){ | ||||
|   this.modaldelete1=false; | ||||
| this.usergrpservice.deletemain(id,usrgrp).subscribe((data)=>{ | ||||
|   console.log(data); | ||||
|   if (data) { | ||||
|     this.toastr.success('Deleted successfully'); | ||||
|       }); | ||||
|   } | ||||
|   modaladd() { | ||||
|     this.modalAdd = true; | ||||
|     this.getdata(); | ||||
|   } | ||||
|   onSubmit() { | ||||
|     this.modalAdd = false; | ||||
|     this.entryForm.value.grpid = this.usergrpid; | ||||
|     this.entryForm.value.gmenuid = this.menuselectid; | ||||
|     console.log(this.entryForm.value); | ||||
|     this.menuservice.create2(this.entryForm.value).subscribe((data) => { | ||||
|       console.log(data); | ||||
|       if (data) { | ||||
|         this.toastr.success('Added successfully'); | ||||
|       } | ||||
|       this.ngOnInit(); | ||||
| 
 | ||||
|     }, | ||||
|       (error) => { | ||||
|         console.log('Error in adding data...', error); | ||||
|         if (error.status == 400) { | ||||
|           this.toastr.error(error.error); | ||||
| 
 | ||||
|         } else if (error) { | ||||
|           this.toastr.error('Not added Data Getting Some Error'); | ||||
|         } | ||||
| },(error) => { | ||||
|   console.log('Error in adding data...',+error); | ||||
|     if(error){ | ||||
|       this.toastr.error('Not Deleted Data Getting Some Error'); | ||||
|     } | ||||
| }); | ||||
| } | ||||
| onUpdate(id:any,usrgrp:any){ | ||||
|   this.modaledit=false; | ||||
|   console.log(id,usrgrp); | ||||
|   this.menuservice.update2(id,usrgrp,this.rowSelected).subscribe((data)=>{ | ||||
|     console.log(data); | ||||
|     if (data) { | ||||
|       this.toastr.success('Updated successfully'); | ||||
|           } | ||||
|   }, (error) => { | ||||
|     console.log('Error in adding data...',+error); | ||||
|       if(error){ | ||||
|         this.ngOnInit(); | ||||
|       }); | ||||
| 
 | ||||
|   } | ||||
|   modalEdit(row) { | ||||
|     this.rowSelected = row; | ||||
|     console.log(this.rowSelected); | ||||
|     this.modaledit = true; | ||||
|   } | ||||
|   modalDelete(row) { | ||||
|     this.rowSelected = row; | ||||
|     console.log(this.rowSelected) | ||||
|     this.modaldelete = true; | ||||
|   } | ||||
|   delete(id, usrgrp) { | ||||
|     this.modaldelete = false; | ||||
|     this.usergrpservice.delete(id, usrgrp).subscribe((data) => { | ||||
|       console.log(data); | ||||
|       if (data) { | ||||
|         this.toastr.success('Deleted successfully'); | ||||
|       } | ||||
|       this.ngOnInit(); | ||||
|     }, (error) => { | ||||
|       console.log('Error in adding data...', error); | ||||
|       if (error) { | ||||
|         this.toastr.error('Not Deleted Data Getting Some Error'); | ||||
|       } | ||||
|       this.ngOnInit(); | ||||
|     }); | ||||
|   } | ||||
|   modaldeletemainmenu(row) { | ||||
|     this.rowSelected = row; | ||||
|     console.log(this.rowSelected) | ||||
|     this.modaldelete1 = true; | ||||
|   } | ||||
|   delete1(id, usrgrp) { | ||||
|     this.modaldelete1 = false; | ||||
|     this.usergrpservice.deletemain(id, usrgrp).subscribe((data) => { | ||||
|       console.log(data); | ||||
|       if (data) { | ||||
|         this.toastr.success('Deleted successfully'); | ||||
|       } | ||||
|       this.ngOnInit(); | ||||
|     }, (error) => { | ||||
|       console.log('Error in adding data...', error); | ||||
|       if (error) { | ||||
|         this.toastr.error('Not Deleted Data Getting Some Error'); | ||||
|       } | ||||
|       this.ngOnInit(); | ||||
|     }); | ||||
|   } | ||||
|   onUpdate(id: any, usrgrp: any) { | ||||
|     this.modaledit = false; | ||||
|     console.log(id, usrgrp); | ||||
|     this.menuservice.update2(id, usrgrp, this.rowSelected).subscribe((data) => { | ||||
|       console.log(data); | ||||
|       if (data) { | ||||
|         this.toastr.success('Updated successfully'); | ||||
|       } | ||||
|       this.ngOnInit(); | ||||
|     }, (error) => { | ||||
|       console.log('Error in adding data...', error); | ||||
|       if (error) { | ||||
|         this.toastr.error('Not Updated Data Getting Some Error'); | ||||
|       } | ||||
|   }); | ||||
| } | ||||
| onChecked(value){ | ||||
|   if(value=="y") | ||||
|   { | ||||
|    this.selected="y" | ||||
|    console.log(this.selected);  // make a call for checked
 | ||||
|       this.ngOnInit(); | ||||
|     }); | ||||
|   } | ||||
|   else | ||||
|   { | ||||
|       this.selected="n"// make a call for unchecked
 | ||||
|   onChecked(value) { | ||||
|     if (value == "y") { | ||||
|       this.selected = "y" | ||||
|       console.log(this.selected);  // make a call for checked
 | ||||
|     } | ||||
|     else { | ||||
|       this.selected = "n"// make a call for unchecked
 | ||||
|     } | ||||
|   } | ||||
|   changedelete(val) { | ||||
|     console.log(val); | ||||
|     val = this.colvalue = val; | ||||
|     console.log(val); | ||||
|   } | ||||
|   data: {}; | ||||
|   Sync(id: any, row) { | ||||
|     this.rowSelected = row; | ||||
|     console.log(id); | ||||
|     if (this.rowSelected.subMenus != 0) { | ||||
|       this.rowSelected.subMenus = [] | ||||
|     } console.log(this.rowSelected); | ||||
|     this.menuservice.sink(id, this.rowSelected).subscribe((data) => { | ||||
|       console.log(data); | ||||
|       if (data) { | ||||
|         this.toastr.success('SYNC successfully'); | ||||
|       } | ||||
|       this.ngOnInit(); | ||||
|     }, (error) => { | ||||
|       console.log(error); | ||||
|       if (error) { | ||||
|         this.toastr.error('Not SYNC Data Getting Some Error'); | ||||
|       } | ||||
|       this.ngOnInit(); | ||||
|     }) | ||||
|   } | ||||
|   toggleCheckbox() { | ||||
|     this.toggle = !this.toggle; | ||||
|     //this.dataService.setDivToggler(this.toggler);
 | ||||
|   } | ||||
| } | ||||
| changedelete(val){ | ||||
|   console.log(val); | ||||
|   val=this.colvalue=val; | ||||
|  console.log(val); | ||||
| } | ||||
| data:{}; | ||||
| Sync(id:any,row){ | ||||
|   this.rowSelected = row; | ||||
|   console.log(id); | ||||
| if(this.rowSelected.subMenus!=0){ | ||||
| this.rowSelected.subMenus=[] | ||||
| }console.log(this.rowSelected); | ||||
| this.menuservice.sink(id,this.rowSelected).subscribe((data)=>{ | ||||
| console.log(data); | ||||
| if (data) { | ||||
|   this.toastr.success('SYNC successfully'); | ||||
|               } | ||||
| },(error) => { console.log(error); | ||||
|   if(error){ | ||||
|     this.toastr.error('Not SYNC Data Getting Some Error'); | ||||
|   } }) | ||||
| } | ||||
| toggleCheckbox() { | ||||
|  this.toggle = !this.toggle; | ||||
|   //this.dataService.setDivToggler(this.toggler);
 | ||||
| } | ||||
| } | ||||
|  | ||||
| @ -11,106 +11,111 @@ import { AccesstypeService } from 'src/app/services/admin/accesstype.service'; | ||||
| export class ModulesComponent implements OnInit { | ||||
|   loading = false; | ||||
|   selected: any[] = []; | ||||
|   rowSelected :any= {}; | ||||
|   modaldelete=false; | ||||
|   modalAdd= false; | ||||
|   modaledit=false; | ||||
|   rowSelected: any = {}; | ||||
|   modaldelete = false; | ||||
|   modalAdd = false; | ||||
|   modaledit = false; | ||||
|   error; | ||||
|   data; | ||||
|   submitted=false; | ||||
|   submitted = false; | ||||
|   public entryForm: FormGroup; | ||||
|   constructor(private _fb: FormBuilder,private accesstype:AccesstypeService, | ||||
|     private toastr:ToastrService,) { } | ||||
|   constructor(private _fb: FormBuilder, private accesstype: AccesstypeService, | ||||
|     private toastr: ToastrService,) { } | ||||
| 
 | ||||
|   ngOnInit(): void { | ||||
|     this.entryForm = this._fb.group({ | ||||
|       modules:['',[Validators.required]], | ||||
|       description:['',[Validators.required]] , | ||||
|       access_exclusive:['',[Validators.required]], | ||||
|        }); | ||||
|        this.getdata(); | ||||
|       modules: ['', [Validators.required]], | ||||
|       description: ['', [Validators.required]], | ||||
|       access_exclusive: ['', [Validators.required]], | ||||
|     }); | ||||
|     this.getdata(); | ||||
|   } | ||||
|   getdata(){ | ||||
|   getdata() { | ||||
|     this.accesstype.getAll1().subscribe(resp => { | ||||
|       this.data = resp; | ||||
|       console.log('menus: ', this.data); | ||||
|       if(this.data.length==0){ | ||||
|         this.error="No data Available"; | ||||
|       if (this.data.length == 0) { | ||||
|         this.error = "No data Available"; | ||||
|         console.log(this.error) | ||||
|       } | ||||
|   },(error) => { | ||||
|     console.log(error); | ||||
|     if(error){ | ||||
|      this.error="Server Error"; | ||||
|    } | ||||
|   }) | ||||
|     }, (error) => { | ||||
|       console.log(error); | ||||
|       if (error) { | ||||
|         this.error = "Server Error"; | ||||
|       } | ||||
|     }) | ||||
|   } | ||||
|   goToAdd(){ | ||||
|     this.modalAdd=true; | ||||
|   goToAdd() { | ||||
|     this.modalAdd = true; | ||||
|   } | ||||
|   onSubmit(){ | ||||
|   onSubmit() { | ||||
|     console.log(this.entryForm.value); | ||||
|     this.submitted=true; | ||||
|     this.submitted = true; | ||||
|     if (this.entryForm.invalid) { | ||||
|       return; | ||||
|     } | ||||
|     this.accesstype.create1(this.entryForm.value).subscribe((data)=>{ | ||||
|     this.accesstype.create1(this.entryForm.value).subscribe((data) => { | ||||
|       console.log(data); | ||||
|       if (data) { | ||||
|         this.toastr.success('Added successfully'); | ||||
|             } | ||||
|       } | ||||
|       this.ngOnInit(); | ||||
|     }, | ||||
|     (error) => { | ||||
|     console.log('Error in adding data...',+error); | ||||
|     if(error){ | ||||
|       this.toastr.error('Not added Data Getting Some Error'); | ||||
|     } | ||||
|       (error) => { | ||||
|         console.log('Error in adding data...', error); | ||||
|         if (error) { | ||||
|           this.toastr.error('Not added Data Getting Some Error'); | ||||
|         } | ||||
|         this.ngOnInit(); | ||||
| 
 | ||||
|     }); | ||||
|     this.modalAdd=false; | ||||
|       }); | ||||
|     this.modalAdd = false; | ||||
|   } | ||||
|   goToEdit(row) { | ||||
|     this.rowSelected = row; | ||||
|     console.log(row) | ||||
|     this.modaledit=true; | ||||
|     this.modaledit = true; | ||||
|     //this.router.navigate(["../edit/" + id], { relativeTo: this.route });
 | ||||
|   } | ||||
|   onDelete(row) { | ||||
|     this.rowSelected = row; | ||||
|      this.modaldelete=true; | ||||
|     this.modaldelete = true; | ||||
|   } | ||||
| 
 | ||||
|   delete(id) | ||||
|   { | ||||
|   delete(id) { | ||||
|     this.modaldelete = false; | ||||
|     console.log("in delete  "+id); | ||||
|     this.accesstype.delete1(id).subscribe((data)=>{ | ||||
|     console.log("in delete  " + id); | ||||
|     this.accesstype.delete1(id).subscribe((data) => { | ||||
|       console.log(data); | ||||
|       if (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'); | ||||
|       } | ||||
|     }); | ||||
|       this.ngOnInit(); | ||||
|     }, | ||||
|       (error) => { | ||||
|         console.log('Error in adding data...', error); | ||||
|         if (error) { | ||||
|           this.toastr.error('Not Deleted Data Getting Some Error'); | ||||
|         } | ||||
|         this.ngOnInit(); | ||||
|       }); | ||||
| 
 | ||||
|   } | ||||
|   onUpdate(id){ | ||||
|     this.modaledit=false; | ||||
| this.accesstype.update1(id,this.rowSelected).subscribe((data)=>{ | ||||
| console.log(data); | ||||
| if (data) { | ||||
|   this.toastr.success('Updated successfully'); | ||||
|   onUpdate(id) { | ||||
|     this.modaledit = false; | ||||
|     this.accesstype.update1(id, this.rowSelected).subscribe((data) => { | ||||
|       console.log(data); | ||||
|       if (data) { | ||||
|         this.toastr.success('Updated successfully'); | ||||
|       } | ||||
| }, | ||||
| (error) => { | ||||
| console.log('Error in adding data...',+error); | ||||
| if(error){ | ||||
|   this.toastr.error('Not updated Data Getting Some Error'); | ||||
| } | ||||
| }); | ||||
|       this.ngOnInit(); | ||||
|     }, | ||||
|       (error) => { | ||||
|         console.log('Error in adding data...', error); | ||||
|         if (error) { | ||||
|           this.toastr.error('Not updated Data Getting Some Error'); | ||||
|         } | ||||
|         this.ngOnInit(); | ||||
|       }); | ||||
|   } | ||||
| } | ||||
|  | ||||
| @ -19,11 +19,11 @@ | ||||
| 
 | ||||
|         <div class="clr-col-4" style="text-align: right;"> | ||||
|             <button class="btn btn-outline" (click)="onExport()"> | ||||
|               <clr-icon shape="export"></clr-icon> {{ 'EXPORT' | translate }} | ||||
|           </button> | ||||
|                 <clr-icon shape="export"></clr-icon> {{ 'EXPORT' | translate }} | ||||
|             </button> | ||||
|             <button id="add" class="btn btn-primary" (click)="goToAdd()"> | ||||
|               <clr-icon shape="plus"></clr-icon>{{ 'ADD' | translate }} | ||||
|           </button> | ||||
|                 <clr-icon shape="plus"></clr-icon>{{ 'ADD' | translate }} | ||||
|             </button> | ||||
|         </div> | ||||
|     </div> | ||||
| 
 | ||||
| @ -74,8 +74,10 @@ | ||||
|             <clr-dg-cell>{{user.sequence_size}}</clr-dg-cell> | ||||
|             <!-- <clr-dg-cell>{{user.date_format}}</clr-dg-cell> --> | ||||
|             <clr-dg-action-overflow> | ||||
|                 <button class="action-item" (click)="goToEdit(user)">  {{ 'EDIT' | translate }} <clr-icon shape="edit" class="is-error"></clr-icon></button> | ||||
|                 <button class="action-item" (click)="onDelete(user)">  {{ 'DELETE' | translate }}<clr-icon shape="trash" class="is-error"></clr-icon></button> | ||||
|                 <button class="action-item" (click)="goToEdit(user)"> {{ 'EDIT' | translate }} <clr-icon shape="edit" | ||||
|                         class="is-error"></clr-icon></button> | ||||
|                 <button class="action-item" (click)="onDelete(user)"> {{ 'DELETE' | translate }}<clr-icon shape="trash" | ||||
|                         class="is-error"></clr-icon></button> | ||||
|             </clr-dg-action-overflow> | ||||
| 
 | ||||
| 
 | ||||
| @ -83,7 +85,8 @@ | ||||
| 
 | ||||
|         <clr-dg-footer> | ||||
|             <clr-dg-pagination #pagination [clrDgPageSize]="10"> | ||||
|                 <clr-dg-page-size [clrPageSizeOptions]="[10,20,50,100]">{{ 'USERS_PER_PAGE' | translate }}</clr-dg-page-size> | ||||
|                 <clr-dg-page-size [clrPageSizeOptions]="[10,20,50,100]">{{ 'USERS_PER_PAGE' | translate | ||||
|                     }}</clr-dg-page-size> | ||||
|                 {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} of {{pagination.totalItems}} users | ||||
|             </clr-dg-pagination> | ||||
|         </clr-dg-footer> | ||||
| @ -110,11 +113,11 @@ | ||||
|             <div class="clr-row"> | ||||
|                 <div class="clr-col-sm-12"> | ||||
|                     <label for="name">Name<span class="required-field">*</span></label> | ||||
|                     <input type="text" class="clr-input" name="sequence_name" formControlName="sequence_name" > | ||||
|                     <input type="text" class="clr-input" name="sequence_name" formControlName="sequence_name"> | ||||
|                 </div> | ||||
|                 <div class="clr-col-sm-12"> | ||||
|                     <label for="name">Sequence Code</label> | ||||
|                     <input type="text" class="clr-input" name="sequence_code" formControlName="sequence_code" > | ||||
|                     <input type="text" class="clr-input" name="sequence_code" formControlName="sequence_code"> | ||||
|                 </div> | ||||
|                 <!-- <div class="clr-col-sm-12"> | ||||
|                     <label for="name">Implementation</label> | ||||
| @ -131,7 +134,7 @@ | ||||
|                     <label for="name">Active</label> | ||||
|                     <input type="checkbox" formControlName="active" name="active" clrCheckbox> | ||||
|                 </div> --> | ||||
|                  | ||||
| 
 | ||||
|                 <div class="clr-col-sm-12"> | ||||
|                     <label for="name">Prefix<span class="required-field">*</span></label> | ||||
|                     <input type="text" class="clr-input" formControlName="prefix" name="prefix"> | ||||
| @ -197,7 +200,7 @@ | ||||
|                     <label for="name">Active</label> | ||||
|                     <input type="checkbox" name="active" name="menuId" clrCheckbox [(ngModel)]="rowSelected.active"> | ||||
|                 </div> --> | ||||
|               | ||||
| 
 | ||||
|                 <div class="clr-col-sm-12"> | ||||
|                     <label for="name">Prefix<span class="required-field">*</span></label> | ||||
|                     <input type="text" class="clr-input" name="prefix" [(ngModel)]="rowSelected.prefix"> | ||||
| @ -216,11 +219,13 @@ | ||||
|                 </div> | ||||
|                 <div class="clr-col-sm-12"> | ||||
|                     <label for="tags">Current No</label> | ||||
|                     <input type="number" class="clr-input" name="current_no" [(ngModel)]="rowSelected.current_no" readonly> | ||||
|                     <input type="number" class="clr-input" name="current_no" [(ngModel)]="rowSelected.current_no" | ||||
|                         readonly> | ||||
|                 </div> | ||||
|                 <div class="clr-col-sm-12"> | ||||
|                     <label for="tags">Demonstration</label> | ||||
|                     <input type="text" class="clr-input" name="demonstration" [(ngModel)]="rowSelected.demonstration" readonly> | ||||
|                     <input type="text" class="clr-input" name="demonstration" [(ngModel)]="rowSelected.demonstration" | ||||
|                         readonly> | ||||
|                 </div> | ||||
|                 <div class="clr-col-sm-12"> | ||||
|                     <label for="tags">Sequence Size</label> | ||||
|  | ||||
| @ -15,65 +15,67 @@ export class SequencegenaratorComponent implements OnInit { | ||||
|   loading = false; | ||||
|   selected: any[] = []; | ||||
|   workflow_data; | ||||
|   rowSelected :any= {}; | ||||
|   modaldelete=false; | ||||
|   rowSelected: any = {}; | ||||
|   modaldelete = false; | ||||
|   error; | ||||
|   alldata; | ||||
|   modaladd=false; | ||||
|   modaledit=false; | ||||
|   alldata = []; | ||||
|   modaladd = false; | ||||
|   modaledit = false; | ||||
|   submitted = false; | ||||
| 
 | ||||
|   public entryForm: FormGroup; | ||||
|   constructor(private seqservice:SequenceService,private router: Router, private toastr: ToastrService,private _fb: FormBuilder, | ||||
|     private route: ActivatedRoute,private excel: ExcelService) { } | ||||
|   constructor(private seqservice: SequenceService, private router: Router, private toastr: ToastrService, private _fb: FormBuilder, | ||||
|     private route: ActivatedRoute, private excel: ExcelService) { } | ||||
| 
 | ||||
|   ngOnInit(): void { | ||||
|     this.getall(); | ||||
|     this.entryForm = this._fb.group({ | ||||
|       prefix:[null], | ||||
| sequence_size:[null], | ||||
| suffix:[null], | ||||
| starting_no:[null], | ||||
| seperator:[null], | ||||
|       prefix: [null], | ||||
|       sequence_size: [null], | ||||
|       suffix: [null], | ||||
|       starting_no: [null], | ||||
|       seperator: [null], | ||||
| 
 | ||||
| sequence_name:[null], | ||||
| sequence_code:[null], | ||||
| demonstration:[null], | ||||
|       sequence_name: [null], | ||||
|       sequence_code: [null], | ||||
|       demonstration: [null], | ||||
| 
 | ||||
| current_no:[null] | ||||
|        }); | ||||
|       current_no: [null] | ||||
|     }); | ||||
|   } | ||||
|   getall(){ | ||||
|     this.seqservice.getAll().subscribe((data)=>{ | ||||
|   getall() { | ||||
|     this.seqservice.getAll().subscribe((data) => { | ||||
|       console.log(data); | ||||
|       this.alldata=data; | ||||
|       if(this.alldata.lenght==0){ | ||||
|         this.error="No data" | ||||
|       this.alldata = data; | ||||
| 
 | ||||
|       if (this.alldata.length == 0) { | ||||
|         console.log('zero data '); | ||||
|         this.error = "No data Available!" | ||||
|       } | ||||
|     },(error) => { | ||||
|     }, (error) => { | ||||
|       console.log(error); | ||||
|       if(error){ | ||||
|        this.error="No data Available OR server Error"; | ||||
|      } | ||||
|       if (error) { | ||||
|         this.error = "No data Available OR server Error"; | ||||
|       } | ||||
| 
 | ||||
|     }) | ||||
|   } | ||||
|   // onSubmit(){
 | ||||
|     // console.log(this.entryForm.value);
 | ||||
|     // this.seqservice.create(this.entryForm.value).subscribe((data)=>{
 | ||||
|     //   console.log(data);
 | ||||
|     //   if (data) {
 | ||||
|     //     this.toastr.success('Added successfully');
 | ||||
|     //         }
 | ||||
|     // },
 | ||||
|     // (error) => {
 | ||||
|     // console.log('Error in adding data...',+error);
 | ||||
|     // if(error){
 | ||||
|     //   this.toastr.error('Not added Data');
 | ||||
|     // }
 | ||||
|   // console.log(this.entryForm.value);
 | ||||
|   // this.seqservice.create(this.entryForm.value).subscribe((data)=>{
 | ||||
|   //   console.log(data);
 | ||||
|   //   if (data) {
 | ||||
|   //     this.toastr.success('Added successfully');
 | ||||
|   //         }
 | ||||
|   // },
 | ||||
|   // (error) => {
 | ||||
|   // console.log('Error in adding data...',+error);
 | ||||
|   // if(error){
 | ||||
|   //   this.toastr.error('Not added Data');
 | ||||
|   // }
 | ||||
| 
 | ||||
|     // });
 | ||||
|     // this.modaladd=false;
 | ||||
|   // });
 | ||||
|   // this.modaladd=false;
 | ||||
|   // }
 | ||||
| 
 | ||||
| 
 | ||||
| @ -93,20 +95,20 @@ current_no:[null] | ||||
|     this.seqservice.create(this.entryForm.value).subscribe( | ||||
|       (data) => { | ||||
|         console.log(data); | ||||
|         if (data || data.status >=200 && data.status <=299) { | ||||
|         if (data || data.status >= 200 && data.status <= 299) { | ||||
|           this.toastr.success("Added Succesfully"); | ||||
|           this.ngOnInit(); | ||||
|         } | ||||
|       },(error) => { | ||||
|         if(error.status >=200 && error.status <=299){ | ||||
|       }, (error) => { | ||||
|         if (error.status >= 200 && error.status <= 299) { | ||||
|           this.toastr.success("Added Succesfully"); | ||||
|           this.ngOnInit(); | ||||
|         } | ||||
|         if(error.status >=400 && error.status <=499){ | ||||
|         if (error.status >= 400 && error.status <= 499) { | ||||
|           this.toastr.error("Not Added"); | ||||
|           this.ngOnInit(); | ||||
|         } | ||||
|         if(error.status >=500 && error.status <=599){ | ||||
|         if (error.status >= 500 && error.status <= 599) { | ||||
|           this.toastr.error("Server Error"); | ||||
|           this.ngOnInit(); | ||||
|         } | ||||
| @ -114,8 +116,8 @@ current_no:[null] | ||||
|   } | ||||
| 
 | ||||
| 
 | ||||
|   goToAdd(){ | ||||
|     this.modaladd=true; | ||||
|   goToAdd() { | ||||
|     this.modaladd = true; | ||||
| 
 | ||||
|   } | ||||
| 
 | ||||
| @ -127,63 +129,62 @@ current_no:[null] | ||||
|   goToEdit(row) { | ||||
|     this.rowSelected = row; | ||||
|     console.log(row) | ||||
|     this.modaledit=true; | ||||
|     this.modaledit = true; | ||||
|   } | ||||
|   onDelete(row) { | ||||
|     this.rowSelected = row; | ||||
|     this.modaldelete=true; | ||||
|     this.modaldelete = true; | ||||
|   } | ||||
| 
 | ||||
|   delete(id) | ||||
|   { | ||||
|   delete(id) { | ||||
|     this.modaldelete = false; | ||||
|     console.log("in delete  "+id); | ||||
|     this.seqservice.delete(id).subscribe((data)=>{ | ||||
|     console.log("in delete  " + id); | ||||
|     this.seqservice.delete(id).subscribe((data) => { | ||||
|       console.log(data); | ||||
|       if (data == null || data.status >=200 && data.status <=299) { | ||||
|       if (data == null || data.status >= 200 && data.status <= 299) { | ||||
|         this.toastr.success('Deleted successfully'); | ||||
|         this.ngOnInit(); | ||||
|       } | ||||
|   }, | ||||
|   (error) => { | ||||
|     console.log(error); | ||||
|     if(error.status >=200 && error.status <=299){ | ||||
|       this.toastr.success('Deleted successfully'); | ||||
|       this.ngOnInit(); | ||||
|     } | ||||
|     if(error.status >=400 && error.status <=499){ | ||||
|       this.toastr.error('Not Deleted Data Getting Some Error'); | ||||
|       this.ngOnInit(); | ||||
|     } | ||||
|     if(error.status >=500 && error.status <=599){ | ||||
|       this.toastr.error('Server Error'); | ||||
|       this.ngOnInit(); | ||||
|     } | ||||
|   }); | ||||
|     }, | ||||
|       (error) => { | ||||
|         console.log(error); | ||||
|         if (error.status >= 200 && error.status <= 299) { | ||||
|           this.toastr.success('Deleted successfully'); | ||||
|           this.ngOnInit(); | ||||
|         } | ||||
|         if (error.status >= 400 && error.status <= 499) { | ||||
|           this.toastr.error('Not Deleted Data Getting Some Error'); | ||||
|           this.ngOnInit(); | ||||
|         } | ||||
|         if (error.status >= 500 && error.status <= 599) { | ||||
|           this.toastr.error('Server Error'); | ||||
|           this.ngOnInit(); | ||||
|         } | ||||
|       }); | ||||
| 
 | ||||
|   } | ||||
|   onUpdate(id){ | ||||
|     this.modaledit=false; | ||||
| this.seqservice.update(id,this.rowSelected).subscribe((data)=>{ | ||||
| console.log(data); | ||||
| if (data || data.status >=200 && data.status <=299) { | ||||
|   this.toastr.success("Update Succesfully"); | ||||
|   this.ngOnInit(); | ||||
| } | ||||
| },(error: HttpErrorResponse) => { | ||||
| console.log(error?.message); | ||||
| if(error.status >=200 && error.status <=299){ | ||||
|   this.toastr.success("Update Succesfully"); | ||||
|   this.ngOnInit(); | ||||
| } | ||||
| if(error.status >=400 && error.status <=499){ | ||||
|   this.toastr.error("Not Update"); | ||||
|   this.ngOnInit(); | ||||
| } | ||||
| if(error.status >=500 && error.status <=599){ | ||||
|   this.toastr.error("Server Error"); | ||||
|   this.ngOnInit(); | ||||
| } | ||||
| }); | ||||
|   onUpdate(id) { | ||||
|     this.modaledit = false; | ||||
|     this.seqservice.update(id, this.rowSelected).subscribe((data) => { | ||||
|       console.log(data); | ||||
|       if (data || data.status >= 200 && data.status <= 299) { | ||||
|         this.toastr.success("Update Succesfully"); | ||||
|         this.ngOnInit(); | ||||
|       } | ||||
|     }, (error: HttpErrorResponse) => { | ||||
|       console.log(error?.message); | ||||
|       if (error.status >= 200 && error.status <= 299) { | ||||
|         this.toastr.success("Update Succesfully"); | ||||
|         this.ngOnInit(); | ||||
|       } | ||||
|       if (error.status >= 400 && error.status <= 499) { | ||||
|         this.toastr.error("Not Update"); | ||||
|         this.ngOnInit(); | ||||
|       } | ||||
|       if (error.status >= 500 && error.status <= 599) { | ||||
|         this.toastr.error("Server Error"); | ||||
|         this.ngOnInit(); | ||||
|       } | ||||
|     }); | ||||
|   } | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user