Commit 893e59acb9d131c47cc8dc63f505792b8841f034
1 parent
26b31a03
add login status filter in userlist
Showing
11 changed files
with
55 additions
and
24 deletions
400-SOURCECODE/AIAHTML5.ADMIN.API/Constants/AdminConstant.cs
... | ... | @@ -15,5 +15,6 @@ namespace AIAHTML5.Server.Constants |
15 | 15 | |
16 | 16 | public const string SUCCESS = "Success"; |
17 | 17 | public const string FAILED = "Failed"; |
18 | + public const string SQL_CONNECTION_ERROR = "We are unable to connect with database. Please contact customer support."; | |
18 | 19 | } |
19 | 20 | } |
20 | 21 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs
... | ... | @@ -128,7 +128,7 @@ namespace AIAHTML5.ADMIN.API.Controllers |
128 | 128 | catch (Exception ex) |
129 | 129 | { |
130 | 130 | // Log exception code goes here |
131 | - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | |
131 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, AdminConstant.SQL_CONNECTION_ERROR); | |
132 | 132 | } |
133 | 133 | } |
134 | 134 | |
... | ... | @@ -183,19 +183,20 @@ namespace AIAHTML5.ADMIN.API.Controllers |
183 | 183 | |
184 | 184 | [Route("Users")] |
185 | 185 | [HttpGet] |
186 | - public IHttpActionResult UserList(string firstname, string lastname, string emailid, string accountnumber, string usertypeid, string accounttypeid, | |
186 | + public IHttpActionResult UserList(string firstname, string lastname, string emailid, string accountnumber, string usertypeid, string accounttypeid, string userLoginStatus, | |
187 | 187 | int pageNo, int pageLength, int iLoginUserType,string loggedIn="") |
188 | 188 | { |
189 | 189 | try |
190 | 190 | { |
191 | 191 | int UserTypeId = (!string.IsNullOrEmpty(usertypeid) ? Convert.ToInt32(usertypeid) : 0); |
192 | 192 | int AccountTypeId = (!string.IsNullOrEmpty(accounttypeid) ? Convert.ToInt32(accounttypeid) : 0); |
193 | + bool loginStatus = Convert.ToBoolean(userLoginStatus); | |
193 | 194 | int recordCount = 0; |
194 | 195 | dbContext.Configuration.ProxyCreationEnabled = false; |
195 | 196 | //var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); |
196 | 197 | var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); |
197 | 198 | //recordCount = (int)spRecordCount.Value; |
198 | - List<usp_GetUsersList_Result> Users = dbContext.usp_GetUsersList(firstname, lastname, emailid, accountnumber, UserTypeId, AccountTypeId, iLoginUserType, pageNo, pageLength, spRecordCount).ToList(); | |
199 | + List<usp_GetUsersList_Result> Users = dbContext.usp_GetUsersList(firstname, lastname, emailid, accountnumber, UserTypeId, AccountTypeId, iLoginUserType, loginStatus, pageNo, pageLength, spRecordCount).ToList(); | |
199 | 200 | if (!string.IsNullOrEmpty(loggedIn)) |
200 | 201 | { |
201 | 202 | if (Users.Where(s => s.LoginId == loggedIn).Count() > 0) | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs
... | ... | @@ -4399,7 +4399,7 @@ namespace AIAHTML5.ADMIN.API.Entity |
4399 | 4399 | return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<string>("usp_GetUserList", sFirstNameParameter, sLastNameParameter, sEmailIdParameter, sAccoutNumberParameter, iUserTypeIdParameter, iAccountTypeIdParameter, iLoginUserTypeParameter, pageNoParameter, pageLengthParameter, recordCount); |
4400 | 4400 | } |
4401 | 4401 | |
4402 | - public virtual ObjectResult<usp_GetUsersList_Result> usp_GetUsersList(string sFirstName, string sLastName, string sEmailId, string sAccoutNumber, Nullable<int> iUserTypeId, Nullable<int> iAccountTypeId, Nullable<int> iLoginUserType, Nullable<int> pageNo, Nullable<int> pageLength, ObjectParameter recordCount) | |
4402 | + public virtual ObjectResult<usp_GetUsersList_Result> usp_GetUsersList(string sFirstName, string sLastName, string sEmailId, string sAccoutNumber, Nullable<int> iUserTypeId, Nullable<int> iAccountTypeId, Nullable<int> iLoginUserType, Nullable<bool> iLoginStatus, Nullable<int> pageNo, Nullable<int> pageLength, ObjectParameter recordCount) | |
4403 | 4403 | { |
4404 | 4404 | var sFirstNameParameter = sFirstName != null ? |
4405 | 4405 | new ObjectParameter("sFirstName", sFirstName) : |
... | ... | @@ -4429,6 +4429,10 @@ namespace AIAHTML5.ADMIN.API.Entity |
4429 | 4429 | new ObjectParameter("iLoginUserType", iLoginUserType) : |
4430 | 4430 | new ObjectParameter("iLoginUserType", typeof(int)); |
4431 | 4431 | |
4432 | + var iLoginStatusParameter = iLoginStatus.HasValue ? | |
4433 | + new ObjectParameter("iLoginStatus", iLoginStatus) : | |
4434 | + new ObjectParameter("iLoginStatus", typeof(bool)); | |
4435 | + | |
4432 | 4436 | var pageNoParameter = pageNo.HasValue ? |
4433 | 4437 | new ObjectParameter("pageNo", pageNo) : |
4434 | 4438 | new ObjectParameter("pageNo", typeof(int)); |
... | ... | @@ -4437,7 +4441,7 @@ namespace AIAHTML5.ADMIN.API.Entity |
4437 | 4441 | new ObjectParameter("pageLength", pageLength) : |
4438 | 4442 | new ObjectParameter("pageLength", typeof(int)); |
4439 | 4443 | |
4440 | - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<usp_GetUsersList_Result>("usp_GetUsersList", sFirstNameParameter, sLastNameParameter, sEmailIdParameter, sAccoutNumberParameter, iUserTypeIdParameter, iAccountTypeIdParameter, iLoginUserTypeParameter, pageNoParameter, pageLengthParameter, recordCount); | |
4444 | + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<usp_GetUsersList_Result>("usp_GetUsersList", sFirstNameParameter, sLastNameParameter, sEmailIdParameter, sAccoutNumberParameter, iUserTypeIdParameter, iAccountTypeIdParameter, iLoginUserTypeParameter, iLoginStatusParameter, pageNoParameter, pageLengthParameter, recordCount); | |
4441 | 4445 | } |
4442 | 4446 | |
4443 | 4447 | public virtual ObjectResult<usp_GetUserTyeByAccountNumber_Result> usp_GetUserTyeByAccountNumber(Nullable<byte> iUserTypeId, Nullable<int> iLicenseId) | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx
... | ... | @@ -1228,6 +1228,7 @@ |
1228 | 1228 | <Parameter Name="iUserTypeId" Type="int" Mode="In" /> |
1229 | 1229 | <Parameter Name="iAccountTypeId" Type="int" Mode="In" /> |
1230 | 1230 | <Parameter Name="iLoginUserType" Type="int" Mode="In" /> |
1231 | + <Parameter Name="iLoginStatus" Type="bit" Mode="In" /> | |
1231 | 1232 | <Parameter Name="pageNo" Type="int" Mode="In" /> |
1232 | 1233 | <Parameter Name="pageLength" Type="int" Mode="In" /> |
1233 | 1234 | <Parameter Name="recordCount" Type="int" Mode="InOut" /> |
... | ... | @@ -2847,6 +2848,7 @@ |
2847 | 2848 | <Parameter Name="iUserTypeId" Mode="In" Type="Int32" /> |
2848 | 2849 | <Parameter Name="iAccountTypeId" Mode="In" Type="Int32" /> |
2849 | 2850 | <Parameter Name="iLoginUserType" Mode="In" Type="Int32" /> |
2851 | + <Parameter Name="iLoginStatus" Mode="In" Type="Boolean" /> | |
2850 | 2852 | <Parameter Name="pageNo" Mode="In" Type="Int32" /> |
2851 | 2853 | <Parameter Name="pageLength" Mode="In" Type="Int32" /> |
2852 | 2854 | <Parameter Name="recordCount" Mode="InOut" Type="Int32" /> | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserModel.cs
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... | ... | @@ -777,11 +777,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
777 | 777 | .then( |
778 | 778 | |
779 | 779 | function (result) { |
780 | - // update result with session detail | |
781 | - result.aiaIdleTime=$rootScope.aiaIdleTime; | |
782 | - result.aiaIdleTimeOut=$rootScope.aiaIdleTimeOut; | |
783 | - result.aiaPingInterval=$rootScope.aiaPingInterval; | |
784 | - | |
780 | + | |
785 | 781 | if (result == LoginConstants.USER_NOT_FOUND) { |
786 | 782 | $rootScope.LoginEnableUI(); |
787 | 783 | $rootScope.isVisibleLogin = true; |
... | ... | @@ -793,6 +789,10 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
793 | 789 | |
794 | 790 | // birendra// initialize exp img detail object |
795 | 791 | $rootScope.initializeUserForExportImage(result.Id); |
792 | + // update result with session detail | |
793 | + result.aiaIdleTime=$rootScope.aiaIdleTime; | |
794 | + result.aiaIdleTimeOut=$rootScope.aiaIdleTimeOut; | |
795 | + result.aiaPingInterval=$rootScope.aiaPingInterval; | |
796 | 796 | |
797 | 797 | //code for modesty setting |
798 | 798 | if (result.LicenseInfo != null) { |
... | ... | @@ -982,9 +982,9 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
982 | 982 | if (result.UserTypeId == 8) { |
983 | 983 | |
984 | 984 | $rootScope.haveRoleAdmin = false; |
985 | - } | |
986 | - | |
985 | + } | |
987 | 986 | |
987 | + | |
988 | 988 | if (result.UserTypeId == 6) { |
989 | 989 | $('#modestyDiv').css('pointerEvent', 'none'); |
990 | 990 | $('#modestyDiv').css('opacity', 0.4); |
... | ... | @@ -1246,11 +1246,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
1246 | 1246 | .then( |
1247 | 1247 | |
1248 | 1248 | function (result) { |
1249 | - console.log(result); | |
1250 | - // update result with session detail | |
1251 | - result.aiaIdleTime=$rootScope.aiaIdleTime; | |
1252 | - result.aiaIdleTimeOut=$rootScope.aiaIdleTimeOut; | |
1253 | - result.aiaPingInterval=$rootScope.aiaPingInterval; | |
1249 | + console.log(result); | |
1254 | 1250 | if (result != null) { |
1255 | 1251 | console.log(result); |
1256 | 1252 | if (result == LoginConstants.INVALID_CLIENT) { |
... | ... | @@ -1293,6 +1289,10 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
1293 | 1289 | |
1294 | 1290 | |
1295 | 1291 | else { |
1292 | + // update result with session detail | |
1293 | + result.aiaIdleTime=$rootScope.aiaIdleTime; | |
1294 | + result.aiaIdleTimeOut=$rootScope.aiaIdleTimeOut; | |
1295 | + result.aiaPingInterval=$rootScope.aiaPingInterval; | |
1296 | 1296 | if (typeof result.FirstName != undefined || result.FirstName != "" || result.FirstName != null) { |
1297 | 1297 | //code for modesty setting |
1298 | 1298 | if (result.LicenseInfo != null) { | ... | ... |
400-SOURCECODE/Admin/src/app/app.component.ts
... | ... | @@ -12,6 +12,8 @@ import { LoadingService } from './shared/loading.service'; |
12 | 12 | import {Idle, DEFAULT_INTERRUPTSOURCES} from '@ng-idle/core'; |
13 | 13 | import {Keepalive} from '@ng-idle/keepalive'; |
14 | 14 | import { Title } from '@angular/platform-browser'; |
15 | +import { ConfirmService } from './shared/confirm/confirm.service'; | |
16 | +import { timeout } from 'rxjs/operator/timeout'; | |
15 | 17 | |
16 | 18 | //import { HttpClient } from '@angular/common/http'; |
17 | 19 | //import { HttpErrorResponse } from '@angular/common/http'; |
... | ... | @@ -32,9 +34,10 @@ export class AppComponent implements OnInit { |
32 | 34 | public UpdateProfileVisible: boolean; |
33 | 35 | public UserManageRightsList: Array<UserManageRightsModel>; |
34 | 36 | |
35 | - constructor(private idle: Idle, private keepalive: Keepalive,private titleService: Title,private userservice: UserService,private _loadingService: LoadingService, public global: GlobalService, private router: Router,) { | |
37 | + constructor(private idle: Idle, private keepalive: Keepalive,private titleService: Title,private _confirmService: ConfirmService,private userservice: UserService,private _loadingService: LoadingService, public global: GlobalService, private router: Router,) { | |
36 | 38 | const projectTitle= this.titleService.getTitle(); |
37 | 39 | |
40 | + console.log("idleTime: "+this.global.aiaIdleTime+" aiaIdleTimeOut: "+this.global.aiaIdleTimeOut+" Interval: "+this.global.aiaPingInterval); | |
38 | 41 | // sets an idle timeout of 20 minutes. |
39 | 42 | this.idle.setIdle(this.global.aiaIdleTime); |
40 | 43 | |
... | ... | @@ -149,7 +152,15 @@ export class AppComponent implements OnInit { |
149 | 152 | |
150 | 153 | } |
151 | 154 | |
152 | - },error => console.log(error)); | |
155 | + },error =>{ | |
156 | + console.log(error); | |
157 | + this.idle.stop(); | |
158 | + this._confirmService.activate(error, "alertMsg"); | |
159 | + this._loadingService.HideLoading("global-loading"); | |
160 | + setTimeout(function(){ | |
161 | + window.location.href = window.location.origin; | |
162 | + },5000); | |
163 | + }) | |
153 | 164 | } |
154 | 165 | |
155 | 166 | Product() { | ... | ... |
400-SOURCECODE/Admin/src/app/components/UserEntity/user.service.ts
... | ... | @@ -100,6 +100,7 @@ export class UserService { |
100 | 100 | "&accountnumber=" + obj.AccountNumber + |
101 | 101 | "&usertypeid=" + obj.UserTypeId + |
102 | 102 | "&accounttypeid=" + obj.AccountTypeId + |
103 | + "&userLoginStatus=" + obj.LoginStatus + | |
103 | 104 | "&pageNo=" + pageNo + |
104 | 105 | "&pageLength=" + pageLength + |
105 | 106 | "&iLoginUserType=" + this.commonService.UserType + | ... | ... |
400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 | <input type="text" class="form-control input-sm" id="LastNames" placeholder="Last Name" formControlName="LastName"> |
29 | 29 | </div> |
30 | 30 | </div> |
31 | - </div> | |
31 | + </div> | |
32 | 32 | </div> |
33 | 33 | </div> |
34 | 34 | <div class="col-lg-3 col-sm-3"> |
... | ... | @@ -80,6 +80,15 @@ |
80 | 80 | </div> |
81 | 81 | </div> |
82 | 82 | </div> |
83 | + | |
84 | + <div class="col-sm-12"> | |
85 | + <div class="form-group marginTop5"> | |
86 | + <label for="LoginStatus" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">Logged-In Status :</label> | |
87 | + <div> | |
88 | + <input type="checkbox" class="radio-inline" style="height: 25px;width: 20px" id="LoginStatus" formControlName="LoginStatus"> | |
89 | + </div> | |
90 | + </div> | |
91 | + </div> | |
83 | 92 | </div> |
84 | 93 | </div> |
85 | 94 | ... | ... |
400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts
... | ... | @@ -82,7 +82,8 @@ export class UsersList implements OnInit, AfterViewChecked { |
82 | 82 | EmailId: [''], |
83 | 83 | AccountNumber: [''], |
84 | 84 | UserTypeId: [0], |
85 | - AccountTypeId:[0] | |
85 | + AccountTypeId:[0], | |
86 | + LoginStatus:[false] | |
86 | 87 | // Gender: ['', Validators.required], |
87 | 88 | // Email: [''] |
88 | 89 | |
... | ... | @@ -290,7 +291,8 @@ export class UsersList implements OnInit, AfterViewChecked { |
290 | 291 | EmailId: this.Users.controls['EmailId'].value, |
291 | 292 | AccountNumber: this.Users.controls['AccountNumber'].value, |
292 | 293 | UserTypeId: (this.Users.controls['UserTypeId'].value != null && this.Users.controls['UserTypeId'].value !='' ? this.Users.controls['UserTypeId'].value:0), |
293 | - AccountTypeId: (this.Users.controls['AccountTypeId'].value != null && this.Users.controls['AccountTypeId'].value != ''? this.Users.controls['AccountTypeId'].value : 0), | |
294 | + AccountTypeId: (this.Users.controls['AccountTypeId'].value != null && this.Users.controls['AccountTypeId'].value != ''? this.Users.controls['AccountTypeId'].value : 0), | |
295 | + LoginStatus: this.Users.controls['LoginStatus'].value, | |
294 | 296 | },this.pageNo, this.pageLength |
295 | 297 | ) |
296 | 298 | .subscribe(x => { this.BindFormFields(x) }, error => this.error = <any>error); | ... | ... |
400-SOURCECODE/Admin/src/app/shared/global.ts
... | ... | @@ -74,7 +74,7 @@ export class GlobalService { |
74 | 74 | //**** for localhost:4200 *****// |
75 | 75 | localStorage.setItem('loggedInUserDetails', JSON.stringify( |
76 | 76 | { |
77 | - "Id": 1, "FirstName": "Maribel", "LastName": "sfsfsfsfsfsfs", "EmailId": "ravi.vishwakarma@ebix.com", "LoginId": "superadmin", "Password": "ebix@2016", "SecurityQuestionId": 1, "SecurityAnswer": "boxer", "CreatorId": 1, "CreationDate": "2009-03-02T00:00:00", "DeactivationDate": null, "ModifierId": 1, "ModifiedDate": "2017-01-24T02:03:19", "UserType": "Super Admin", "UserTypeId": 1, "IsActive": true, "IsCorrectPassword": false, "IncorrectLoginAttemptCount": 0, "IsBlocked": false, "LicenseId": 0, "EditionId": 0, "LoginFailureCauseId": 0, "Modules": [{ "slug": "da-view-list", "name": "Dissectible Anatomy", "id": 1 }, { "slug": "tile-view-list", "name": "Atlas Anatomy", "id": 2 }, { "slug": "3d-anatomy-list", "name": "3D Anatomy", "id": 3 }, { "slug": "clinical-illustrations", "name": "Clinical Illustrations", "id": 4 }, { "slug": "clinical-animations", "name": "Clinical Animations", "id": 5 }, { "slug": "Link/encyclopedia", "name": "Encyclopedia", "id": 6 }, { "slug": "curriculum-builder", "name": "Curriculum Builder", "id": 7 }, { "slug": "anatomy-test", "name": "Anatomy Test", "id": 8 }, { "slug": "Link/IP-10", "name": "IP 10", "id": 9 }, { "slug": "lab-exercises", "name": "Lab Exercises", "id": 10 }, { "slug": "Link/indepth-reports", "name": "In-Depth Reports", "id": 11 }, { "slug": "Link/complementary-and-alternate-medicine", "name": "CAM", "id": 12 }, { "slug": "ADAM-images", "name": "A.D.A.M. Images", "id": 13 }, { "slug": "Link/bodyguide", "name": "Body Guide", "id": 14 }, { "slug": "Link/health-navigator", "name": "Symptom Navigator", "id": 15 }, { "slug": "Link/wellness-tools", "name": "The Wellness Tools", "id": 16 }, { "slug": "Link/aod", "name": "A.D.A.M. OnDemand", "id": 1017 }], "LicenseInfo": { "Id": 0, "AccountNumber": "AIAS000319" }, "LicenseSubscriptions": null, "IsSubscriptionExpired": false, "SubscriptionExpirationDate": null, "TermsAndConditionsTitle": null, "TermsAndConditionsText": null | |
77 | + "Id": 1, "FirstName": "Maribel", "LastName": "sfsfsfsfsfsfs", "EmailId": "ravi.vishwakarma@ebix.com", "LoginId": "superadmin", "Password": "ebix@2016","aiaIdleTime": 300,"aiaIdleTimeOut": 30,"aiaPingInterval": 10, "SecurityQuestionId": 1, "SecurityAnswer": "boxer", "CreatorId": 1, "CreationDate": "2009-03-02T00:00:00", "DeactivationDate": null, "ModifierId": 1, "ModifiedDate": "2017-01-24T02:03:19", "UserType": "Super Admin", "UserTypeId": 1, "IsActive": true, "IsCorrectPassword": false, "IncorrectLoginAttemptCount": 0, "IsBlocked": false, "LicenseId": 0, "EditionId": 0, "LoginFailureCauseId": 0, "Modules": [{ "slug": "da-view-list", "name": "Dissectible Anatomy", "id": 1 }, { "slug": "tile-view-list", "name": "Atlas Anatomy", "id": 2 }, { "slug": "3d-anatomy-list", "name": "3D Anatomy", "id": 3 }, { "slug": "clinical-illustrations", "name": "Clinical Illustrations", "id": 4 }, { "slug": "clinical-animations", "name": "Clinical Animations", "id": 5 }, { "slug": "Link/encyclopedia", "name": "Encyclopedia", "id": 6 }, { "slug": "curriculum-builder", "name": "Curriculum Builder", "id": 7 }, { "slug": "anatomy-test", "name": "Anatomy Test", "id": 8 }, { "slug": "Link/IP-10", "name": "IP 10", "id": 9 }, { "slug": "lab-exercises", "name": "Lab Exercises", "id": 10 }, { "slug": "Link/indepth-reports", "name": "In-Depth Reports", "id": 11 }, { "slug": "Link/complementary-and-alternate-medicine", "name": "CAM", "id": 12 }, { "slug": "ADAM-images", "name": "A.D.A.M. Images", "id": 13 }, { "slug": "Link/bodyguide", "name": "Body Guide", "id": 14 }, { "slug": "Link/health-navigator", "name": "Symptom Navigator", "id": 15 }, { "slug": "Link/wellness-tools", "name": "The Wellness Tools", "id": 16 }, { "slug": "Link/aod", "name": "A.D.A.M. OnDemand", "id": 1017 }], "LicenseInfo": { "Id": 0, "AccountNumber": "AIAS000319" }, "LicenseSubscriptions": null, "IsSubscriptionExpired": false, "SubscriptionExpirationDate": null, "TermsAndConditionsTitle": null, "TermsAndConditionsText": null | |
78 | 78 | })); |
79 | 79 | } |
80 | 80 | ... | ... |