Commit a0ec8f72 authored by Shiva's avatar Shiva

MT-52 Done the validation for Add team mate page.

parent 5c8c121a
...@@ -45,6 +45,7 @@ dependencies { ...@@ -45,6 +45,7 @@ dependencies {
compile('org.quartz-scheduler:quartz:2.2.1') compile('org.quartz-scheduler:quartz:2.2.1')
compile('org.quartz-scheduler:quartz:2.3.0') compile('org.quartz-scheduler:quartz:2.3.0')
compile group: 'org.springframework.boot', name: 'spring-boot-starter-test', version:'1.5.8.RELEASE' compile group: 'org.springframework.boot', name: 'spring-boot-starter-test', version:'1.5.8.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat'
testCompile ('junit:junit:4.12') testCompile ('junit:junit:4.12')
compile('net.sf.ucanaccess:ucanaccess:4.0.1') compile('net.sf.ucanaccess:ucanaccess:4.0.1')
testCompile('org.hsqldb:hsqldb') testCompile('org.hsqldb:hsqldb')
...@@ -54,6 +55,6 @@ dependencies { ...@@ -54,6 +55,6 @@ dependencies {
compile('com.jcraft:jsch:0.1.46') compile('com.jcraft:jsch:0.1.46')
compile('com.itextpdf:itextpdf:5.0.6') compile('com.itextpdf:itextpdf:5.0.6')
compile('jcifs:jcifs:1.3.17') compile('jcifs:jcifs:1.3.17')
compile('javax.servlet:servlet-api') testCompile('javax.servlet:servlet-api')
} }
\ No newline at end of file
...@@ -89,7 +89,7 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -89,7 +89,7 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
$scope.parentData.mobileNumber = row.entity.mobileNumber; $scope.parentData.mobileNumber = row.entity.mobileNumber;
$scope.parentData.startDate = row.entity.startDate; $scope.parentData.startDate = row.entity.startDate;
$scope.parentData.endDate = row.entity.endDate; $scope.parentData.endDate = row.entity.endDate;
if(action == "Update"){ if(action == "Update"){
$scope.updateEmployee(action, $scope.parentData); $scope.updateEmployee(action, $scope.parentData);
} }
...@@ -313,6 +313,9 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -313,6 +313,9 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
$scope.empName = ""; $scope.empName = "";
$scope.empRole; $scope.empRole;
$scope.empShift; $scope.empShift;
$scope.empBillableStatus;
$scope.startDate;
$scope.endDate;
$scope.empEmail = ""; $scope.empEmail = "";
$scope.isDisabled = false; $scope.isDisabled = false;
}else if(dataToPass.action == "Update"){ }else if(dataToPass.action == "Update"){
...@@ -575,13 +578,6 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -575,13 +578,6 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
return "Please select a designation"; return "Please select a designation";
} }
}; };
$scope.getSelectedBillableStatus = function(){
if ($scope.empBillableStatus !== undefined) {
return $scope.empBillableStatus;
} else {
return "Please select a billable status";
}
};
$scope.getEmployeeSelected = function(){ $scope.getEmployeeSelected = function(){
if ($scope.employeeModel !== undefined) { if ($scope.employeeModel !== undefined) {
$scope.employee=$scope.employeeModel; $scope.employee=$scope.employeeModel;
...@@ -605,8 +601,13 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -605,8 +601,13 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
return "Please select a shift"; return "Please select a shift";
} }
}; };
$scope.getSelectedBillableStatus = function(){
if ($scope.empBillableStatus !== undefined) {
return $scope.empBillableStatus;
} else {
return "Please select a billable status";
}
};
$scope.validateFields = function(action){ $scope.validateFields = function(action){
if(action == "Add"){ if(action == "Add"){
var employeeModel = $scope.employeeModel; var employeeModel = $scope.employeeModel;
...@@ -620,7 +621,17 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -620,7 +621,17 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
}else if(employeeModel != undefined && projectModel != undefined }else if(employeeModel != undefined && projectModel != undefined
&& getExistingRecordProjectStatus(employeeModel.employeeId, projectModel.projectName)){ && getExistingRecordProjectStatus(employeeModel.employeeId, projectModel.projectName)){
$scope.alertMsg = "Employee is already assigned to the selected project"; $scope.alertMsg = "Employee is already assigned to the selected project";
} else { }else if($scope.empBillableStatus == undefined){
$scope.alertMsg = "Please select a billable status";
document.getElementById('empBillableStatus').focus();
}else if($scope.startDate == undefined) {
$scope.alertMsg = "Please select StartDate";
document.getElementById('startDate').focus();
}else if($scope.endDate == undefined) {
$scope.alertMsg = "Please select EndDate";
document.getElementById('endDate').focus();
}
else {
$scope.alertMsg = ""; $scope.alertMsg = "";
var record = {"employeeId":employeeModel.employeeId, "employeeName":employeeModel.employeeName, "emailId": employeeModel.emailId, "role": employeeModel.role, "designation":employeeModel.designation,"shift": employeeModel.shift,"projectId":projectModel.projectId,"projectName":projectModel.projectName,"account":$scope.projectModel.account,"managerId":myFactory.getEmpId(),"managerName":myFactory.getEmpName(),"mobileNumber":employeeModel.mobileNumber,"active":true,"billableStatus":$scope.empBillableStatus,"startDate":$scope.startDate,"endDate":$scope.endDate}; var record = {"employeeId":employeeModel.employeeId, "employeeName":employeeModel.employeeName, "emailId": employeeModel.emailId, "role": employeeModel.role, "designation":employeeModel.designation,"shift": employeeModel.shift,"projectId":projectModel.projectId,"projectName":projectModel.projectName,"account":$scope.projectModel.account,"managerId":myFactory.getEmpId(),"managerName":myFactory.getEmpName(),"mobileNumber":employeeModel.mobileNumber,"active":true,"billableStatus":$scope.empBillableStatus,"startDate":$scope.startDate,"endDate":$scope.endDate};
addOrUpdateRole(record, $scope.templateTitle); addOrUpdateRole(record, $scope.templateTitle);
......
...@@ -28,11 +28,11 @@ ...@@ -28,11 +28,11 @@
<md-select ng-model="empBillableStatus" md-selected-text="getSelectedBillableStatus()" id="empBillableStatus"> <md-select ng-model="empBillableStatus" md-selected-text="getSelectedBillableStatus()" id="empBillableStatus">
<md-optgroup label="billable statuses"> <md-option ng-value="billableStatus" <md-optgroup label="billable statuses"> <md-option ng-value="billableStatus"
ng-repeat="billableStatus in billableStatuses">{{billableStatus}}</md-option> </md-optgroup> </md-select> ng-repeat="billableStatus in billableStatuses">{{billableStatus}}</md-option> </md-optgroup> </md-select>
<md-datepicker ng-model="startDate" md-placeholder="Start Date" <md-datepicker ng-model="startDate" md-placeholder="Start Date" id ="startDate"
md-min-date="minDate" md-max-date="maxDate" md-min-date="minDate" md-max-date="maxDate"
onkeydown="return false" onkeydown="return false"
></md-datepicker></br> ></md-datepicker></br>
<md-datepicker ng-model="endDate" md-placeholder="Projected End Date" <md-datepicker ng-model="endDate" md-placeholder="Projected End Date" id="endDate"
md-min-date="minDate" md-max-date="maxDate" md-min-date="minDate" md-max-date="maxDate"
onkeydown="return false" onkeydown="return false"
></md-datepicker> ></md-datepicker>
......
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