|
|
@ -31,35 +31,41 @@ namespace StateJobsNYSubmit.Pages |
|
|
|
string test = p.DecryptString(cookieValue); |
|
|
|
string test = p.DecryptString(cookieValue); |
|
|
|
userData = JsonConvert.DeserializeObject<UserData>(test); |
|
|
|
userData = JsonConvert.DeserializeObject<UserData>(test); |
|
|
|
userData.visitCounter++; |
|
|
|
userData.visitCounter++; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Response.Cookies.Append("PrivateData", p.EncryptString(JsonConvert.SerializeObject(userData))); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
userData.coverLetter = Request.Cookies["CoverLetter"]; |
|
|
|
|
|
|
|
userData.skillOptions = new List<string>(Request.Cookies["Skills"].Split(Environment.NewLine)); |
|
|
|
this.CoverLetter = userData.coverLetter; |
|
|
|
this.CoverLetter = userData.coverLetter; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
public void OnGet(string vacancyID) |
|
|
|
public void OnGet(string vacancyID) |
|
|
|
{ |
|
|
|
{ |
|
|
|
GetUserData(); |
|
|
|
GetUserData(); |
|
|
|
if (vacancyID != null && !vacancyID.Trim().Equals("")) { |
|
|
|
if (vacancyID != null && !vacancyID.Trim().Equals("")) |
|
|
|
|
|
|
|
{ |
|
|
|
posting = new Posting(vacancyID); |
|
|
|
posting = new Posting(vacancyID); |
|
|
|
this.Posting_ID = vacancyID; |
|
|
|
this.Posting_ID = vacancyID; |
|
|
|
this.CoverLetter = userData.coverLetter; |
|
|
|
this.CoverLetter = userData.coverLetter; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Response.Cookies.Append("PrivateData", p.EncryptString(JsonConvert.SerializeObject(userData))); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
public void OnPost() |
|
|
|
public void OnPost() |
|
|
|
{ |
|
|
|
{ |
|
|
|
GetUserData(); |
|
|
|
GetUserData(); |
|
|
|
string vacancyID = Request.Form["posting_id"]; |
|
|
|
string vacancyID = Request.Form["posting_id"]; |
|
|
|
string coverLetterFormat = Request.Form["CoverLetter"]; |
|
|
|
string coverLetterFormat = Request.Cookies["CoverLetter"]; |
|
|
|
userData.coverLetter = coverLetterFormat; |
|
|
|
if (vacancyID != null && !vacancyID.Trim().Equals("")) |
|
|
|
if (vacancyID != null && !vacancyID.Trim().Equals("")) { |
|
|
|
{ |
|
|
|
posting = new Posting(vacancyID); |
|
|
|
posting = new Posting(vacancyID); |
|
|
|
this.CoverLetter = posting.GenerateLetter(coverLetterFormat); |
|
|
|
this.CoverLetter = posting.GenerateLetter(coverLetterFormat); |
|
|
|
this.Posting_ID = vacancyID; |
|
|
|
this.Posting_ID = vacancyID; |
|
|
|
} else { |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
Console.WriteLine($"Unable to get Posting ID from form."); |
|
|
|
Console.WriteLine($"Unable to get Posting ID from form."); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Response.Cookies.Append("PrivateData", p.EncryptString(JsonConvert.SerializeObject(userData))); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|