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
export class PaymentRequestPageViewModel extends ViewModelBase { | |
repository = repositoryFactory.get(); | |
paymentRequest: PaymentRequest; | |
shippingOptions: PaymentShippingOption[]; | |
totalPrice: number; | |
constructor() { | |
super(); | |
this.initPayment(); | |
} |
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 class DataService | |
{ | |
private readonly TelemetryClient _telemetryClient; | |
private readonly IDictionary<string, int> _dic; | |
public DataService() | |
{ | |
_telemetryClient = new TelemetryClient(); | |
_dic = new Dictionary<string, int>(); |
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
[System.Web.Mvc.HttpPost] | |
public ActionResult Register([FromBody]RegisterModel model) | |
{ | |
var dic = new Dictionary<string, string>(); | |
dic.Add("email", model.Email); | |
dic.Add("name", model.Name); | |
dic.Add("category", Session["selectedCategory"]?.ToString()); | |
_telemetryClient.TrackEvent("Registration form entered event", dic); |
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 ActionResult Index() | |
{ | |
var arr = new string[2]; | |
try | |
{ | |
arr[0] = "value 1"; | |
arr[1] = "value 2"; | |
arr[2] = "value 3"; | |
var result = arr[3]; |
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
<TelemetryModules> | |
<Add Type="Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule, Microsoft.AI.DependencyCollector" /> | |
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector"></Add> | |
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryModule, Microsoft.AI.PerfCounterCollector" /> | |
<Add Type="Microsoft.ApplicationInsights.WindowsServer.DeveloperModeWithDebuggerAttachedTelemetryModule, Microsoft.AI.WindowsServer" /> | |
<Add Type="Microsoft.ApplicationInsights.WindowsServer.UnhandledExceptionTelemetryModule, Microsoft.AI.WindowsServer" /> | |
<Add Type="Microsoft.ApplicationInsights.WindowsServer.UnobservedExceptionTelemetryModule, Microsoft.AI.WindowsServer" /> | |
<Add Type="Microsoft.ApplicationInsights.Web.RequestTrackingTelemetryModule, Microsoft.AI.Web"> | |
<Handlers> | |
<Add>System.Web.Handlers.TransferRequestHandler</Add> |
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 class FilterConfig | |
{ | |
public static void RegisterGlobalFilters(GlobalFilterCollection filters) | |
{ | |
filters.Add(new ErrorHandler.AiHandleErrorAttribute()); | |
} | |
} |
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
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)] | |
public class AiHandleErrorAttribute : HandleErrorAttribute | |
{ | |
public override void OnException(ExceptionContext filterContext) | |
{ | |
if (filterContext != null && filterContext.HttpContext != null && filterContext.Exception != null) | |
{ | |
if (filterContext.HttpContext.IsCustomErrorEnabled) | |
{ | |
var ai = new TelemetryClient(); |
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
[HttpPost] | |
[AllowAnonymous] | |
[ValidateAntiForgeryToken] | |
public async Task<ActionResult> ForgotPassword(ForgotPasswordViewModel model) | |
{ | |
if (ModelState.IsValid) | |
{ | |
var postVariables = Request.Form.ToString(); | |
var dic = new Dictionary<string, string>(); |
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
[HttpPost] | |
[AllowAnonymous] | |
[ValidateAntiForgeryToken] | |
public async Task<ActionResult> Login(LoginViewModel model, string returnUrl) | |
{ | |
if (!ModelState.IsValid) | |
{ | |
return View(model); | |
} |
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
$(document).ready(function() { | |
$(".home-page-link").click(function() { | |
window.appInsights.trackEvent("homePageLinkClicked", $(this).text()); | |
}); | |
}); |
NewerOlder