Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

Commit

Permalink
Merge pull request #5 from CampusDual/BFS42024-14
Browse files Browse the repository at this point in the history
BFS42024-14
  • Loading branch information
marcospaab authored Oct 17, 2024
2 parents 846cb6a + e75785f commit 48ec337
Show file tree
Hide file tree
Showing 13 changed files with 219 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ public interface IStudentService {
EntityResult studentInsert(Map<String, Object> attrMap) throws OntimizeJEERuntimeException;

EntityResult studentUpdate(Map<String, Object> attrMap, Map<String, Object> keyMap) throws OntimizeJEERuntimeException;

EntityResult studentDelete(Map<String, Object> keyMap) throws OntimizeJEERuntimeException;
}
2 changes: 1 addition & 1 deletion cd2024bfs4g1-frontend/src/main/ngx/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const customProviders: any = [
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production })
],
declarations: [
AppComponent
AppComponent,
],
bootstrap: [
AppComponent
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
o-form-toolbar {
background-color: #f0f0f0;
padding: 10px;
border-radius: 5px;
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

o-form-toolbar button {
margin-right: 10px;
background-color: #007bff;
color: white;
border-radius: 3px;
padding: 5px 15px;
}

o-form {
background-color: #d5e9de;
border: 2px solid #a8d3b8;
padding: 20px;
border-radius: 10px;
max-width: 80%;
margin: 0 auto;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

[fxLayout="row"] {
display: flex;
align-items: center;
justify-content:space-between;
flex-wrap: wrap;
}

o-text-input, o-email-input {
display: block;
width: 100%;
padding: 10px;
margin: 10px 0 10px 10px;
background-color: #F5F5F5;
border: 1px solid #a8d3b8;
border-radius: 5px;
font-size: 14px;
color: #2f4f4f;
box-sizing: border-box;
}

label {
display: block;
width: 100%;
margin: 10px 0 10px 10px;
font-size: 16px;
font-weight: bold;
color: #668873;
box-sizing: border-box;
}

.hidden {
display: none;
}



Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<o-form attr="studentsDetail" service="students" entity="student" keys="id" header-actions="R;I;U;D" show-header-navigation="no">
<o-text-input [ngClass]="{'hidden': true}" attr="id" sql-type="INTEGER" enabled="no"/>
<div fxLayout="row" fxLayoutGap="16px" fxLayoutWrap>
<div fxFlex="45">
<label for="name">Nombre</label>
<o-text-input attr="name" required="yes" id="name"></o-text-input>
</div>
<div fxFlex="45">
<label for="surnames">Apellidos</label>
<o-text-input attr="surnames" required="yes" id="surnames"></o-text-input>
</div>
<div fxFlex="98">
<label for="email">Email</label>
<o-email-input attr="email" required="yes" id="email"></o-email-input>
</div>
</div>
</o-form>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { StudentsDetailComponent } from './students-detail.component';

describe('StudentsDetailComponent', () => {
let component: StudentsDetailComponent;
let fixture: ComponentFixture<StudentsDetailComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ StudentsDetailComponent ]
})
.compileComponents();

fixture = TestBed.createComponent(StudentsDetailComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-students-detail',
templateUrl: './students-detail.component.html',
styleUrls: ['./students-detail.component.css']
})
export class StudentsDetailComponent {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
o-form-toolbar {
background-color: #f0f0f0;
padding: 10px;
border-radius: 5px;
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

o-form-toolbar button {
margin-right: 10px;
background-color: #007bff;
color: white;
border-radius: 3px;
padding: 5px 15px;
}

o-form {
background-color: #d5e9de;
border: 2px solid #a8d3b8;
padding: 20px;
border-radius: 10px;
max-width: 80%;
margin: 0 auto;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

[fxLayout="row"] {
display: flex;
align-items: center;
justify-content:space-between;
flex-wrap: wrap;
}

o-text-input, o-email-input {
display: block;
width: 100%;
padding: 10px;
margin: 10px 0 10px 10px;
background-color: #F5F5F5;
border: 1px solid #a8d3b8;
border-radius: 5px;
font-size: 14px;
color: #2f4f4f;
box-sizing: border-box;
}

label {
display: block;
width: 100%;
margin: 10px 0 10px 10px;
font-size: 16px;
font-weight: bold;
color: #668873;
box-sizing: border-box;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<o-form #studentsform attr="studentsNew" service="students" entity="student" keys="id" header-actions="R;I;U;D" show-header-navigation="no">
<div fxLayout="row" fxLayoutGap="16px" fxLayoutWrap>
<div fxFlex="45">
<label for="name">Nombre</label>
<o-text-input attr="name" required="yes" id="name"></o-text-input>
</div>
<div fxFlex="45">
<label for="surnames">Apellidos</label>
<o-text-input attr="surnames" required="yes" id="surnames"></o-text-input>
</div>
<div fxFlex="98">
<label for="email">Email</label>
<o-email-input attr="email" required="yes" id="email"></o-email-input>
</div>
</div>
</o-form>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Component, ViewChild } from '@angular/core';
import { OFormComponent } from 'ontimize-web-ngx';

@Component({
selector: 'app-students-new',
templateUrl: './students-new.component.html',
styleUrls: ['./students-new.component.css']
})
export class StudentsNewComponent {

@ViewChild('studentsform') protected formStudents: OFormComponent;

insertStudent() {
this.formStudents.insert();
}

}
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { StudentsNewComponent } from './students-new/students-new.component';
import { StudentsDetailComponent } from './students-detail/students-detail.component';
import { StudentsTableComponent } from './students-table/students-table.component';

const routes: Routes = [
{ path:'', pathMatch:'full', component: StudentsTableComponent}
{ path:'', pathMatch:'full', component: StudentsTableComponent},
{ path:"new", component:StudentsNewComponent},
{ path:":id", component:StudentsDetailComponent}
];

@NgModule({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { OntimizeWebModule } from 'ontimize-web-ngx';

import { StudentsRoutingModule } from './students-routing.module';
import { StudentsDetailComponent } from './students-detail/students-detail.component';
import { StudentsNewComponent } from './students-new/students-new.component';
import { OntimizeWebModule } from 'ontimize-web-ngx';
import { StudentsTableComponent } from './students-table/students-table.component';


@NgModule({
declarations: [
StudentsDetailComponent,
StudentsNewComponent,
StudentsTableComponent
],
imports: [
Expand All @@ -15,4 +20,4 @@ import { StudentsTableComponent } from './students-table/students-table.componen
StudentsRoutingModule
]
})
export class StudentsModule { }
export class StudentsModule { }
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

import javax.swing.text.html.parser.Entity;

@Service("StudentService")
@Lazy
public class StudentService implements IStudentService {
Expand All @@ -39,4 +37,9 @@ public EntityResult studentInsert(Map<String, Object> attrMap) throws OntimizeJE
public EntityResult studentUpdate(Map<String, Object> attrMap, Map<String, Object> keyMap) throws OntimizeJEERuntimeException {
return this.daoHelper.update(this.studentDao, attrMap, keyMap);
}

@Override
public EntityResult studentDelete(Map<String, Object> keyMap) throws OntimizeJEERuntimeException {
return this.daoHelper.delete(this.studentDao, keyMap);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ info:
version: '1.0'
description: The cd2024bfs4g1 API
servers:
- url: '/'
- url: ''
description: Localhost

paths:
Expand Down

0 comments on commit 48ec337

Please sign in to comment.