Skip to content

Instantly share code, notes, and snippets.

Zhen Deng ZhenDeng

Block or report user

Report or block ZhenDeng

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Loading screen
1. LoadingScreenComponent
import { Subscription } from 'rxjs';
import { Component, OnInit, OnDestroy, Output, EventEmitter, Input } from '@angular/core';
import { LoadingScreenService } from '../../services/loading-screen.service';
import { debounceTime } from 'rxjs/operators';
@Component({
selector: 'loading-screen',
View Website loading remind
1. add html below in <app-root></app-root> or in index.html
<app-root>
<div id="pre-bootstrap">
<div class="messaging">
<h1>
Website is Loading
</h1>
<div class="app-loader">
<div class="app-loader-inner">
View encrypt password
string decryptPassword = MD5DESEncryption.Decrypt(model.Password, true);
private static string securityKey = "Dicker183654729Data";
public static string Encrypt(string toEncrypt, bool useHashing)
{
string retVal = string.Empty;
try
{
byte[] keyArray;
View use urlHelper in .net core
in startup.cs
services.AddSingleton<IActionContextAccessor, ActionContextAccessor>();
services.AddScoped<IUrlHelper>(x => {
var actionContext = x.GetRequiredService<IActionContextAccessor>().ActionContext;
var factory = x.GetRequiredService<IUrlHelperFactory>();
return factory.GetUrlHelper(actionContext);
});
then could inject IUrlHelper
View Get value from appsettings.json
private readonly IConfiguration _configuration;
public Tools(IConfiguration configuration)
{
_configuration = configuration;
}
public string GetConfigKey(string categoryName, string keyName)
{
string keyValue = null;
View angular powered bootstrap tooltip
1. top arrow fix
:host ::ng-deep .arrow::before {
border-top-color: #C0054D;
border-bottom-color: white !important;
}
:host ::ng-deep .tooltip-inner {
background: #C0054D;
width: 200px;
View .net core
1. Go to appsettings.json file and add the secret key for the JWT encryption.
"AppSettings": {
"Secret": "HHPM0JEOMLGYXYU5YS32"
},
2. Create a class as “AppSettings.cs” to access the AppSetting values trough a class.
namespace NetCoreWebAPI.Helpers
View reactive form with FormGroupName
HTML:
<div [formGroup]="addressFormGroup">
<div formGroupName="addressGroup">
<mat-form-field [floatLabel]="'always'">
<input matInput formControlName="companyName" placeholder="Company Name" (blur)="isNotValidField('addressGroup.companyName', account_validation_messages.companyName)"/>
</mat-form-field>
<mat-checkbox [(ngModel)]="collectTheOrder" formControlName="collectTheOrder" style="display: block;margin-left: 18px;">
I will collect this order
</mat-checkbox>
View export data to excel
using (ExcelPackage pck = new ExcelPackage())
{
TenantsDetailsSheet(pck, tenantList.Output);
}
private ExcelPackage TenantsDetailsSheet(ExcelPackage pck, List<GetCSPTenant.Out> annuityList)
{
var input = new GetCSPSubscription.In();
input.in_status = "A";
input.in_update_status = "N";
You can’t perform that action at this time.