Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Χάρης Παπαδόπουλος
e-epal
Commits
77fa887c
Commit
77fa887c
authored
May 30, 2017
by
Open Source Developer
Browse files
capacity save
parent
2a32b639
Changes
1
Show whitespace changes
Inline
Side-by-side
source/components/director/director-classcapacity.ts
View file @
77fa887c
...
...
@@ -56,6 +56,27 @@ import {
</form>
</div>
<div id="checksaved" (onHidden)="onHidden('#checksaved')"
class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header modal-header-danger">
<h3 class="modal-title pull-left"><i class="fa fa-check-square-o"></i> Πρέπει να συπληρώσετε όλα τα πεδία</h3>
<button type="button" class="close pull-right" aria-label="Close" (click)="hideModal('#checksaved')">
<span aria-hidden="true"><i class="fa fa-times"></i></span>
</button>
</div>
<div class="modal-body">
<p>Η αποθήκευση δε μπορεί να γίνει αν δεν συμπληρώσετε όλα τα στοιχεία της φόρμας!</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">Κλείσιμο</button>
</div>
</div>
</div>
</div>
<div id="capacitysaved" (onHidden)="onHidden('#capacitysaved')"
class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg">
...
...
@@ -77,6 +98,9 @@ import {
</div>
`
})
...
...
@@ -98,6 +122,9 @@ import {
private
classCapacity$
:
BehaviorSubject
<
any
>
;
private
classCapacitySub
:
Subscription
;
private
retrievedStudent
:
BehaviorSubject
<
boolean
>
;
private
modalTitle
:
BehaviorSubject
<
string
>
;
private
modalText
:
BehaviorSubject
<
string
>
;
private
modalHeader
:
BehaviorSubject
<
string
>
;
...
...
@@ -114,6 +141,9 @@ import {
this
.
selectionCClass
=
new
BehaviorSubject
(
false
);
this
.
retrievedStudent
=
new
BehaviorSubject
(
false
);
this
.
School$
=
new
BehaviorSubject
([{}]);
this
.
modalTitle
=
new
BehaviorSubject
(
""
);
this
.
modalText
=
new
BehaviorSubject
(
""
);
this
.
modalHeader
=
new
BehaviorSubject
(
""
);
this
.
formGroup
=
this
.
fb
.
group
({
tomeas
:
[
''
,
[]],
taxi
:
[
''
,
[]],
...
...
@@ -155,6 +185,7 @@ import {
ngOnInit
()
{
(
<
any
>
$
(
'
#capacitysaved
'
)).
appendTo
(
"
body
"
);
(
<
any
>
$
(
'
#checksaved
'
)).
appendTo
(
"
body
"
);
this
.
retrievedStudent
.
next
(
false
);
this
.
SchoolSub
=
this
.
_hds
.
gettypeofschool
().
subscribe
(
x
=>
{
...
...
@@ -298,11 +329,20 @@ import {
saveCapacity
()
{
var
taxi
=
+
this
.
formGroup
.
value
.
taxi
;
var
tomeas
=
+
this
.
formGroup
.
value
.
tomeas
;
var
specialit
=
+
this
.
formGroup
.
value
.
specialit
;
var
capc
=
+
this
.
formGroup
.
value
.
capacity
;
this
.
saveCapacitySub
=
this
.
_hds
.
saveCapacity
(
this
.
formGroup
.
value
.
taxi
,
tomeas
,
specialit
,
this
.
formGroup
.
value
.
capacity
).
subscribe
(
data
=>
{
if
((
taxi
===
2
&&
tomeas
===
0
)
||
(
taxi
===
3
&&
tomeas
===
0
)
||
(
taxi
===
3
&&
specialit
===
0
)
||
(
taxi
===
4
&&
tomeas
===
0
)
||
(
taxi
===
4
&&
specialit
===
0
)
||
(
taxi
=
0
)
||
(
capc
===
0
))
{
this
.
showModal
(
"
#checksaved
"
);
}
else
{
this
.
saveCapacitySub
=
this
.
_hds
.
saveCapacity
(
this
.
formGroup
.
value
.
taxi
,
tomeas
,
specialit
,
this
.
formGroup
.
value
.
capacity
).
subscribe
(
data
=>
{
},
error
=>
{
...
...
@@ -312,9 +352,11 @@ import {
console
.
log
(
"
Saved Capacity
"
);
this
.
showModal
(
"
#capacitysaved
"
);
});
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment