Showing
4 changed files
400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs
... | ... | @@ -207,13 +207,28 @@ namespace AIAHTML5.ADMIN.API.Controllers |
207 | 207 | UserEntity.CreatorId = jsonUserData["Modifiedby"].Value<int>(); |
208 | 208 | |
209 | 209 | JToken typeToken= jsonUserData["DeactivationDate"]; |
210 | - if (typeToken.Type != JTokenType.Null) | |
211 | - { | |
212 | - UserEntity.DeactivationDate = typeToken.Value<DateTime>(); | |
213 | - } | |
214 | 210 | |
215 | 211 | try |
216 | 212 | { |
213 | + try | |
214 | + { | |
215 | + if (typeToken.Type != JTokenType.Null) | |
216 | + { | |
217 | + string dateString=typeToken.Value<String>(); | |
218 | + if(!string.IsNullOrWhiteSpace(dateString)) | |
219 | + { | |
220 | + UserEntity.DeactivationDate = typeToken.Value<DateTime>(); | |
221 | + } | |
222 | + | |
223 | + } | |
224 | + } | |
225 | + catch (Exception ex) | |
226 | + { | |
227 | + // Log exception code goes here | |
228 | + return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex.Message); | |
229 | + } | |
230 | + | |
231 | + | |
217 | 232 | Status = UserModel.UpdateUser(dbContext, UserEntity); |
218 | 233 | if (Status.Equals("1")) |
219 | 234 | { | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -389,7 +389,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
389 | 389 | var imagePath = "~/../content/images/DA/" + zoomValue + "/body-views/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage; |
390 | 390 | |
391 | 391 | |
392 | - var $el = $('<div id=' + value._id + ' class="col-sm-3 col-lg-2" title = ' + value._title + ' data-ng-click="openView($event)"><div class="thumbnail" >' | |
392 | + var $el = $('<div id=' + value._id + ' class="col-sm-3 col-lg-2" title = ' + value._title + ' data-ng-click="openView($event)"><div class="thumbnail" ><a href="#">' | |
393 | 393 | + '<img class= "daImg" id="' + value._title + '" src="' + imagePath + '" alt="" title="" >' |
394 | 394 | + '<div class="caption"><p>' + value._title + '</p></div></a></div></div>').appendTo('#bodyViewList'); |
395 | 395 | |
... | ... | @@ -1163,15 +1163,15 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
1163 | 1163 | la =$scope.GetwindowStoreData(windviewid,'totalLayers'); |
1164 | 1164 | var slideVal = la - ui.value; |
1165 | 1165 | $("#txtLayerNumberDA_" + windviewid).val(slideVal); |
1166 | - | |
1166 | + if ($scope.GetwindowStoreData(windviewid, 'isTransparent')) { | |
1167 | + $scope.SetwindowStoreData(windowviewid, 'layerNumberTransparency', slideVal); | |
1168 | + } | |
1167 | 1169 | $scope.SetwindowStoreData(windviewid,'layerNumber',slideVal); |
1168 | 1170 | scope.LayerChange(windviewid); |
1169 | 1171 | $("#annotationpaintbrushsize").removeClass("activebtncolor"); |
1170 | 1172 | $("#annotationpainteraser").removeClass("activebtncolor"); |
1171 | 1173 | |
1172 | - if ($scope.GetwindowStoreData(windviewid, 'isTransparent')) { | |
1173 | - $scope.SetwindowStoreData(windowviewid, 'layerNumberTransparency', slideVal); | |
1174 | - } | |
1174 | + | |
1175 | 1175 | }); |
1176 | 1176 | }, |
1177 | 1177 | |
... | ... | @@ -2043,6 +2043,20 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
2043 | 2043 | |
2044 | 2044 | $('#zoomValueDA_' + windowviewid).attr('value', $scope.GetwindowStoreData(windowviewid,'zoomInOut')); |
2045 | 2045 | |
2046 | + var lastlayer=$scope.GetwindowStoreData(windowviewid,'layerNumber'); | |
2047 | + | |
2048 | + if ($scope.GetwindowStoreData(windowviewid, 'isTransparent')) { | |
2049 | + lastlayer = $scope.GetwindowStoreData(windowviewid, 'layerNumberBeforeTBDraw'); | |
2050 | + $scope.SetwindowStoreData(windowviewid, 'layerNumber', lastlayer); | |
2051 | + } | |
2052 | + else | |
2053 | + { | |
2054 | + var totalayer=$scope.GetwindowStoreData(windowviewid,'totalLayers'); | |
2055 | + var sliderVal = parseInt(totalayer) - parseInt(lastlayer); | |
2056 | + $('#txtLayerNumberDA_' + windowviewid).val(lastlayer); | |
2057 | + $("#layerChangeSliderDA_" + windowviewid).slider("option", "value", sliderVal); | |
2058 | + } | |
2059 | + | |
2046 | 2060 | if (bodyRegionCoordinates != null || bodyRegionCoordinates != undefined) { |
2047 | 2061 | angular.forEach(bodyRegionCoordinates, function (value, key) { |
2048 | 2062 | |
... | ... | @@ -2181,20 +2195,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
2181 | 2195 | var src = "content/images/DA/" + zoomValue + "/body-views/" + bodyVid + "/layers/0/" + value._BodyRegionId + "/" + $scope.figLaefImageName; |
2182 | 2196 | |
2183 | 2197 | $scope.DrawImage(rectangle.scaledHeight, rectangle.scaledWidth, rectangle.scaledX, rectangle.scaledY, src, 'modestyImg' + value._BodyRegionId, 'N', windowviewid) |
2184 | - var lastlayer=$scope.GetwindowStoreData(windowviewid,'layerNumber'); | |
2185 | - | |
2186 | - if ($scope.GetwindowStoreData(windowviewid, 'isTransparent')) { | |
2187 | - lastlayer = $scope.GetwindowStoreData(windowviewid, 'layerNumberBeforeTBDraw'); | |
2188 | - $scope.SetwindowStoreData(windowviewid, 'layerNumber', lastlayer); | |
2189 | - } | |
2190 | - else | |
2191 | - { | |
2192 | - var totalayer=$scope.GetwindowStoreData(windowviewid,'totalLayers'); | |
2193 | - var sliderVal = parseInt(totalayer) - parseInt(lastlayer); | |
2194 | - $('#txtLayerNumberDA_' + windowviewid).val(lastlayer); | |
2195 | - $("#layerChangeSliderDA_" + windowviewid).slider("option", "value", sliderVal); | |
2196 | - } | |
2197 | - | |
2198 | + | |
2198 | 2199 | if ((parseInt(dtlOfSktn[0]._lns) <= parseInt(lastlayer)) && (parseInt(dtlOfSktn[0]._lne) > parseInt(lastlayer)) && (dtlOfSktn[0]._isfr == 'Y')) { |
2199 | 2200 | $rootScope.isLayerLessSeven = true; // using at home |
2200 | 2201 | var ModestyValue=$scope.GetwindowStoreData(windowviewid,'ModestyValue'); |
... | ... | @@ -6784,16 +6785,18 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
6784 | 6785 | var WidthforTransImage = TBImageDimensions.WidthforTransImageTB; |
6785 | 6786 | var HeightforTransImage = TBImageDimensions.HeightforTransImageTB; |
6786 | 6787 | var YforTransImage = TBImageDimensions.YforTransImageTB; |
6787 | - | |
6788 | + var tranparencyLayer; | |
6788 | 6789 | //0. get current layer number |
6789 | 6790 | if (isResized || isLayerChanged) { |
6790 | 6791 | //do nothing |
6791 | 6792 | $scope.SetwindowStoreData(windowviewid,'transNumber',100); |
6792 | 6793 | $("#tbSlider_" + windowviewid).slider('value', 100); |
6794 | + if ($scope.GetwindowStoreData(windowviewid, "isTransparencyActivated") == true && $scope.GetwindowStoreData(windowviewid, "isTransparent") == true) { | |
6795 | + tranparencyLayer = $scope.GetwindowStoreData(windowviewid, 'layerNumberTransparency'); | |
6796 | + } | |
6793 | 6797 | |
6794 | 6798 | } |
6795 | - else { | |
6796 | - var tranparencyLayer; | |
6799 | + else { | |
6797 | 6800 | if ($scope.GetwindowStoreData(windowviewid, "isTransparencyActivated") == true && (($scope.GetwindowStoreData(windowviewid, "isNormalBtnClicked") == true || $scope.GetwindowStoreData(windowviewid, "isHighlightlBtnClicked") == true)) ){ |
6798 | 6801 | tranparencyLayer = parseInt($('#txtLayerNumberDA_' + windowviewid).val()); |
6799 | 6802 | $scope.SetwindowStoreData(windowviewid, 'isNormalBtnClicked', false); |
... | ... | @@ -6817,6 +6820,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
6817 | 6820 | $scope.SetwindowStoreData(windowviewid,'layerNumber',tranparencyLayer); |
6818 | 6821 | $scope.SetwindowStoreData(windowviewid, 'layerNumberTransparency', tranparencyLayer); |
6819 | 6822 | } |
6823 | + | |
6820 | 6824 | var totalayer=$scope.GetwindowStoreData(windowviewid,'totalLayers'); |
6821 | 6825 | var sliderVal = parseInt(totalayer) - parseInt(tranparencyLayer); |
6822 | 6826 | ... | ... |
400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html
... | ... | @@ -301,7 +301,7 @@ |
301 | 301 | <div class="form-group"> |
302 | 302 | <label for="inputEmail3" class="col-sm-5 control-label">Deactivation Date :</label> |
303 | 303 | <div class="col-sm-7"> |
304 | - <input class="form-control input-sm" id="DeactivationDate" placeholder="" type="text" formControlName="DeactivationDate"> | |
304 | + <input class="form-control input-sm" id="DeactivationDate" placeholder="" type="text" formControlName="DeactivationDate" (keydown.space)="$event.preventDefault();"> | |
305 | 305 | <!-- <div *ngIf="!adduserFrm.controls.DeactivationDate.valid && adduserFrm.controls.DeactivationDate.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;"></div> --> |
306 | 306 | </div> |
307 | 307 | </div> | ... | ... |
400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts
... | ... | @@ -53,7 +53,6 @@ export class UsersList implements OnInit, AfterViewChecked { |
53 | 53 | selectedId: number = 0; |
54 | 54 | divClass: string; |
55 | 55 | isActive: boolean; |
56 | - deaDateblank:boolean; | |
57 | 56 | NoRecord: string; |
58 | 57 | checkedRecords: Array<number>; |
59 | 58 | UncheckedRecords: Array<number>; |
... | ... | @@ -102,7 +101,8 @@ export class UsersList implements OnInit, AfterViewChecked { |
102 | 101 | ModifiedDate: [''], |
103 | 102 | Createdby: [''], |
104 | 103 | Modifiedby: [''], |
105 | - DeactivationDate: ['',this.noWhitespaceValidator], | |
104 | + DeactivationDate: [''], | |
105 | + //DeactivationDate: ['',this.noWhitespaceValidator], | |
106 | 106 | isActive: [false], |
107 | 107 | UserStatusActive: ['false'], |
108 | 108 | UserStatusInActive:[''] |
... | ... | @@ -341,7 +341,6 @@ export class UsersList implements OnInit, AfterViewChecked { |
341 | 341 | this.bindUsers(x); |
342 | 342 | }, error => this.error = <any>error); |
343 | 343 | |
344 | - //this.adduserFrm.controls['DeactivationDate'].setValue(this.datePipe.transform(this.UserEntity.DeactivationDate, 'MM/dd/yyyy')) | |
345 | 344 | if (this.UserEntity.UserStatus == 'Active') { |
346 | 345 | this.adduserFrm.controls['UserStatusActive'].setValue('true') |
347 | 346 | } |
... | ... | @@ -355,9 +354,7 @@ export class UsersList implements OnInit, AfterViewChecked { |
355 | 354 | |
356 | 355 | } |
357 | 356 | bindUsers(data) { |
358 | - | |
359 | - //console.log(data); | |
360 | - //alert(JSON.stringify(data)); | |
357 | + | |
361 | 358 | this.UserDetailEntity = data[0]; |
362 | 359 | this.adduserFrm.controls['DeactivationDate'].setValue(this.datePipe.transform(this.UserDetailEntity.DeactivationDate, 'MM/dd/yyyy')) |
363 | 360 | this.adduserFrm.controls['Createdby'].setValue(this.UserDetailEntity.Createdby) |
... | ... | @@ -378,6 +375,7 @@ export class UsersList implements OnInit, AfterViewChecked { |
378 | 375 | //this.managerightFrm.contains['UserId'].setValue(this.UserEntity.Id); |
379 | 376 | |
380 | 377 | } |
378 | + | |
381 | 379 | |
382 | 380 | public UpdateUser() { |
383 | 381 | this.alerts = ''; |
... | ... | @@ -401,21 +399,16 @@ export class UsersList implements OnInit, AfterViewChecked { |
401 | 399 | if (this.adduserFrm.value.FirstName == '') { |
402 | 400 | this.alerts += '</br><span>First Name is required.</span>'; |
403 | 401 | } |
404 | - this.deaDateblank=false; | |
405 | - if (this.adduserFrm.value.DeactivationDate == '' ||this.adduserFrm.value.DeactivationDate == null) { | |
406 | - this.deaDateblank=true; | |
407 | - //set date to pass from validation and later remove | |
408 | - this.adduserFrm.controls['DeactivationDate'].setValue('01/01/2020'); | |
402 | + if (this.adduserFrm.value.DeactivationDate != null) { | |
403 | + if(this.adduserFrm.value.DeactivationDate.trim() == '') | |
404 | + { | |
405 | + this.adduserFrm.controls['DeactivationDate'].setValue(null); | |
406 | + } | |
409 | 407 | } |
410 | 408 | |
411 | 409 | |
412 | 410 | if (this.adduserFrm.valid && this.alerts == '') { |
413 | 411 | this.adduserFrm.controls['isActive'].setValue(this.adduserFrm.value.UserStatusActive) ; |
414 | - | |
415 | - if(this.deaDateblank) | |
416 | - { | |
417 | - this.adduserFrm.controls['DeactivationDate'].setValue(null); | |
418 | - } | |
419 | 412 | |
420 | 413 | var Userobj = this.adduserFrm.value; |
421 | 414 | ... | ... |