Commit 337099ad authored by Muneer Alam's avatar Muneer Alam

Handled Service side exception as well as client side validation when user...

Handled Service side exception as well as client side validation when user does not enter empId and time
parent c8ec5347
...@@ -78,7 +78,9 @@ public class EmployeeDataService implements IEmployeeDataService { ...@@ -78,7 +78,9 @@ public class EmployeeDataService implements IEmployeeDataService {
query = MyTimeUtils.LOGIN_REPORT_BY_TIME + "'" + fromDateTime + "'" + MyTimeUtils.LOGIN_REPORT_BY_TIME2 + "'" query = MyTimeUtils.LOGIN_REPORT_BY_TIME + "'" + fromDateTime + "'" + MyTimeUtils.LOGIN_REPORT_BY_TIME2 + "'"
+ toDateTime + "'" + MyTimeUtils.LOGIN_REPORT_BY_TIME3 + employeeId + MyTimeUtils.LOGIN_REPORT_BY_TIME4; + toDateTime + "'" + MyTimeUtils.LOGIN_REPORT_BY_TIME3 + employeeId + MyTimeUtils.LOGIN_REPORT_BY_TIME4;
resultSetData = executeQuery(query, 2); resultSetData = executeQuery(query, 2);
if (resultSetData.size() > 0) {
listOfEmpLoginDetails.add(resultSetData.get(0)); listOfEmpLoginDetails.add(resultSetData.get(0));
}
MyTimeLogger.getInstance().info( MyTimeLogger.getInstance().info(
" Time Taken fecth Employee data based on Dates ::: " + (System.currentTimeMillis() - start_ms)); " Time Taken fecth Employee data based on Dates ::: " + (System.currentTimeMillis() - start_ms));
} }
......
...@@ -113,7 +113,26 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial ...@@ -113,7 +113,26 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial
} }
$scope.generateReport = function(){ $scope.generateReport = function(){
debugger; var isValid = true;
if ($scope.isOverride) {
var validationMessage = 'Please Enter ';
if ($scope.searchId == "") {
isValid = false;
validationMessage = validationMessage + 'Employee ID';
}
if ($scope.fromTime == undefined || $scope.toTime == undefined) {
if (!isValid) {
validationMessage = validationMessage + ', ';
}
validationMessage = validationMessage + 'FromTime and ToTime';
isValid = false;
}
if (!isValid) {
showAlert(validationMessage);
}
}
if (isValid) {
deletePreviousReport(); deletePreviousReport();
$scope.pdfUrl = ""; $scope.pdfUrl = "";
$scope.reportMsg =""; $scope.reportMsg ="";
...@@ -126,6 +145,7 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial ...@@ -126,6 +145,7 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial
generatePdfReport(parentData); generatePdfReport(parentData);
showProgressDialog(); showProgressDialog();
$timeout(function(){previewPdfReport();},6000); $timeout(function(){previewPdfReport();},6000);
}
}; };
function changeTime(time) { function changeTime(time) {
...@@ -192,7 +212,6 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial ...@@ -192,7 +212,6 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial
} }
function generatePdfReport(data){ function generatePdfReport(data){
debugger;
var empId = ""; var empId = "";
if(data.empId == ""){ if(data.empId == ""){
empId = 0; empId = 0;
......
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