Commit 227b27a6 authored by vsunke-nisum-com's avatar vsunke-nisum-com Committed by tdutta-nisum-com

MT-129 (#140)

* MT-129

* MT-129
parent 3705b14d
...@@ -321,13 +321,40 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -321,13 +321,40 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
return false; return false;
} }
$scope.validateEmpId = function(){
var empId = $scope.empId;
if(empId == ""){
$scope.alertMsg = "";
document.getElementById('empId').focus();
$scope.alertMsg = "";
}else{
$scope.alertMsg = "";
}
}
$scope.validateMessage = function() {
$scope.errorMessage = false;
}
$scope.validateEmpName = function(){
var empName = $scope.empName;
if(empName == ""){
$scope.alertMsg = "";
document.getElementById('empName').focus();
$scope.alertMsg = "";
}else{
$scope.alertMsg = "";
}
}
$scope.validateEmailId = function(){ $scope.validateEmailId = function(){
var emailId = $scope.empEmail; var emailId = $scope.empEmail;
if(emailId != "" && !validateEmail(emailId)){ if(emailId != "" && !validateEmail(emailId)){
$scope.alertMsg = "Please enter a valid nisum email id"; $scope.alertMsg = "Please enter a valid nisum email id";
document.getElementById('empEmail').focus(); document.getElementById('empEmail').focus();
}else{ }else{
$scope.alertMsg = "Email ID is mandatory"; //$scope.alertMsg = "Email ID is mandatory";
$scope.alertMsg = "";
} }
} }
...@@ -455,6 +482,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -455,6 +482,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
} }
} }
$scope.errorMessage = true;
}; };
isDataUpdated = function(){ isDataUpdated = function(){
......
...@@ -23,18 +23,18 @@ ...@@ -23,18 +23,18 @@
<td colspan="4"><b>Emp ID:</b><span class="mandatory"></span></td> <td colspan="4"><b>Emp ID:</b><span class="mandatory"></span></td>
<td colspan="8"><input type="text" class="form-control" <td colspan="8"><input type="text" class="form-control"
id="empId" name="empId" ng-model="empId" id="empId" name="empId" ng-model="empId"
placeholder="Employee ID" ng-blur="validateEmpId()" placeholder="Employee ID" ng-blur="validateEmpId()"
ng-disabled="isDisabled" /></td> ng-disabled="isDisabled" /></td><!-- ng-blur="validateEmpId()'' -->
<tr> <tr>
<tr> <tr>
<td colspan="4"><b>Employee Name:</b><span class="mandatory"></span></td> <td colspan="4"><b>Employee Name:</b><span class="mandatory"></span></td>
<td colspan="8"><input type="text" class="form-control" <td colspan="8"><input type="text" class="form-control"
id="empName" name="empName" ng-model="empName" id="empName" name="empName" ng-model="empName"
placeholder="Employee Name" /></td> placeholder="Employee Name" ng-blur="validateEmpName()"/></td><!-- ng-blur="validateEmpName()"-->
</tr> </tr>
<tr> <tr>
<td colspan="-10"><b>Gender:</b><span class="mandatory"></span></td> <td colspan="-10"><b>Gender:</b><span class="mandatory"></span></td>
<td colspan="8"><md-select ng-model="gender" <td colspan="8"><md-select ng-model="gender" ng-blur="validateMessage()"
md-selected-text="getSelectedGender()" id="gender"> md-selected-text="getSelectedGender()" id="gender">
<md-option ng-model="gender" value="Male">Male </md-option> <md-option <md-option ng-model="gender" value="Male">Male </md-option> <md-option
ng-model="gender" value="Female">Female</md-option> </md-select></td> ng-model="gender" value="Female">Female</md-option> </md-select></td>
...@@ -45,14 +45,14 @@ ...@@ -45,14 +45,14 @@
<td colspan="8"><input type="text" class="form-control" <td colspan="8"><input type="text" class="form-control"
id="empEmail" name="empEmail" ng-model="empEmail" id="empEmail" name="empEmail" ng-model="empEmail"
placeholder="Email ID" ng-blur="validateEmailId()" placeholder="Email ID" ng-blur="validateEmailId()"
ng-disabled="isDisabled" style="text-transform: lowercase;"/></td> ng-disabled="isDisabled" style="text-transform: lowercase;"/></td><!--ng-blur="validateEmailId()"-->
</tr> </tr>
<tr> <tr>
<td colspan="4"><b>Date of Joining:</b><span class="mandatory"></span></td> <td colspan="4"><b>Date of Joining:</b><span class="mandatory"></span></td>
<td colspan="8"><md-datepicker ng-model="dateOfJoining" id="dateOfJoining" <td colspan="8"><md-datepicker ng-model="dateOfJoining" id="dateOfJoining"
md-placeholder="Date of Joining" md-min-date="minDate" id="dateOfBirth" md-placeholder="Date of Joining" md-min-date="minDate" id="dateOfBirth"
md-max-date="maxDate" onkeydown="return false"></md-datepicker> md-max-date="maxDate" onkeydown="return false" ng-blur="validateMessage()"></md-datepicker>
</td> </td>
</tr> </tr>
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
<tr> <tr>
<td colspan="12"> <td colspan="12">
<div role="alert"> <div role="alert">
<span class="error" style="color: red;">{{alertMsg}}</span> <span ng-if="errorMessage" class="error" style="color: red;">{{alertMsg}}</span>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
</div> </div>
<!--form-group--> <!--form-group-->
</div> </div>
<!---col-lg-4 col-md-4 col-sm-4 col-xs-12--> <!---col-lg-4 col-md-4 col-sm-4 col-xs-12-->
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12"> <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<h4>Organization Info</h4> <h4>Organization Info</h4>
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<tr> <tr>
<td colspan="4"><b>Functional Group:</b><span class="mandatory"></span></td> <td colspan="4"><b>Functional Group:</b><span class="mandatory"></span></td>
<td colspan="8"><md-select ng-model="functionalGroup" <td colspan="8"><md-select ng-blur="validateMessage()" ng-model="functionalGroup"
md-selected-text="getSelectedFunctionalGroup()" md-selected-text="getSelectedFunctionalGroup()"
id="functionalGroup"> <md-optgroup id="functionalGroup"> <md-optgroup
label="Functional Org"> <md-option label="Functional Org"> <md-option
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
<tr> <tr>
<td colspan="4"><b>Designation:</b><span class="mandatory"></span></td> <td colspan="4"><b>Designation:</b><span class="mandatory"></span></td>
<td colspan="8"><md-select ng-model="designation" <td colspan="8"><md-select ng-model="designation" ng-blur="validateMessage()"
md-selected-text="getDesignationText()" id="designation"> md-selected-text="getDesignationText()" id="designation">
<md-optgroup label="designations"> <md-option <md-optgroup label="designations"> <md-option
ng-value="designation" ng-repeat="designation in designations">{{designation}}</md-option> ng-value="designation" ng-repeat="designation in designations">{{designation}}</md-option>
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
<tr> <tr>
<td colspan="4"><b>Work Location:</b><span class="mandatory"></span></td> <td colspan="4"><b>Work Location:</b><span class="mandatory"></span></td>
<td colspan="8"><md-select ng-model="empLocation" <td colspan="8"><md-select ng-model="empLocation" ng-blur="validateMessage()"
md-selected-text="getSelectedLocation()" id="empLocation"> md-selected-text="getSelectedLocation()" id="empLocation">
<md-optgroup label="locations"> <md-option <md-optgroup label="locations"> <md-option
ng-value="location" ng-repeat="location in locations">{{location}}</md-option> ng-value="location" ng-repeat="location in locations">{{location}}</md-option>
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
<tr> <tr>
<td colspan="4"><b>Employment Type:</b><span class="mandatory"></span></td> <td colspan="4"><b>Employment Type:</b><span class="mandatory"></span></td>
<td colspan="8"><md-select ng-model="employmentType" <td colspan="8"><md-select ng-model="employmentType" ng-blur="validateMessage()"
md-selected-text="getSelectedEmploymentType()" md-selected-text="getSelectedEmploymentType()"
id="employmentType"> <md-optgroup id="employmentType"> <md-optgroup
label="Employment Type"> <md-option label="Employment Type"> <md-option
...@@ -159,8 +159,8 @@ ...@@ -159,8 +159,8 @@
</tr> --> </tr> -->
<tr> <tr>
<td colspan="4"><b>App Role:</b></td> <td colspan="4"><b>Org Role:</b><span class="mandatory"></span></td>
<td colspan="8"><md-select ng-model="empRole" <td colspan="8"><md-select ng-model="empRole" ng-blur="validateMessage()"
md-selected-text="getSelectedRole()" id="empRole"> <md-optgroup md-selected-text="getSelectedRole()" id="empRole"> <md-optgroup
label="roles"> <md-option ng-value="role" label="roles"> <md-option ng-value="role"
ng-repeat="role in roles">{{role}}</md-option> </md-optgroup> </md-select></td> ng-repeat="role in roles">{{role}}</md-option> </md-optgroup> </md-select></td>
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
<tr> <tr>
<td colspan="1"><b>HasPassport:</b><span class="mandatory"></span></td> <td colspan="1"><b>HasPassport:</b><span class="mandatory"></span></td>
<td colspan="8"><md-select ng-model="hasPassort" <td colspan="8"><md-select ng-model="hasPassort" ng-blur="validateMessage()"
id="hasPassort"> <md-option ng-model="hasPassort" id="hasPassort"> <md-option ng-model="hasPassort"
value="Yes">Yes </md-option> <md-option ng-model="hasPassort" value="Yes">Yes </md-option> <md-option ng-model="hasPassort"
value="No">No</md-option> </md-select></td> value="No">No</md-option> </md-select></td>
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
<tr> <tr>
<td colspan="1"><b>Has B1 Visa:</b><span class="mandatory"></span></td> <td colspan="1"><b>Has B1 Visa:</b><span class="mandatory"></span></td>
<td colspan="8"><md-select ng-model="hasB1" id="hasB1"> <td colspan="8"><md-select ng-model="hasB1" id="hasB1" ng-blur="validateMessage()">
<md-option ng-model="hasB1" value="Yes">Yes </md-option> <md-option <md-option ng-model="hasB1" value="Yes">Yes </md-option> <md-option
ng-model="hasB1" value="No">No</md-option> </md-select></td> ng-model="hasB1" value="No">No</md-option> </md-select></td>
</tr> </tr>
......
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