working #28
@@ -48,7 +48,6 @@ CREATE TABLE IF NOT EXISTS `Resume` (
|
|||||||
CREATE TABLE IF NOT EXISTS `ResumeMilitary` (
|
CREATE TABLE IF NOT EXISTS `ResumeMilitary` (
|
||||||
`ID` int NOT NULL AUTO_INCREMENT,
|
`ID` int NOT NULL AUTO_INCREMENT,
|
||||||
`ResumeID` int NOT NULL,
|
`ResumeID` int NOT NULL,
|
||||||
`Veteran` boolean DEFAULT 0,
|
|
||||||
`Country` char(2) NOT NULL,
|
`Country` char(2) NOT NULL,
|
||||||
`Rank` varchar(50) NOT NULL,
|
`Rank` varchar(50) NOT NULL,
|
||||||
`DateStarted` date NOT NULL,
|
`DateStarted` date NOT NULL,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export class Resume {
|
|||||||
public city: string = "";
|
public city: string = "";
|
||||||
public isActive: boolean = false;
|
public isActive: boolean = false;
|
||||||
public experience: ResumeExperience[] = [];
|
public experience: ResumeExperience[] = [];
|
||||||
public military: ResumeMilitary = new ResumeMilitary;
|
public military: ResumeMilitary | null = new ResumeMilitary;
|
||||||
public education: ResumeEducation[] = [];
|
public education: ResumeEducation[] = [];
|
||||||
public skills: ResumeSkill[] = [];
|
public skills: ResumeSkill[] = [];
|
||||||
public languages: ResumeLanguage[] = [];
|
public languages: ResumeLanguage[] = [];
|
||||||
@@ -53,7 +53,6 @@ export class ResumeMilitary {
|
|||||||
public id: number | null = null;
|
public id: number | null = null;
|
||||||
public resumeID: number | null = null;
|
public resumeID: number | null = null;
|
||||||
|
|
||||||
public veteran: boolean = false;
|
|
||||||
public country: string = "";
|
public country: string = "";
|
||||||
public rank: string = "";
|
public rank: string = "";
|
||||||
public dateStarted: Date = new Date();
|
public dateStarted: Date = new Date();
|
||||||
|
|||||||
@@ -43,8 +43,8 @@
|
|||||||
|
|
||||||
<!-- Military -->
|
<!-- Military -->
|
||||||
<div class="resume-section">
|
<div class="resume-section">
|
||||||
<h1>Is Veteran: </h1><input name="veteran" [(ngModel)]="resume.military.veteran" type="checkbox" />
|
<h1>Is Veteran: </h1><input name="veteran" type="checkbox" (change)="onVeteranChange($event)" />
|
||||||
@if(resume.military.veteran){
|
@if(resume.military !== null){
|
||||||
<input name="militarycountry" [(ngModel)]="resume.military.country" type="text" placeholder="US" />
|
<input name="militarycountry" [(ngModel)]="resume.military.country" type="text" placeholder="US" />
|
||||||
<input name="militaryrank" [(ngModel)]="resume.military.rank" type="text" placeholder="PVT" />
|
<input name="militaryrank" [(ngModel)]="resume.military.rank" type="text" placeholder="PVT" />
|
||||||
<input name="militarydateStarted" [(ngModel)]="resume.military.dateStarted" type="date" />
|
<input name="militarydateStarted" [(ngModel)]="resume.military.dateStarted" type="date" />
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { FormsModule } from '@angular/forms';
|
|||||||
import { Router, ActivatedRoute, RouterModule } from '@angular/router';
|
import { Router, ActivatedRoute, RouterModule } from '@angular/router';
|
||||||
import { Title } from '@angular/platform-browser';
|
import { Title } from '@angular/platform-browser';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { Resume, ResumeCertification, ResumeEducation, ResumeExperience, ResumeExperienceBullet, ResumeLanguage, ResumeMilitaryBullet, ResumeProject, ResumeSkill } from 'app/models/Resume';
|
import { Resume, ResumeCertification, ResumeEducation, ResumeExperience, ResumeExperienceBullet, ResumeLanguage, ResumeMilitary, ResumeMilitaryBullet, ResumeProject, ResumeSkill } from 'app/models/Resume';
|
||||||
import { Authentication } from 'app/services/Authentication';
|
import { Authentication } from 'app/services/Authentication';
|
||||||
import { HomeComponent } from "app/pages/home/home.component";
|
import { HomeComponent } from "app/pages/home/home.component";
|
||||||
|
|
||||||
@@ -33,6 +33,7 @@ export class ResumesEditorComponent {
|
|||||||
this.http.get<Resume>("api/resume?ResumeID=" + ResumeID).subscribe({
|
this.http.get<Resume>("api/resume?ResumeID=" + ResumeID).subscribe({
|
||||||
next: data => {
|
next: data => {
|
||||||
this.resume = data;
|
this.resume = data;
|
||||||
|
this.milCache = data.military;
|
||||||
this.isNewResume = false;
|
this.isNewResume = false;
|
||||||
},
|
},
|
||||||
error: err => {
|
error: err => {
|
||||||
@@ -81,15 +82,27 @@ export class ResumesEditorComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
milCache: ResumeMilitary | null = new ResumeMilitary;
|
||||||
|
onVeteranChange(event: Event){
|
||||||
|
const checkbox = event.target as HTMLInputElement;
|
||||||
|
const isChecked = checkbox.checked;
|
||||||
|
if (isChecked){
|
||||||
|
this.resume.military = this.milCache;
|
||||||
|
} else {
|
||||||
|
this.resume.military = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
addMillitaryBullet(){
|
addMillitaryBullet(){
|
||||||
this.resume.military.millitaryBullets.push( new ResumeMilitaryBullet );
|
this.resume.military?.millitaryBullets.push( new ResumeMilitaryBullet );
|
||||||
}
|
}
|
||||||
delMillitaryBullet(self: ResumeMilitaryBullet){
|
delMillitaryBullet(self: ResumeMilitaryBullet){
|
||||||
for(let i=0; i<this.resume.military.millitaryBullets.length; i++){
|
if (this.resume.military !== null){
|
||||||
let cur = this.resume.military.millitaryBullets[i];
|
for(let i=0; i<this.resume.military.millitaryBullets.length; i++){
|
||||||
if (cur.trackUUID === self.trackUUID){
|
let cur = this.resume.military.millitaryBullets[i];
|
||||||
this.resume.military.millitaryBullets.splice( i, 1 );
|
if (cur.trackUUID === self.trackUUID){
|
||||||
break;
|
this.resume.military.millitaryBullets.splice( i, 1 );
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace BoredCareers.Entities {
|
|||||||
public string City { get; set; } = "";
|
public string City { get; set; } = "";
|
||||||
public bool IsActive { get; set; } = false;
|
public bool IsActive { get; set; } = false;
|
||||||
public ResumeExperience[] Experience { get; set; } = [];
|
public ResumeExperience[] Experience { get; set; } = [];
|
||||||
public ResumeMilitary Millitary { get; set; } = new ResumeMilitary();
|
public ResumeMilitary? Millitary { get; set; } = null;
|
||||||
public ResumeEducation[] Educations { get; set; } = [];
|
public ResumeEducation[] Educations { get; set; } = [];
|
||||||
public ResumeSkill[] Skills { get; set; } = [];
|
public ResumeSkill[] Skills { get; set; } = [];
|
||||||
public ResumeLanguage[] Languages { get; set; } = [];
|
public ResumeLanguage[] Languages { get; set; } = [];
|
||||||
@@ -46,7 +46,6 @@ namespace BoredCareers.Entities {
|
|||||||
public class ResumeMilitary {
|
public class ResumeMilitary {
|
||||||
public int? ID { get; set; } // PK
|
public int? ID { get; set; } // PK
|
||||||
public int ResumeID { get; set; } // FK
|
public int ResumeID { get; set; } // FK
|
||||||
public bool Veteran { get; set; } = false;
|
|
||||||
public string Country { get; set; } = ""; // 2 Letter Country Code
|
public string Country { get; set; } = ""; // 2 Letter Country Code
|
||||||
public string Rank { get; set; } = "";
|
public string Rank { get; set; } = "";
|
||||||
public DateTime DateStarted { get; set; } = new DateTime();
|
public DateTime DateStarted { get; set; } = new DateTime();
|
||||||
|
|||||||
@@ -114,7 +114,6 @@ namespace BoredCareers.Services.DatabaseService {
|
|||||||
if (reader == null) { break; }
|
if (reader == null) { break; }
|
||||||
int _id = reader.GetInt32("ID");
|
int _id = reader.GetInt32("ID");
|
||||||
int _resumeid = reader.GetInt32("ResumeID");
|
int _resumeid = reader.GetInt32("ResumeID");
|
||||||
bool _veteran = reader.GetBoolean("Veteran");
|
|
||||||
string _country = reader.GetString("Country");
|
string _country = reader.GetString("Country");
|
||||||
string _rank = reader.GetString("Rank");
|
string _rank = reader.GetString("Rank");
|
||||||
DateTime _datestarted = reader.GetDateTime("DateStarted");
|
DateTime _datestarted = reader.GetDateTime("DateStarted");
|
||||||
@@ -123,7 +122,6 @@ namespace BoredCareers.Services.DatabaseService {
|
|||||||
military = new ResumeMilitary() {
|
military = new ResumeMilitary() {
|
||||||
ID = _id,
|
ID = _id,
|
||||||
ResumeID = _resumeid,
|
ResumeID = _resumeid,
|
||||||
Veteran = _veteran,
|
|
||||||
Country = _country,
|
Country = _country,
|
||||||
Rank = _rank,
|
Rank = _rank,
|
||||||
DateStarted = _datestarted,
|
DateStarted = _datestarted,
|
||||||
|
|||||||
Reference in New Issue
Block a user