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