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

no message

parent afbac0e6
...@@ -74,10 +74,9 @@ public class TimeSheetBusiness { ...@@ -74,10 +74,9 @@ public class TimeSheetBusiness {
@Transactional @Transactional
public String updateTimeSheet(TimeSheetDTO timeSheetDTO) { public String updateTimeSheet(TimeSheetDTO timeSheetDTO) {
String message; String message;
Employee employee = employeeRepository.findEmployeeById(timeSheetDTO.getEmployeeId()); // Employee employee = employeeRepository.findEmployeeById(timeSheetDTO.getEmployeeId());
Eproject eproject = eProjectRepository.findEprojectByEmployee(employee); // Eproject eproject = eProjectRepository.findEprojectByEmployee(employee);
TimeSheet timeSheet = timeSheetRepository.findTimeSheetByEprojectAndId(eproject, timeSheetDTO.getId()); TimeSheet timeSheet = timeSheetRepository.findTimeSheetById(timeSheetDTO.getId());
if (eproject != null) {
if (timeSheet != null) { if (timeSheet != null) {
int i = timeSheetRepository.updateTimeSheet(timeSheetDTO.getTitle(), timeSheetDTO.getContent() int i = timeSheetRepository.updateTimeSheet(timeSheetDTO.getTitle(), timeSheetDTO.getContent()
, timeSheetDTO.getNote(), timeSheetDTO.getId()); , timeSheetDTO.getNote(), timeSheetDTO.getId());
...@@ -89,9 +88,6 @@ public class TimeSheetBusiness { ...@@ -89,9 +88,6 @@ public class TimeSheetBusiness {
} else { } else {
message = "TimeSheet does not exist"; message = "TimeSheet does not exist";
} }
} else {
message = "Eproject does not exist";
}
return message; return message;
} }
...@@ -107,24 +103,6 @@ public class TimeSheetBusiness { ...@@ -107,24 +103,6 @@ public class TimeSheetBusiness {
return message; 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) { public List<TimeSheet> findTimeSheetByEmployeeId(int employeeId) {
Employee employee = employeeRepository.findEmployeeById(employeeId); Employee employee = employeeRepository.findEmployeeById(employeeId);
Eproject eproject = eProjectRepository.findEprojectByEmployee(employee); 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 @@ ...@@ -3,6 +3,7 @@
<a ui-sref="employees"></a> <a ui-sref="employees"></a>
<!-- <a ui-sref="report"></a>--> <!-- <a ui-sref="report"></a>-->
<!-- <a ui-sref="project"></a>--> <!-- <a ui-sref="project"></a>-->
<a ui-sref="timeSheet"></a>
<div ui-view="content"> <div ui-view="content">
</div> </div>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<div class="container-fluid"> <div class="container-fluid">
<!-- Content --> <!-- Content -->
<div ui-view="layout"> <div ui-view="content">
</div> </div>
<!-- footer --> <!-- footer -->
......
This diff is collapsed.
This diff is collapsed.
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<div class="table-title"> <div class="table-title">
<div class="row"> <div class="row">
<div class="col-sm-6"> <div class="col-sm-6">
<h2><b>Leave Form</b></h2> <h4><b>Leave Form</b></h4>
<label> <label>
Search: <input type="text" ng-model="search" placeholder="Search" style="color: black; margin: 10px"/> Search: <input type="text" ng-model="search" placeholder="Search" style="color: black; margin: 10px"/>
</label> </label>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-11">
<div id="addDivLF" style="display: none"> <div id="addDivLF" style="display: none">
<h2><b>Add Leave Form</b></h2> <h2><b>Add Leave Form</b></h2>
<table class="table table-striped table-hover"> <table class="table table-striped table-hover">
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<div class="table-title"> <div class="table-title">
<div class="row"> <div class="row">
<div class="col-sm-6"> <div class="col-sm-6">
<h2><b>TimeSheet</b></h2> <h4><b>TimeSheet</b></h4>
<label> <label>
Search: <input type="text" ng-model="search" placeholder="Search" style="color: black; margin: 10px"/> Search: <input type="text" ng-model="search" placeholder="Search" style="color: black; margin: 10px"/>
</label> </label>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-11">
<div id="addDivTS" style="display: none"> <div id="addDivTS" style="display: none">
<h2><b>Add TimeSheet</b></h2> <h2><b>Add TimeSheet</b></h2>
<table class="table table-striped table-hover"> <table class="table table-striped table-hover">
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <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>{{$index + 1}}</td>
<td>{{ts.title}}</td> <td>{{ts.title}}</td>
<td>{{ts.content}}</td> <td>{{ts.content}}</td>
...@@ -133,9 +133,9 @@ ...@@ -133,9 +133,9 @@
<td>{{ts.eproject.project.name}}</td> <td>{{ts.eproject.project.name}}</td>
<td>{{ts.updatedAt}}</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="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="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="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>
<!-- <tr>--> <!-- <tr>-->
<!-- <h6><code>rotate</code> defaulted to <code>true</code> and <code>force-ellipses</code> set to <code>true</code>:</h6>--> <!-- <h6><code>rotate</code> defaulted to <code>true</code> and <code>force-ellipses</code> set to <code>true</code>:</h6>-->
......
/* /*
*/ */
angular.module("MyTimeSheet").controller("timesheetController", function($scope, $http,$window) { angular.module("myApp").controller("timeSheetController", function($scope, $http, $state) {
console.log("Time Sheet controller"); console.log("Time Sheet controller");
$scope.ts = { $scope.ts = {
...@@ -19,7 +19,6 @@ angular.module("MyTimeSheet").controller("timesheetController", function($scope, ...@@ -19,7 +19,6 @@ angular.module("MyTimeSheet").controller("timesheetController", function($scope,
}; };
//get all time sheet //get all time sheet
//function getAllTimesheet(){
$http({ $http({
method: 'GET', method: 'GET',
url: "http://localhost:8080/eproject/timesheet/show" url: "http://localhost:8080/eproject/timesheet/show"
...@@ -29,8 +28,6 @@ angular.module("MyTimeSheet").controller("timesheetController", function($scope, ...@@ -29,8 +28,6 @@ angular.module("MyTimeSheet").controller("timesheetController", function($scope,
}, function errorCallback(response) { }, function errorCallback(response) {
console.log(response) console.log(response)
}); });
//}
//get all eproject //get all eproject
$http({ $http({
method: 'GET', method: 'GET',
...@@ -84,7 +81,6 @@ angular.module("MyTimeSheet").controller("timesheetController", function($scope, ...@@ -84,7 +81,6 @@ angular.module("MyTimeSheet").controller("timesheetController", function($scope,
} }
$scope.update = update; $scope.update = update;
function update() { function update() {
$http({ $http({
headers: "content-type: application/json", headers: "content-type: application/json",
...@@ -99,84 +95,4 @@ angular.module("MyTimeSheet").controller("timesheetController", function($scope, ...@@ -99,84 +95,4 @@ angular.module("MyTimeSheet").controller("timesheetController", function($scope,
$state.reload(); $state.reload();
}); });
} }
// $scope.myTimeSheets = [];
// $scope.save = save;
// $scope.currentPage = 1;
// $scope.timesheetPerPage = 3;
// $scope.maxSize = 5;
// this.myTimeSheets = $scope.myTimeSheets;
// $scope.numOfPage = numOfPage;
// $scope.dataHasLoaded = false;
// $scope.makeTimesheet = function () {
// $scope.myTimeSheets = [];
// for (let i = 1; i <=50 ; i++) {
// $scope.myTimeSheets.push( {text : 'ts'+ i , done:false});
// }
//
// };
// $scope.makeTimesheet();
// $scope.getAllTimesheet = getAllTimesheet;
// //$scope.getTotalTimesheet = getTotalTimesheet;
// getAllTimesheet();
// $scope.pageChangedIndex = pageChangedIndex;
// function pageChangedIndex() {
// console.log($scope.currentPage);
// }
// function numOfPage() {
// return Math.ceil($scope.myTimeSheets.length/ $scope.timesheetPerPage);
//
// }
}); });
// }).directive('pgnTable', ['$compile', function ($compile) {
// return {
// restrict: 'EA',
// templateUrl: 'pages/timesheet/timeSheet.html',
// replace: true,
// scope: {
// pages: "=pgnTable"
// },
// controller: function ($scope) {
// $scope.currentPage=1;
// $scope.numLimit=5;
// $scope.start = 0;
// $scope.$watch("pages",function(newVal){
// if(newVal){
// $scope.pages=Math.ceil($scope.pages.length/$scope.numLimit);
// }
// });
// $scope.hideNext=function(){
// if(($scope.start + $scope.numLimit) < $scope.pages.length){
// return false;
// }
// else
// return true;
// };
// $scope.hidePrev=function(){
// if($scope.start===0){
// return true;
// }
// else
// return false;
// };
// $scope.nextPage=function(){
// console.log("next pages");
// $scope.currentPage++;
// $scope.start=$scope.start+ $scope.numLimit;
// console.log( $scope.start)
// };
// $scope.PrevPage=function(){
// if($scope.currentPage>1){
// $scope.currentPage--;
// }
// console.log("next pages");
// $scope.start=$scope.start - $scope.numLimit;
// console.log( $scope.start)
// };
// },
// compile: function(elem) {
// return function(ielem, $scope) {
// $compile(ielem)($scope);
// };
// }
// };
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