This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Toast Component | |
Html: | |
<div class="toast"> | |
<div class="toast-icon"> | |
<i class="far fa-times-circle" *ngIf="data?.type=='Error'"></i> | |
<i class="far fa-check-circle" *ngIf="data?.type=='Success'"></i> | |
<i class="fas fa-exclamation-triangle" *ngIf="data?.type=='Warning'"></i> | |
<i class="fas fa-info-circle" *ngIf="data?.type=='Info'"></i> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ExcelPackage AddWorksheetForCarts(ExcelPackage pck, int cartId, string CartName) | |
{ | |
// Create Headers | |
string[] headerList = { "Cart Name", "Parent Code", "Stock Code", "Item Desc", "RRP (Ex tax)", "RRP (Inc tax)", "Reseller Price(Ex tax)", "Quantity", "Subtotal (Ex tax)" }; | |
// Capture Number Of Columns | |
// We'll Use This Later When Creating Rows | |
int iColCount = headerList.Length; | |
ExcelWorksheet ws = pck.Workbook.Worksheets.Add("Cart Name:" + CartName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { set } from 'lodash'; | |
set(NgbPopover.prototype, '_unregisterListenersFn', function() {}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in HTM: | |
<span #popover="ngbPopover" id="downloadButton" placement="bottom" [ngbPopover]="popContent" | |
triggers="manual" (click)="openPop();" | |
[ngClass]="{'active-icon' : iconCanbeActive, 'default-icon': !iconCanbeActive }"></span> | |
in component: | |
@ViewChild('popover') public popover: NgbPopover; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { HttpInterceptor, HttpRequest, HttpEvent, HttpHandler, HttpParams, HttpParameterCodec } from "@angular/common/http"; | |
import { Injectable } from "@angular/core"; | |
import { Observable } from "rxjs"; | |
@Injectable() | |
export class EncodeHttpParamsInterceptor implements HttpInterceptor { | |
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { | |
const params = new HttpParams({encoder: new CustomEncoder(), fromString: req.params.toString()}); | |
return next.handle(req.clone({params})); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*HTML*/ | |
<button class="close-button" (click)="onNoClick()"> | |
<span aria-hidden="true">×</span> | |
</button> | |
<div mat-dialog-title> | |
<div class="modal-header"> | |
<h6 class="modal-title">Air freight terms</h6> | |
</div> | |
<div class="modal-body"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in component | |
//unsubscribe | |
ngUnsubscribe: Subject<void> = new Subject<void>(); | |
this.adminService.GetUserByAccount(_.toNumber(this.shareService.readCookie("userId"))).takeUntil(this.ngUnsubscribe).subscribe() | |
ngOnDestroy() { | |
this.ngUnsubscribe.next(); | |
this.ngUnsubscribe.complete(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StringBuilder stringBuilder = new StringBuilder(); | |
stringBuilder.Append("<div style='padding: 0; margin: 0; width:100%; height: 100%; background:#fbfaf7;'>"); | |
stringBuilder.Append("<table width='100%' height='100%' align='center' cellspacing='0' cellpadding='0' bgcolor='#fbfaf7'>"); | |
stringBuilder.Append("<tbody>"); | |
stringBuilder.Append("<tr><td style='font:12px/1.5 Arial,Helvetica,sans-serif;color:#454545'> </td></tr>"); | |
stringBuilder.Append("<tr>"); | |
stringBuilder.Append("<td style='color:#343731;'><table width='600px' bgcolor='#ffffff' cellspacing='0' cellpadding='0' align='center' border='0' style='border:1px solid #232323;text-align:center'><tbody><tr><td style='padding:10px;color:#343731'>"); | |
stringBuilder.Append("<h2 style='font-weight:400;text-transform:uppercase'>Trojan Trading Company PTY LTD</h2>"); | |
stringBuilder.Append("</td></tr>"); | |
stringBuilder.Append("<tr style='text-align:left'><td style='font:12px/1.5 Arial,Helvetica,sans-serif;color:#454545'><table width='90%'><tbody>"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. in startup.cs | |
services.AddSingleton<IFileProvider>( | |
new PhysicalFileProvider( | |
Path.Combine(Directory.GetCurrentDirectory(), "wwwroot"))); | |
2. in controller | |
#region Upload Users | |
[HttpPost("UploadUsers"), DisableRequestSizeLimit] |