Webapp to automatically create StateJobsNY Applications with cover letter and resume then potentially automatically send application email.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
namespace StateJobsNYSubmit.Pages
|
|
|
|
{
|
|
|
|
public class SettingsModel : PageModel
|
|
|
|
{
|
|
|
|
private readonly ILogger<PrivacyModel> _logger;
|
|
|
|
|
|
|
|
private PrivateData p = new PrivateData();
|
|
|
|
public UserData userData;
|
|
|
|
public SettingsModel(ILogger<PrivacyModel> logger)
|
|
|
|
{
|
|
|
|
_logger = logger;
|
|
|
|
}
|
|
|
|
public void GetUserData()
|
|
|
|
{
|
|
|
|
userData = new UserData();
|
|
|
|
userData.skillOptions = new List<string>();
|
|
|
|
userData.visitCounter = 1;
|
|
|
|
string cookieValue = Request.Cookies["PrivateData"];
|
|
|
|
if (cookieValue != null)
|
|
|
|
{
|
|
|
|
string test = p.DecryptString(cookieValue);
|
|
|
|
userData = JsonConvert.DeserializeObject<UserData>(test);
|
|
|
|
userData.visitCounter++;
|
|
|
|
}
|
|
|
|
Response.Cookies.Append("PrivateData", p.EncryptString(JsonConvert.SerializeObject(userData)));
|
|
|
|
Console.WriteLine($"Value of counter: {userData.visitCounter}");
|
|
|
|
}
|
|
|
|
public void OnGet()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|