working #18
@@ -186,6 +186,7 @@ CREATE TABLE IF NOT EXISTS `JobApplication` (
|
||||
`AccountID` int NOT NULL,
|
||||
`ResumeID` int NOT NULL,
|
||||
`JobListingID` int NOT NULL,
|
||||
`ResponseEmail` varchar(255) DEFAULT NULL,
|
||||
`DateApplied` datetime DEFAULT NULL,
|
||||
`ResponseStatus` varchar(50) NOT NULL DEFAULT 'Pending',
|
||||
`HasBeenViewed` boolean DEFAULT 0,
|
||||
|
||||
@@ -3,6 +3,7 @@ export class Application {
|
||||
public accountID: number = 0;
|
||||
public resumeID: number = 0;
|
||||
public jobListingID: number = 0;
|
||||
public responseEmail: string = "";
|
||||
public dateApplied: Date = new Date();
|
||||
public responseStatus: string = "";
|
||||
public hasBeenViewed: boolean = false;
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace BoredCareers.Entities {
|
||||
public int AccountID { get; set; } // FK
|
||||
public int ResumeID { get; set; } // FK
|
||||
public int JobListingID { get; set; } // FK
|
||||
public string ResponseEmail { get; set; } = "";
|
||||
public DateTime DateApplied { get; set; }
|
||||
public string ResponseStatus { get; set; } = "";
|
||||
public bool HasBeenViewed { get; set; } = false;
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
int _accountid = reader.GetInt32("AccountID");
|
||||
int _resumeid = reader.GetInt32("ResumeID");
|
||||
int _joblistingid = reader.GetInt32("JobListingID");
|
||||
string _responseemail = reader.GetString("ResponseEmail");
|
||||
DateTime _dateapplied = reader.GetDateTime("DateApplied");
|
||||
string _responsestatus = reader.GetString("ResponseStatus");
|
||||
bool _hasbeenviewed = reader.GetBoolean("HasBeenViewed");
|
||||
@@ -36,6 +37,7 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
AccountID = _accountid,
|
||||
ResumeID = _resumeid,
|
||||
JobListingID = _joblistingid,
|
||||
ResponseEmail = _responseemail,
|
||||
DateApplied = _dateapplied,
|
||||
ResponseStatus = _responsestatus,
|
||||
HasBeenViewed = _hasbeenviewed,
|
||||
@@ -67,6 +69,7 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
int _accountid = reader.GetInt32("AccountID");
|
||||
int _resumeid = reader.GetInt32("ResumeID");
|
||||
int _joblistingid = reader.GetInt32("JobListingID");
|
||||
string _responseemail = reader.GetString("ResponseEmail");
|
||||
DateTime _dateapplied = reader.GetDateTime("DateApplied");
|
||||
string _responsestatus = reader.GetString("ResponseStatus");
|
||||
bool _hasbeenviewed = reader.GetBoolean("HasBeenViewed");
|
||||
@@ -78,6 +81,7 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
AccountID = _accountid,
|
||||
ResumeID = _resumeid,
|
||||
JobListingID = _joblistingid,
|
||||
ResponseEmail = _responseemail,
|
||||
DateApplied = _dateapplied,
|
||||
ResponseStatus = _responsestatus,
|
||||
HasBeenViewed = _hasbeenviewed,
|
||||
@@ -109,6 +113,7 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
int _accountid = reader.GetInt32("AccountID");
|
||||
int _resumeid = reader.GetInt32("ResumeID");
|
||||
int _joblistingid = reader.GetInt32("JobListingID");
|
||||
string _responseemail = reader.GetString("ResponseEmail");
|
||||
DateTime _dateapplied = reader.GetDateTime("DateApplied");
|
||||
string _responsestatus = reader.GetString("ResponseStatus");
|
||||
bool _hasbeenviewed = reader.GetBoolean("HasBeenViewed");
|
||||
@@ -120,6 +125,7 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
AccountID = _accountid,
|
||||
ResumeID = _resumeid,
|
||||
JobListingID = _joblistingid,
|
||||
ResponseEmail = _responseemail,
|
||||
DateApplied = _dateapplied,
|
||||
ResponseStatus = _responsestatus,
|
||||
HasBeenViewed = _hasbeenviewed,
|
||||
@@ -140,13 +146,14 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
await connection.OpenAsync();
|
||||
string command = @"
|
||||
INSERT INTO JobApplication
|
||||
(ID,AccountID,ResumeID,JobListingID,DateApplied,ResponseStatus,HasBeenViewed,Rating,Notes)
|
||||
(ID,AccountID,ResumeID,JobListingID,ResponseEmail,DateApplied,ResponseStatus,HasBeenViewed,Rating,Notes)
|
||||
VALUES
|
||||
(@ID,@AccountID,@ResumeID,@JobListingID,@DateApplied,@ResponseStatus,@HasBeenViewed,@Rating,@Notes)
|
||||
(@ID,@AccountID,@ResumeID,@JobListingID,@ResponseEmail,@DateApplied,@ResponseStatus,@HasBeenViewed,@Rating,@Notes)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
AccountID = @AccountID,
|
||||
ResumeID = @ResumeID,
|
||||
JobListingID = @JobListingID,
|
||||
ResponseEmail = @ResponseEmail,
|
||||
ResponseStatus = @ResponseStatus,
|
||||
HasBeenViewed = @HasBeenViewed,
|
||||
Rating = @Rating,
|
||||
@@ -158,6 +165,7 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
cmd.Parameters.AddWithValue("@AccountID", application.AccountID);
|
||||
cmd.Parameters.AddWithValue("@ResumeID", application.ResumeID);
|
||||
cmd.Parameters.AddWithValue("@JobListingID", application.JobListingID);
|
||||
cmd.Parameters.AddWithValue("@ResponseEmail", application.ResponseEmail);
|
||||
cmd.Parameters.AddWithValue("@DateApplied", DateTime.UtcNow);
|
||||
cmd.Parameters.AddWithValue("@ResponseStatus", application.ResponseStatus);
|
||||
cmd.Parameters.AddWithValue("@HasBeenViewed", application.HasBeenViewed);
|
||||
|
||||
Reference in New Issue
Block a user