Commit 424c818d authored by Phạm Duy Phi's avatar Phạm Duy Phi

no message

parent afbac0e6
......@@ -74,23 +74,19 @@ public class TimeSheetBusiness {
@Transactional
public String updateTimeSheet(TimeSheetDTO timeSheetDTO) {
String message;
Employee employee = employeeRepository.findEmployeeById(timeSheetDTO.getEmployeeId());
Eproject eproject = eProjectRepository.findEprojectByEmployee(employee);
TimeSheet timeSheet = timeSheetRepository.findTimeSheetByEprojectAndId(eproject, timeSheetDTO.getId());
if (eproject != null) {
if (timeSheet != null) {
int i = timeSheetRepository.updateTimeSheet(timeSheetDTO.getTitle(), timeSheetDTO.getContent()
, timeSheetDTO.getNote(), timeSheetDTO.getId());
if (i == 1) {
message = "Update success";
} else {
message = "Update failed";
}
// Employee employee = employeeRepository.findEmployeeById(timeSheetDTO.getEmployeeId());
// Eproject eproject = eProjectRepository.findEprojectByEmployee(employee);
TimeSheet timeSheet = timeSheetRepository.findTimeSheetById(timeSheetDTO.getId());
if (timeSheet != null) {
int i = timeSheetRepository.updateTimeSheet(timeSheetDTO.getTitle(), timeSheetDTO.getContent()
, timeSheetDTO.getNote(), timeSheetDTO.getId());
if (i == 1) {
message = "Update success";
} else {
message = "TimeSheet does not exist";
message = "Update failed";
}
} else {
message = "Eproject does not exist";
message = "TimeSheet does not exist";
}
return message;
}
......@@ -107,24 +103,6 @@ public class TimeSheetBusiness {
return message;
}
// @Transactional
// public String updateLeaveFormStatus(TimeSheetDTO timeSheetDTO) {
// String message;
// TimeSheet timeSheet = timeSheetRepository.findTimeSheetByEmployeeId(timeSheetDTO.getId());
// if (timeSheet != null) {
// int i = timeSheetRepository.updateTimeSheetStatus(timeSheetDTO.isStatus(), timeSheetDTO.getId());
// if (i == 1) {
// message = "Update status success";
// } else {
// message = "Update status failed";
// }
// } else {
// message = "TimeSheet does not exist";
// }
//
// return message;
// }
public List<TimeSheet> findTimeSheetByEmployeeId(int employeeId) {
Employee employee = employeeRepository.findEmployeeById(employeeId);
Eproject eproject = eProjectRepository.findEprojectByEmployee(employee);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -3,6 +3,7 @@
<a ui-sref="employees"></a>
<!-- <a ui-sref="report"></a>-->
<!-- <a ui-sref="project"></a>-->
<a ui-sref="timeSheet"></a>
<div ui-view="content">
</div>
......
......@@ -10,7 +10,7 @@
<div class="container-fluid">
<!-- Content -->
<div ui-view="layout">
<div ui-view="content">
</div>
<!-- footer -->
......
This diff is collapsed.
This diff is collapsed.
......@@ -16,7 +16,7 @@
<div class="table-title">
<div class="row">
<div class="col-sm-6">
<h2><b>Leave Form</b></h2>
<h4><b>Leave Form</b></h4>
<label>
Search: <input type="text" ng-model="search" placeholder="Search" style="color: black; margin: 10px"/>
</label>
......@@ -27,7 +27,7 @@
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="col-md-11">
<div id="addDivLF" style="display: none">
<h2><b>Add Leave Form</b></h2>
<table class="table table-striped table-hover">
......
......@@ -16,7 +16,7 @@
<div class="table-title">
<div class="row">
<div class="col-sm-6">
<h2><b>TimeSheet</b></h2>
<h4><b>TimeSheet</b></h4>
<label>
Search: <input type="text" ng-model="search" placeholder="Search" style="color: black; margin: 10px"/>
</label>
......@@ -27,7 +27,7 @@
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="col-md-11">
<div id="addDivTS" style="display: none">
<h2><b>Add TimeSheet</b></h2>
<table class="table table-striped table-hover">
......@@ -125,7 +125,7 @@
</tr>
</thead>
<tbody>
<tr class="tss" ng-repeat="ts in myTimeSheets | limitTo:numLimit:start | filter: search">
<tr class="tss" ng-repeat="ts in myTimeSheets | filter: search">
<td>{{$index + 1}}</td>
<td>{{ts.title}}</td>
<td>{{ts.content}}</td>
......@@ -133,9 +133,9 @@
<td>{{ts.eproject.project.name}}</td>
<td>{{ts.updatedAt}}</td>
<td><a ui-sref="timeSheetDetail({id: ts.id})"data-toggle="modal"><i class="fa fa-eye" data-toggle="tooltip" title="View"></i></a></td>
<td><a ui-sref="timeSheet" ng-click="getTs(ts);" onclick="document.getElementById('updateDivTS').style.display = 'block'"class="edit" data-toggle="modal"><i class="material-icons" data-toggle="tooltip" title="Edit">&#xE254;</i></a></td>
<td><a ui-sref="timeSheet" ng-click="delete(ts);"class="delete" data-toggle="modal"><i class="material-icons" data-toggle="tooltip" title="Delete">&#xE872;</i></a></td>
<td><a ui-sref="timeSheetDetail({id: ts.id})" data-toggle="modal"><i class="fa fa-eye" data-toggle="tooltip" title="View"></i></a></td>
<td><a ui-sref="timeSheet" ng-click="getTs(ts);" onclick="document.getElementById('updateDivTS').style.display = 'block'" class="edit" data-toggle="modal"><i class="material-icons" data-toggle="tooltip" title="Edit">&#xE254;</i></a></td>
<td><a ui-sref="timeSheet" ng-click="delete(ts);" class="delete" data-toggle="modal"><i class="material-icons" data-toggle="tooltip" title="Delete">&#xE872;</i></a></td>
</tr>
<!-- <tr>-->
<!-- <h6><code>rotate</code> defaulted to <code>true</code> and <code>force-ellipses</code> set to <code>true</code>:</h6>-->
......
......@@ -16,7 +16,7 @@
<div class="table-title">
<div class="row">
<div class="col-sm-6">
<h2><b>TimeSheet</b></h2>
<h4><b>TimeSheet</b></h4>
<label>
Search: <input type="text" ng-model="search" placeholder="Search" style="color: black; margin: 10px"/>
</label>
......@@ -27,7 +27,7 @@
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="col-md-11">
<div id="addDivTS" style="display: none">
<h2><b>Add TimeSheet</b></h2>
<table class="table table-striped table-hover">
......@@ -125,7 +125,7 @@
</tr>
</thead>
<tbody>
<tr class="tss" ng-repeat="ts in myTimeSheets | limitTo:numLimit:start | filter: search">
<tr class="tss" ng-repeat="ts in myTimeSheets | filter: search">
<td>{{$index + 1}}</td>
<td>{{ts.title}}</td>
<td>{{ts.content}}</td>
......@@ -133,9 +133,9 @@
<td>{{ts.eproject.project.name}}</td>
<td>{{ts.updatedAt}}</td>
<td><a ui-sref="timeSheetDetail({id: ts.id})"data-toggle="modal"><i class="fa fa-eye" data-toggle="tooltip" title="View"></i></a></td>
<td><a ui-sref="timeSheet" ng-click="getTs(ts);" onclick="document.getElementById('updateDivTS').style.display = 'block'"class="edit" data-toggle="modal"><i class="material-icons" data-toggle="tooltip" title="Edit">&#xE254;</i></a></td>
<td><a ui-sref="timeSheet" ng-click="delete(ts);"class="delete" data-toggle="modal"><i class="material-icons" data-toggle="tooltip" title="Delete">&#xE872;</i></a></td>
<td><a ui-sref="timeSheetDetail({id: ts.id})" data-toggle="modal"><i class="fa fa-eye" data-toggle="tooltip" title="View"></i></a></td>
<td><a ui-sref="timeSheet" ng-click="getTs(ts);" onclick="document.getElementById('updateDivTS').style.display = 'block'" class="edit" data-toggle="modal"><i class="material-icons" data-toggle="tooltip" title="Edit">&#xE254;</i></a></td>
<td><a ui-sref="timeSheet" ng-click="delete(ts);" class="delete" data-toggle="modal"><i class="material-icons" data-toggle="tooltip" title="Delete">&#xE872;</i></a></td>
</tr>
<!-- <tr>-->
<!-- <h6><code>rotate</code> defaulted to <code>true</code> and <code>force-ellipses</code> set to <code>true</code>:</h6>-->
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment