latest updates @APR 20, 2022

This commit is contained in:
pritesh 2022-04-20 11:15:19 +05:30 committed by Pranav
parent 90b15f5e00
commit a0bdbc7c55
1657 changed files with 301942 additions and 0 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AccountDetailComponent } from './account-detail.component';
describe('AccountDetailComponent', () => {
let component: AccountDetailComponent;
let fixture: ComponentFixture<AccountDetailComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AccountDetailComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AccountDetailComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,51 @@
<!-- <div class="modal"> -->
<!-- <div class="modal-header"> -->
<h4 md-dialog-title>{{title}}</h4>
<!-- </div> -->
<div md-dialog-content>
<form [formGroup]="planForm">
<div class="form-group row">
<label for="Name" class="col-sm-2 col-form-label">Name</label>
<div class="col-sm-10">
<input formControlName="Name" type="text" class="form-control" id="Name" placeholder="Enter Plan Name">
</div>
</div>
<div class="form-group row">
<label for="Amount" class="col-sm-2 col-form-label">Amount</label>
<div class="col-sm-10">
<input formControlName="Amount" type="number" class="form-control" id="Amount" placeholder="Enter Amount">
</div>
</div>
<div class="form-group row">
<label for="status" class="col-sm-2 col-form-label">Status</label>
<div class="col-sm-10">
<select class="form-control" formControlName="Status">
<option>Active</option>
<option>InActive</option>
</select>
</div>
</div>
<div class="form-group row">
<label for="type" class="col-sm-2 col-form-label">Type</label>
<div class="col-sm-10">
<select class="form-control" formControlName="Duration_days">
<option value=30>Monthly</option>
<option Value=90> Quaterly</option>
<option value=180>Half Yearly</option>
<option value=365>Yearly</option>
<option value=1095>3 Years</option>
</select>
</div>
</div>
</form>
</div>
<md-dialog-actions align="end">
<button md-button md-dialog-close>Cancel</button>
<button *ngIf="data==null" md-button (click)="submit()"> Save</button>
<button *ngIf="data!=null" md-button (click)="editPlan()"> Update</button>
</md-dialog-actions>
<!-- </div> -->

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AddPlanComponent } from './add-plan.component';
describe('AddPlanComponent', () => {
let component: AddPlanComponent;
let fixture: ComponentFixture<AddPlanComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddPlanComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AddPlanComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,72 @@
import { Component, Inject, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { MdDialogRef, MD_DIALOG_DATA } from '@angular/material';
import { ContactService } from '../../contact.service';
@Component({
selector: 'app-add-plan',
templateUrl: './add-plan.component.html',
styleUrls: ['./add-plan.component.scss']
})
export class AddPlanComponent implements OnInit {
planForm:FormGroup;
title="Add New Plan"
useridd;
or
constructor(public dialogRef: MdDialogRef<AddPlanComponent>,
@Inject(MD_DIALOG_DATA) public data: any,private fb:FormBuilder,private contactService:ContactService) { }
ngOnInit() {
this.useridd = JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id;
this.or = JSON.parse(window.atob(window.localStorage.token.split(".")[1]))._orgName;
this.planForm=this.fb.group({
Name:[''],
Status:[''],
Amount:[''],
Duration_days:[''],
SupAdmin:[this.useridd],
Org:[this.or]
})
if(this.data!=null){
this.title="Edit Plan Details";
this.patchPlanForm()
}
}
patchPlanForm(){
this.planForm.patchValue({
Name:this.data.Name,
Status:this.data.Status,
Amount:this.data.Amount,
Duration_days:this.data.Duration_days,
SupAdmin:[this.useridd],
Org:[this.or]
})
}
submit(){
console.log(this.planForm.value);
this.contactService.post('/RechargePlan/add',this.planForm.value).subscribe(res=>{
console.log(res);
this.dialogRef.close("succ")
})
}
editPlan(){
var data={
_id:this.data._id,
Name:this.planForm.value.Name,
Status:this.planForm.value.Status,
Amount:this.planForm.value.Amount,
Duration_days:this.planForm.value.Duration_days,
SupAdmin:this.planForm.value.SupAdmin,
Org:this.planForm.value.Org
}
this.contactService.post('/RechargePlan/edit',data).subscribe(res=>{
console.log(res);
this.dialogRef.close("succ")
})
}
}