Commit 6b793e336b7d04918c22b6e03e21eed8ad3d400c

Authored by Harpreet Banwait
1 parent 40e69274

merge latest code gagan

400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.component.ts
... ... @@ -4,7 +4,6 @@ import { ManageDiscountCodeService } from './components/ManageDiscountCode/manag
4 4 import { SubscriptionPriceService } from './components/SubscriptionPrice/subscriptionprice.service';
5 5 import { LicenseService } from './components/LicenseEntity/license.service';
6 6 import { ReportService } from './components/Reports/report.service';
7   -
8 7 @Component({
9 8 selector: 'app-component',
10 9 templateUrl: '../app/app.component.html',
... ...
400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.module.ts
... ... @@ -8,7 +8,7 @@ import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
8 8 import { APP_BASE_HREF } from '@angular/common';
9 9 import { HttpModule } from '@angular/http';
10 10 import { Ng2Bs3ModalModule } from 'ng2-bs3-modal/ng2-bs3-modal';
11   -
  11 +import { CsvService } from "angular2-json2csv";
12 12 //import { ModalModule } from 'ngx-bootstrap/modal';
13 13 import { UpdateUserProfile } from './components/UserEntity/updateuserprofile.component';
14 14 import { ChangeUserPassword } from './components/UserEntity/changeuserpassword.component';
... ... @@ -34,8 +34,6 @@ import { LicenseModestySettings } from './components/LicenseEntity/licensemodest
34 34 import { LicenseModuleSettings } from './components/LicenseEntity/licensemodulesettings.component';
35 35 import { SiteLicenseAccount } from './components/LicenseEntity/sitelicenseaccount.component';
36 36 import { UserGroup } from './components/UserEntity/usergroup.component';
37   -import { PagerComponent } from './shared/Pager/pager.component';
38   -
39 37 import { AppComponent } from './app.component';
40 38 import { AppRoutingModule } from './app.routing.module';
41 39 //import { AuthGuard } from '../app/authguard.service';
... ... @@ -48,6 +46,7 @@ import { BsDatepickerModule, ModalModule } from 'ngx-bootstrap';
48 46 import { BsModalService } from 'ngx-bootstrap/modal';
49 47 import { ContenteditableModelDirective } from './shared/contenteditabledirective';
50 48 import { LoadingService } from './shared/loading.service';
  49 +import { PagerComponent } from './shared/Pager/pager.component';
51 50  
52 51 @NgModule({
53 52 declarations: [
... ... @@ -55,21 +54,19 @@ import { LoadingService } from './shared/loading.service';
55 54 UpdateUserProfile, UsersList,
56 55 ManageDiscountCode, AddUser, UnblockUser,
57 56 AppComponent, ConfirmComponent,
58   - SubscriptionPrice, ManageDiscountCode, ContenteditableModelDirective,
59   - AddLicense, SearchLicense,
  57 + SubscriptionPrice, ManageDiscountCode, ContenteditableModelDirective, AddLicense, SearchLicense,
60 58 UsageReport, CustomerSummaryReport,
61 59 ExpiringSubscriptionReport, SubscriptionReport,
62 60 SubscriptionCancellationReport, NetAdSubscriptionReport,
63 61 SiteLicenseUsageReport, DiscountCodeReport, ImageExportReport,
64 62 EditLicenseBasicSettings, LicenseModestySettings,
65   - LicenseModuleSettings, SiteLicenseAccount, UserGroup,
66   - PagerComponent
  63 + LicenseModuleSettings, SiteLicenseAccount, UserGroup, PagerComponent
67 64 ],
68 65 imports: [
69 66 BrowserModule, AppRoutingModule, HttpClientModule, FormsModule, ReactiveFormsModule, HttpModule, Ng2Bs3ModalModule,
70 67 BsDatepickerModule.forRoot(), ModalModule.forRoot()//ModalModule.forRoot()
71 68 ],
72   - providers: [GlobalService, ConfirmService, BsModalService, LoadingService,
  69 + providers: [GlobalService, ConfirmService, BsModalService, LoadingService, CsvService,
73 70 //AuthService,
74 71 //AuthGuard,
75 72 //{
... ... @@ -77,8 +74,8 @@ import { LoadingService } from './shared/loading.service';
77 74 // useClass: MyInterceptor,
78 75 // multi: true
79 76 //}
80   - //{ provide: APP_BASE_HREF, useValue: '/Admin-UI' }
81   - { provide: APP_BASE_HREF, useValue: '/' }
  77 + { provide: APP_BASE_HREF, useValue: '/Admin-UI' }
  78 + //{ provide: APP_BASE_HREF, useValue: '/' }
82 79  
83 80 ],
84 81 bootstrap: [AppComponent]
... ...
400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.routing.module.ts
... ... @@ -24,7 +24,6 @@ import { LicenseModestySettings } from './components/LicenseEntity/licensemodest
24 24 import { LicenseModuleSettings } from './components/LicenseEntity/licensemodulesettings.component';
25 25 import { SiteLicenseAccount } from './components/LicenseEntity/sitelicenseaccount.component';
26 26 import { UserGroup } from './components/UserEntity/usergroup.component';
27   -
28 27 const appRoutes: Routes = [
29 28 //{ path: '', redirectTo:'updateuserprofile',pathMatch }
30 29 { path: 'updateuserprofile', component: UpdateUserProfile },
... ... @@ -52,7 +51,6 @@ const appRoutes: Routes = [
52 51 { path: 'licensemodulesettings', component: LicenseModuleSettings },
53 52 { path: 'sitelicenseaccount', component: SiteLicenseAccount },
54 53 { path: 'usergroup', component: UserGroup }
55   -
56 54 ];
57 55  
58 56 @NgModule({
... ...
400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/ManageDiscountCode/managediscountcode.component.ts
... ... @@ -27,6 +27,7 @@ insertUpdateDiscountCodeFrm: FormGroup;
27 27 error: any;
28 28 alerts: string;
29 29 alertmsg: string;
  30 +Searchalerts: string;
30 31 modalAlerts: string;
31 32 divClass: string = '';
32 33 topPos: string = '2000px';
... ... @@ -57,6 +58,7 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat
57 58 this.discountCode = new DiscountCode();
58 59 this.alerts = '';
59 60 this.alertmsg = '';
  61 + this.Searchalerts = '';
60 62 this.manageDiscountCodeFrm = this.fb.group({
61 63 searchDiscountCode: [''],
62 64 searchStartDate: [''],
... ... @@ -83,7 +85,7 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat
83 85 DateChange(dateValue: any){
84 86 this.alerts = '';
85 87 this.alertmsg = '';
86   -
  88 + this.Searchalerts = '';
87 89 if(this.manageDiscountCodeFrm.dirty) {
88 90 if(dateValue._datepicker._elementRef.nativeElement.id == 'searchStartDate'){
89 91 if(dateValue._bsValue == null) {
... ... @@ -166,14 +168,21 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat
166 168  
167 169 }
168 170  
169   - public SearchDiscountCodes() {
  171 + public SearchDiscountCodes() {
  172 + debugger;
  173 + this.global.compareTwoDates(this.manageDiscountCodeFrm.controls['searchEndDate'].value, this.manageDiscountCodeFrm.controls['searchStartDate'].value);
  174 + if (this.global.ValidationMsg != '') {
  175 + this.Searchalerts = this.global.ValidationMsg
  176 + }
  177 + if (this.Searchalerts == '') {
170 178 this.manageDiscountCodeService.GetDiscountCodes(
171   - {
172   - discountCode: this.manageDiscountCodeFrm.controls['searchDiscountCode'].value,
173   - startDate: this.datePipe.transform(this.manageDiscountCodeFrm.controls['searchStartDate'].value, 'MM/dd/yyyy'),
174   - endDate: this.datePipe.transform(this.manageDiscountCodeFrm.controls['searchEndDate'].value, 'MM/dd/yyyy'),
175   - })
176   - .subscribe(x => { this.BindFormFields(x) }, error => this.error = error);
  179 + {
  180 + discountCode: this.manageDiscountCodeFrm.controls['searchDiscountCode'].value,
  181 + startDate: this.datePipe.transform(this.manageDiscountCodeFrm.controls['searchStartDate'].value, 'MM/dd/yyyy'),
  182 + endDate: this.datePipe.transform(this.manageDiscountCodeFrm.controls['searchEndDate'].value, 'MM/dd/yyyy'),
  183 + })
  184 + .subscribe(x => { this.BindFormFields(x) }, error => this.error = error);
  185 + }
177 186 }
178 187  
179 188 openModal(template: TemplateRef<any>) {
... ... @@ -219,10 +228,11 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat
219 228 AfterUpdateData(data, template) {
220 229 if (data.Status == "false") {
221 230 //this.alerts = "<span>Discount code update unsuccessfull</span>";
222   - this._confirmService.activate("Discount code update unsuccessfull", "alertMsg");
  231 + this._confirmService.activate("Discount code update unsuccessfull.", "alertMsg");
223 232 } else {
224   - this.modalAlerts = "<p>Discount code updated successfully</p>";
225   - this.modalRef = this.modalService.show(template);
  233 + this._confirmService.activate("Discount code updated successfully.", "alertMsg");
  234 + //this.modalAlerts = "<p>Discount code updated successfully</p>";
  235 + //this.modalRef = this.modalService.show(template);
226 236 }
227 237 }
228 238  
... ...
400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.component.html
1 1 <div class="row">
2 2 <!-- main-heading -->
3 3 <div class="col-sm-12 pageHeading" style="margin-left: 15px;">
4   - <h4 *ngIf="Mode=='Search'"> Subscription Price</h4>
5   - <h4 *ngIf="Mode!='Search'">{{Mode}} Subscription Price</h4>
  4 + <h4>{{Mode}} Subscription Price</h4>
6 5 </div>
7 6 <!-- main-heading -->
8 7  
... ... @@ -68,7 +67,8 @@
68 67 <!--first-table-->
69 68 <div role="tabpanel" class="tab-pane active" id="higher-edu">
70 69 <div class="table-responsive blue">
71   - <table class="table table-condensed table-bordered margin-btm0 table-striped table-hover">
  70 + <!--<table class="table table-condensed table-bordered margin-btm0 table-striped table-hover">-->
  71 + <table id="fixed_hdr2" class="table-hover ">
72 72 <thead>
73 73 <tr>
74 74 <th>Select</th>
... ... @@ -79,19 +79,19 @@
79 79 </tr>
80 80 </thead>
81 81 <tbody>
82   - <tr *ngFor="let item of this.subscriptionPriceFrm.controls['subscriptionPrices'].value; let i = index">
83   - <td>
84   - <input type="hidden" [(contenteditableModel)]="item.Id">
85   - <input type="hidden" [(contenteditableModel)]="item.EditionId">
86   - <input type="checkbox" (change)="onChange(i, item.Id, $event.target.checked)">
87   - </td>
88   - <td contenteditable="true" [(contenteditableModel)]="item.Title">{{item.Title}}</td>
89   - <td contenteditable="true" [(contenteditableModel)]="item.Duration">{{item.Duration}}</td>
90   - <td contenteditable="true" [(contenteditableModel)]="item.Price">{{item.Price | number : '1.2'}}</td>
91   - <td>
92   - <input type="checkbox" [(checked)]="item.IsActive" [(contenteditableModel)]="item.IsActive">
93   - </td>
94   - </tr>
  82 + <tr *ngFor="let item of this.subscriptionPriceFrm.controls['subscriptionPrices'].value; let i = index">
  83 + <td>
  84 + <input type="hidden" [(contenteditableModel)]="item.Id">
  85 + <input type="hidden" [(contenteditableModel)]="item.EditionId">
  86 + <input type="checkbox" (change)="onChange(i, item.Id, $event.target.checked)">
  87 + </td>
  88 + <td contenteditable="true" [(contenteditableModel)]="item.Title">{{item.Title}}</td>
  89 + <td contenteditable="true" [(contenteditableModel)]="item.Duration">{{item.Duration}}</td>
  90 + <td contenteditable="true" [(contenteditableModel)]="item.Price">{{item.Price | number : '1.2'}}</td>
  91 + <td>
  92 + <input type="checkbox" [(checked)]="item.IsActive" [(contenteditableModel)]="item.IsActive">
  93 + </td>
  94 + </tr>
95 95 </tbody>
96 96 </table>
97 97 </div>
... ... @@ -103,6 +103,7 @@
103 103 <button class="btn btn-primary btn-sm" type="button" (click)="AddSubscriptionPrice()"><i class="fa fa-plus-circle"></i> Add</button>
104 104 <button class="btn btn-primary btn-sm" type="button" (click)="openModal(template)"><i class="fa fa-trash"></i> Delete</button>
105 105 <button class="btn btn-primary btn-sm" type="submit" [disabled]="this.subscriptionPriceFrm.controls['subscriptionPrices'].value.length == 0"><i class="fa fa-check"></i> Apply</button>
  106 + <button class="btn btn-primary btn-sm" (click)="redirect()"><i class="fa fa-close"></i> Cancel</button>
106 107 </div>
107 108 </div>
108 109  
... ... @@ -112,7 +113,7 @@
112 113 </div>
113 114 </div>
114 115 </form>
115   - <div style="position: absolute; z-index: 100; width: 80%" [style.top]="topPos" [style.visibility]="(Mode=='Add') ? 'visible' : 'hidden'" class="well">
  116 + <div style="position: absolute; z-index: 100; width: 80%" [style.top]="topPos" [style.display]="(Mode=='Add') ? 'block' : 'none'" class="well">
116 117 <div class="row">
117 118 <div class="col-sm-12">
118 119 <div class="panel-body">
... ... @@ -230,4 +231,4 @@
230 231 </div>
231 232 </div>
232 233 <!-- container -->
233   -</div>
234 234 \ No newline at end of file
  235 +</div>
... ...
400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.component.ts
... ... @@ -14,7 +14,7 @@ import { ConfirmService } from &#39;../../Shared/Confirm/confirm.service&#39;;
14 14 //import { Global } from '../../Shared/global';
15 15 //import { DBOperation } from 'S';
16 16 //import { Observable } from 'rxjs/Observable';
17   -
  17 +declare var $: any;
18 18 @Component({
19 19 templateUrl: './subscriptionprice.component.html'
20 20 })
... ... @@ -36,7 +36,8 @@ selectedEditionId: number = 1;
36 36 divClass: string = '';
37 37 modalRef: BsModalRef;
38 38  
39   -constructor(private subscriptionPriceService: SubscriptionPriceService, private router: Router, private _confirmService: ConfirmService, private fb: FormBuilder, private modalService: BsModalService) { }
  39 + constructor(private subscriptionPriceService: SubscriptionPriceService, private router: Router,
  40 + private _confirmService: ConfirmService, private fb: FormBuilder, private modalService: BsModalService) { }
40 41  
41 42 ngOnInit(): void {
42 43 this.divClass = 'col-sm-12';
... ... @@ -54,6 +55,39 @@ constructor(private subscriptionPriceService: SubscriptionPriceService, private
54 55 isActive: ['false']
55 56 });
56 57 this.SearchSubscriptionPrices(this.selectedEditionId);
  58 + $('#fixed_hdr2').fxdHdrCol({
  59 + fixedCols: 0,
  60 + width: "80%",
  61 + height: 300,
  62 + colModal: [
  63 + { width: 180, align: 'center' },
  64 + { width: 230, align: 'center' },
  65 + { width: 150, align: 'Center' },
  66 + { width: 150, align: 'Center' },
  67 + { width: 350, align: 'Center' },
  68 + { width: 200, align: 'Center' },
  69 + { width: 130, align: 'Center' },
  70 + { width: 120, align: 'center' },
  71 + { width: 280, align: 'Center' },
  72 + { width: 180, align: 'center' },
  73 + { width: 200, align: 'center' },
  74 + { width: 170, align: 'center' },
  75 + { width: 80, align: 'center' },
  76 + { width: 150, align: 'center' },
  77 + { width: 150, align: 'center' },
  78 + { width: 180, align: 'Center' },
  79 + { width: 400, align: 'Center' },
  80 + { width: 150, align: 'center' },
  81 + { width: 110, align: 'center' },
  82 + ],
  83 + sort: true
  84 + });
  85 + document.getElementById("fixed_table_rc").remove();
  86 + var testScript = document.createElement("script");
  87 + testScript.setAttribute("id", "fixed_table_rc");
  88 + testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js");
  89 + testScript.setAttribute("type", "text/javascript");
  90 + document.body.appendChild(testScript);
57 91 }
58 92  
59 93 public SearchSubscriptionPrices(searchEditionId: number) {
... ... @@ -184,5 +218,8 @@ constructor(private subscriptionPriceService: SubscriptionPriceService, private
184 218 this.alerts = '';
185 219 this.SearchSubscriptionPrices(this.selectedEditionId);
186 220 }
  221 + redirect() {
  222 + this.router.navigate(['/']);
  223 + }
187 224  
188 225 }
... ...