Unverified Commit 48a6da9f authored by rsayannagari-nisum-com's avatar rsayannagari-nisum-com Committed by GitHub

Merge pull request #3 from nisum-inc/MT-43

MT-43[Rajeshekar]:Updated Manage Employee to update location
parents 3a919a10 6a08ed6e
......@@ -55,6 +55,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope.parentData.employeeName = row.entity.employeeName;
$scope.parentData.emailId = row.entity.emailId;
$scope.parentData.role = row.entity.role;
$scope.parentData.empLocation = row.entity.empLocation;
if(action == "Update")
$scope.assignRole(action, $scope.parentData);
else if(action == "Delete")
......@@ -220,15 +221,18 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope.empName = "";
$scope.empRole;
$scope.empEmail = "";
$scope.empLocation = "";
$scope.isDisabled = false;
}else if(dataToPass.action == "Update"){
$scope.empId = dataToPass.employeeId;
$scope.empName = dataToPass.employeeName;
$scope.empRole = dataToPass.role;
$scope.empEmail = dataToPass.emailId;
$scope.empLocation = dataToPass.empLocation;
$scope.isDisabled = true;
}
$scope.roles = ["Delivery Manager","Director","Employee","HR","HR Manager","Lead","Manager"];
$scope.locations=myFactory.getLocations();
$scope.getSelectedRole = function(){
if ($scope.empRole !== undefined) {
return $scope.empRole;
......@@ -236,7 +240,13 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
return "Please select a role";
}
};
$scope.getSelectedLocation = function(){
if ($scope.empLocation !== undefined) {
return $scope.empLocation;
} else {
return "Please select a location";
}
};
$scope.validateEmpId = function(){
var searchId = $scope.empId;
if(searchId != "" && isNaN(searchId)){
......@@ -314,7 +324,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
document.getElementById('empRole').focus();
}else{
$scope.alertMsg = "";
var record = {"employeeId":$scope.empId, "employeeName": $scope.empName, "emailId": $scope.empEmail, "role": $scope.empRole};
var record = {"employeeId":$scope.empId, "employeeName": $scope.empName, "emailId": $scope.empEmail, "role": $scope.empRole, "empLocation": $scope.empLocation};
addOrUpdateRole(record, $scope.templateTitle);
$timeout(function(){updateGrid($scope.templateTitle, record)},500);
}
......
......@@ -26,6 +26,10 @@
<md-select ng-model="empShift" md-selected-text="getSelectedShift()" id="empShift" ng-disabled="isDisabled" style="display:none">
<md-optgroup label="shifts"> <md-option ng-value="shift"
ng-repeat="shift in shifts">{{shift}}</md-option> </md-optgroup> </md-select>
<md-select ng-model="empLocation" md-selected-text="getSelectedLocation()" id="empLocation">
<md-optgroup label="locations"> <md-option ng-value="location"
ng-repeat="location in locations">{{location}}</md-option> </md-optgroup> </md-select>
<div role="alert">
<span class="error" style="color: red;">{{alertMsg}}</span>
</div>
......
......@@ -50,15 +50,7 @@
</div>
</div>
<div class="col-lg-1"
style="cursor: pointer; float: right; right: 75px;">
<md-button class="md-raised md-primary"
style="width:142px;background: cadetblue;"
ng-click="assignRole('Add', parentData)"> <i
class="fa fa-plus-circle fa-2x"
style="margin-top: 5px; font-size: 1.5em; float: left"></i> Add
Employee</md-button>
</div>
</div>
<div class="row col-lg-12" style="height: 15px;"></div>
<div class="row col-lg-12" style="margin-left: 0px;">
......
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