(Request.Cookies["Skills"].Split(Environment.NewLine));
this.CoverLetter = userData.coverLetter;
}
+
}
public void OnGet(string vacancyID)
{
GetUserData();
- if (vacancyID != null && !vacancyID.Trim().Equals("")) {
+ if (vacancyID != null && !vacancyID.Trim().Equals(""))
+ {
posting = new Posting(vacancyID);
this.Posting_ID = vacancyID;
this.CoverLetter = userData.coverLetter;
- }
-
- Response.Cookies.Append("PrivateData", p.EncryptString(JsonConvert.SerializeObject(userData)));
+ }
}
public void OnPost()
{
GetUserData();
string vacancyID = Request.Form["posting_id"];
- string coverLetterFormat = Request.Form["CoverLetter"];
- userData.coverLetter = coverLetterFormat;
- if (vacancyID != null && !vacancyID.Trim().Equals("")) {
+ string coverLetterFormat = Request.Cookies["CoverLetter"];
+ if (vacancyID != null && !vacancyID.Trim().Equals(""))
+ {
posting = new Posting(vacancyID);
this.CoverLetter = posting.GenerateLetter(coverLetterFormat);
this.Posting_ID = vacancyID;
- } else {
+ }
+ else
+ {
Console.WriteLine($"Unable to get Posting ID from form.");
}
- Response.Cookies.Append("PrivateData", p.EncryptString(JsonConvert.SerializeObject(userData)));
}
}
}
diff --git a/Pages/Settings.cshtml b/Pages/Settings.cshtml
index 5a00928..69e1d36 100644
--- a/Pages/Settings.cshtml
+++ b/Pages/Settings.cshtml
@@ -27,6 +27,12 @@
+ Write your cover letter above, using variables like $name, $title, $vacancy, $box to auto-fill from the posting.
+
+
+
+
+ List your skills for applications above, one skill per line.
@@ -35,4 +41,6 @@
Visits: @Model.userData.visitCounter
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/Pages/Settings.cshtml.cs b/Pages/Settings.cshtml.cs
index 7c79f1b..4f61f2d 100644
--- a/Pages/Settings.cshtml.cs
+++ b/Pages/Settings.cshtml.cs
@@ -27,8 +27,9 @@ namespace StateJobsNYSubmit.Pages
{
string test = p.DecryptString(cookieValue);
userData = JsonConvert.DeserializeObject(test);
+ userData.coverLetter = Request.Cookies["CoverLetter"];
+ skills = Request.Cookies["Skills"];
}
- Response.Cookies.Append("PrivateData", p.EncryptString(JsonConvert.SerializeObject(userData)));
}
public void OnGet()
{
@@ -40,7 +41,13 @@ namespace StateJobsNYSubmit.Pages
userData.name = Request.Form["userData.name"];
userData.email = Request.Form["userData.email"];
userData.smtpHost = Request.Form["userData.smtpHost"];
+
+ Response.Cookies.Append("Skills", Request.Form["skills"]);
+ Response.Cookies.Append("CoverLetter", Request.Form["userData.coverLetter"]);
+ userData.coverLetter = "";
Response.Cookies.Append("PrivateData", p.EncryptString(JsonConvert.SerializeObject(userData)));
+ userData.coverLetter = Request.Cookies["CoverLetter"];
+ skills = Request.Cookies["Skills"];
}
}
}