Skip to content

Commit 414cdce

Browse files
bugfix
1 parent ef87052 commit 414cdce

File tree

6 files changed

+47
-23
lines changed

6 files changed

+47
-23
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
<mat-card>
22
<mat-card-header>
3-
<p class="lead pb-3" *ngIf="!updateClicked;else updateEmp">
3+
<p class="lead pb-3" *ngIf="!updateClicked; else updateEmp">
44
Add New Employee
55
</p>
66
<ng-template #updateEmp>
7-
<p class="lead pb-3" >
8-
Update Employee
9-
</p>
7+
<p class="lead pb-3">Update Employee</p>
108
</ng-template>
119
</mat-card-header>
1210
<mat-card-content>
@@ -16,24 +14,40 @@
1614
<div class="col-12 col-md-5">
1715
<mat-form-field appearance="outline">
1816
<mat-label>Employee Name</mat-label>
19-
<input matInput type="text" formControlName="EmployeeName" placeholder="Employee Name"/>
17+
<input
18+
matInput
19+
type="text"
20+
formControlName="EmployeeName"
21+
placeholder="Employee Name"
22+
/>
2023
</mat-form-field>
2124
</div>
2225
<div class="col-12 col-md-5">
2326
<mat-form-field appearance="outline">
2427
<mat-label>Department</mat-label>
2528
<mat-select formControlName="DepartmentId">
26-
<mat-option *ngFor="let dept of DepartmentsList" [value]="dept.DepartmentId">
27-
{{dept.DepartmentName}}
29+
<mat-option
30+
*ngFor="let dept of DepartmentsList"
31+
[value]="dept.DepartmentId"
32+
>
33+
{{ dept.DepartmentName }}
2834
</mat-option>
2935
</mat-select>
3036
</mat-form-field>
3137
</div>
3238
<div class="col-12 col-md-5">
3339
<mat-form-field appearance="fill">
3440
<mat-label>Date of Joining</mat-label>
35-
<input matInput [matDatepicker]="picker" formControlName="DateOfJoining" placeholder="Date of Joining">
36-
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
41+
<input
42+
matInput
43+
[matDatepicker]="picker"
44+
formControlName="DateOfJoining"
45+
placeholder="Date of Joining"
46+
/>
47+
<mat-datepicker-toggle
48+
matSuffix
49+
[for]="picker"
50+
></mat-datepicker-toggle>
3751
<mat-datepicker #picker></mat-datepicker>
3852
</mat-form-field>
3953
</div>
@@ -46,14 +60,32 @@
4660
</div>
4761
</div>
4862

49-
<button mat-raised-button type="submit" *ngIf="!updateClicked" color="primary">
63+
<button
64+
mat-raised-button
65+
type="submit"
66+
*ngIf="!updateClicked"
67+
color="primary"
68+
>
5069
Add
5170
</button>
5271

53-
<button type="button" mat-raised-button (click)="updateEmployee(addEmployeeForm.value)" *ngIf="updateClicked" color="accent" >
72+
<button
73+
type="button"
74+
mat-raised-button
75+
(click)="updateEmployee(addEmployeeForm.value)"
76+
*ngIf="updateClicked"
77+
color="accent"
78+
>
5479
Update
5580
</button>
56-
<button type="button" mat-raised-button color="warn" (click)="CloseDialog()">Close</button>
81+
<button
82+
type="button"
83+
mat-raised-button
84+
color="warn"
85+
(click)="CloseDialog()"
86+
>
87+
Close
88+
</button>
5789
</form>
5890
</mat-card-content>
5991
</mat-card>

AngularUI/src/app/components/employee/add-edit-emp/add-edit-emp.component.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class AddEditEmpComponent implements OnInit {
2727
PhotoFileName: this.PhotoFileName
2828
})
2929
}
30-
PhotoFileName = new FormControl(this.data[0] == null ? null : this.data[0].PhotoFileName);
30+
PhotoFileName = new FormControl(this.data[0] == null ? "anonymus.png" : this.data[0].PhotoFileName);
3131
PhotoFilePath:string;
3232
addEmployeeForm: FormGroup;
3333
updateClicked: boolean = this.data[1];
@@ -43,7 +43,6 @@ export class AddEditEmpComponent implements OnInit {
4343
}
4444

4545
loadDepartmentsList() {
46-
console.log(this.updateClicked)
4746
this.service.getAllDepartmentNames().subscribe({
4847
next: (res) => {
4948
this.DepartmentsList = res;
@@ -83,9 +82,7 @@ export class AddEditEmpComponent implements OnInit {
8382
};
8483

8584
uploadPhoto(event: any) {
86-
console.log("hi")
8785
var file = event.target.files[0];
88-
console.log(file)
8986
const formData:FormData=new FormData();
9087
formData.append('uploadedFile',file,file.name);
9188

WebAPI/WebAPI/Photos/anonymus.png

67.7 KB
Loading
-10 KB
Binary file not shown.

WebAPI/WebAPI/WebAPI.csproj

-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
<Folder Include="Photos\" />
2222
</ItemGroup>
2323

24-
<ItemGroup>
25-
<ProjectReference Include="..\CompanyService\CompanyService.csproj" />
26-
<ProjectReference Include="..\DataAccess\DataAccess.csproj" />
27-
</ItemGroup>
28-
2924
<ItemGroup>
3025
<Reference Include="CompanyService">
3126
<HintPath>refDLL\CompanyService.dll</HintPath>

WebAPI/WebAPI/appsettings.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"ConnectionStrings": {
3-
//"EmployeeAppCon": "Data Source=.;Initial Catalog=CompanyDB; Integrated Security=true"
4-
"EmployeeAppCon": "Data Source=IMCVBCP174-BLL\\SQLEXPRESS;Initial Catalog=CompanyDB; Integrated Security=true"
3+
"EmployeeAppCon": "Data Source=.;Initial Catalog=CompanyDB; Integrated Security=true"
4+
//"EmployeeAppCon": "Data Source=IMCVBCP174-BLL\\SQLEXPRESS;Initial Catalog=CompanyDB; Integrated Security=true"
55
},
66
"Logging": {
77
"LogLevel": {

0 commit comments

Comments
 (0)