Commit c6073231fd04f2a6cfa30cfa7d688376472f0a70

Authored by Birendra Kumar
2 parents 98d2f854 670747d9

Merge branch 'AIA_Develop' into AIA_Develop-CI

400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs
... ... @@ -49,9 +49,9 @@ namespace AIAHTML5.ADMIN.API.Controllers
49 49 {
50 50 dbContext.Configuration.ProxyCreationEnabled = false;
51 51 try
52   - {
  52 + {
53 53 return Ok(dbContext.AIAUsers.Where(u => u.Id == userId).Select(s => new UserModel {
54   - DeactivationDate=s.DeactivationDate.Value,
  54 + DeactivationDate=s.DeactivationDate,
55 55 Createdby = dbContext.AIAUsers.Where(sub1 => sub1.Id == s.CreatorId).Select(sub1 => sub1.FirstName ).FirstOrDefault()+ " "+ dbContext.AIAUsers.Where(sub1 => sub1.Id == s.CreatorId).Select(sub1 => sub1.LastName).FirstOrDefault(),
56 56 Modifiedby = dbContext.AIAUsers.Where(sub1 => sub1.Id == s.ModifierId).Select(sub1 => sub1.FirstName ).FirstOrDefault() + " " + dbContext.AIAUsers.Where(sub1 => sub1.Id == s.ModifierId).Select(sub1 => sub1.LastName).FirstOrDefault()
57 57 }).ToList());
... ...
400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserGroupController.cs
... ... @@ -24,7 +24,7 @@ namespace AIAHTML5.ADMIN.API.Controllers
24 24  
25 25 [Route("LicenseUserGroups")]
26 26 [HttpGet]
27   - public HttpResponseMessage GetLicenseUserGroups(int LicenseId, int pageNo, int pageLength)
  27 + public HttpResponseMessage GetLicenseUserGroups(int? LicenseId, int pageNo, int pageLength)
28 28 {
29 29 List<UserGroupModel> UserGroupList = new List<UserGroupModel>();
30 30 int recordCount = 0;
... ... @@ -42,7 +42,7 @@ namespace AIAHTML5.ADMIN.API.Controllers
42 42  
43 43 [Route("LicenseUserGroupUsers")]
44 44 [HttpGet]
45   - public HttpResponseMessage GetLicenseUserGroupUsers(int LicenseId, int UserGroupId, bool AllUsers, int pageNo, int pageLength)
  45 + public HttpResponseMessage GetLicenseUserGroupUsers(int? LicenseId, int UserGroupId, bool AllUsers, int pageNo, int pageLength)
46 46 {
47 47 List<UserModel> UserList = new List<UserModel>();
48 48 int recordCount = 0;
... ... @@ -142,7 +142,7 @@ namespace AIAHTML5.ADMIN.API.Controllers
142 142  
143 143 [Route("CheckDuplicateLicenseUserGroup")]
144 144 [HttpGet]
145   - public HttpResponseMessage CheckDuplicateLicenseUserGroup(int LicenseId, string Title)
  145 + public HttpResponseMessage CheckDuplicateLicenseUserGroup(int? LicenseId, string Title)
146 146 {
147 147 bool Status = false;
148 148 try
... ...
400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserGroupModel.cs
... ... @@ -16,7 +16,7 @@ namespace AIAHTML5.ADMIN.API.Models
16 16 public bool? IsActive { get; set; }
17 17 public int? TotalUsers { get; set; }
18 18  
19   - public static List<UserGroupModel> GetLicenseUserGroups(AIADatabaseV5Entities dbContext, int LicenseId, int pageNo, int pageLength, out int recordCount)
  19 + public static List<UserGroupModel> GetLicenseUserGroups(AIADatabaseV5Entities dbContext, int? LicenseId, int pageNo, int pageLength, out int recordCount)
20 20 {
21 21 List<UserGroupModel> UserGroupList = new List<UserGroupModel>();
22 22 UserGroupModel UserGroupObj = new UserGroupModel();
... ... @@ -43,7 +43,7 @@ namespace AIAHTML5.ADMIN.API.Models
43 43 return UserGroupList;
44 44 }
45 45  
46   - public static List<UserModel> GetLicenseUserGroupUsers(AIADatabaseV5Entities dbContext, int LicenseId, int UserGroupId, bool AllUsers, int pageNo, int pageLength, out int recordCount)
  46 + public static List<UserModel> GetLicenseUserGroupUsers(AIADatabaseV5Entities dbContext, int? LicenseId, int UserGroupId, bool AllUsers, int pageNo, int pageLength, out int recordCount)
47 47 {
48 48 List<UserModel> UserList = new List<UserModel>();
49 49 UserModel UserModelObj = new UserModel();
... ... @@ -113,7 +113,7 @@ namespace AIAHTML5.ADMIN.API.Models
113 113 }
114 114 }
115 115  
116   - public static bool CheckDuplicateLicenseUserGroup(AIADatabaseV5Entities dbContext, int LicenseId, string Title)
  116 + public static bool CheckDuplicateLicenseUserGroup(AIADatabaseV5Entities dbContext, int? LicenseId, string Title)
117 117 {
118 118 var spStatus = new System.Data.Objects.ObjectParameter("Status", 0);
119 119 try
... ...
400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserModel.cs
... ... @@ -19,7 +19,7 @@ namespace AIAHTML5.ADMIN.API.Models
19 19 public string SecurityAnswer { get; set; }
20 20 public int CreatorId { get; set; }
21 21 public DateTime CreationDate { get; set; }
22   - public DateTime DeactivationDate { get; set; }
  22 + public DateTime ? DeactivationDate { get; set; }
23 23 public int ModifierId { get; set; }
24 24 public DateTime ModifiedDate { get; set; }
25 25 public int UserTypeId { get; set; }
... ...
400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.ts
... ... @@ -35,9 +35,9 @@ export class AddLicense implements OnInit {
35 35 divClass: string = '';
36 36 topPos: string = '2000px';
37 37 datePipe: DatePipe = new DatePipe('en-US');
38   - bsValue1: Date = new Date();
39   - bsValue2: Date = new Date();
40   - bsValue3: Date = new Date();
  38 + bsValue1: Date = null;//new Date();
  39 + bsValue2: Date = null;//new Date();
  40 + bsValue3: Date = null;//new Date();
41 41 modalRef: BsModalRef;
42 42 editionLoginsText: string;
43 43 rowIndex: number = 0;
... ...
400-SOURCECODE/Admin/src/app/components/LicenseEntity/searchlicense.component.ts
... ... @@ -36,8 +36,8 @@ export class SearchLicense implements OnInit, AfterViewChecked {
36 36 topPos: string = '2000px';
37 37 selectedRow: number = 0;
38 38 datePipe: DatePipe = new DatePipe('en-US');
39   - bsValue1: Date = new Date();
40   - bsValue2: Date = new Date();
  39 + bsValue1: Date = null;//new Date();
  40 + bsValue2: Date = null;//new Date();
41 41 selectedId: number = 0;
42 42 modalRef: BsModalRef;
43 43 checkedRecords: Array<number>;
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html
... ... @@ -204,7 +204,10 @@
204 204 <label for="inputPassword3" class="col-sm-5 control-label">Confirm Password <span class="red">*</span> :</label>
205 205 <div class="col-sm-7">
206 206 <input type="password" class="form-control input-sm" id="cpassword" placeholder="" formControlName="ConfirmPassword">
207   - <div *ngIf="!adduserFrm.controls.ConfirmPassword.valid && adduserFrm.controls.ConfirmPassword.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Confirm Password is required</div>
  207 + <div *ngIf="!adduserFrm.controls.ConfirmPassword.valid && !adduserFrm.controls.ConfirmPassword.value && adduserFrm.controls.ConfirmPassword.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">Confirm Password is required</div>
  208 + <div *ngIf="adduserFrm.controls.ConfirmPassword.value!=adduserFrm.controls.Password.value && adduserFrm.controls.ConfirmPassword.valid" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">
  209 + Password not match.
  210 + </div>
208 211 </div>
209 212 </div>
210 213 <div class="form-group">
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts
... ... @@ -347,29 +347,31 @@ export class UsersList implements OnInit, AfterViewChecked {
347 347 }
348 348  
349 349 public UpdateUser() {
350   - this.alerts = '';
351   - if (this.adduserFrm.value.UserName == '') {
352   - this.alerts += '<span>User Name minimum 8 characters is required.</span>';
  350 + this.alerts = '';
  351 + if (this.adduserFrm.value.UserName == '' ||(!this.adduserFrm.controls.UserName.valid))
  352 + {
  353 + this.alerts += '<span>User Name of minimum 8 characters is required.</span>';
353 354 }
354   - if (this.adduserFrm.value.Password == '') {
  355 + if (this.adduserFrm.value.Password == '' ||(!this.adduserFrm.controls.Password.valid )) {
355 356 this.alerts += '</br><span>Password of minimum 8 characters is required.</span>';
356 357 }
357 358 if (this.adduserFrm.value.ConfirmPassword == '') {
358 359 this.alerts += '</br><span>Confirm Password is required.</span>';
359 360 }
360   - if (this.adduserFrm.value.EmailId == '') {
  361 + if (this.adduserFrm.value.Password != this.adduserFrm.value.ConfirmPassword) {
  362 + this.alerts += '</br><span>Password and confirm password must be same</span>';
  363 + }
  364 + if (this.adduserFrm.value.EmailId == '' ||(!this.adduserFrm.controls.EmailId.valid)) {
361 365 this.alerts += '</br><span>Email Id is required.</span>';
362 366 }
  367 +
363 368 if (this.adduserFrm.value.FirstName == '') {
364 369 this.alerts += '</br><span>First Name is required.</span>';
365 370 }
366 371 if (this.adduserFrm.value.LastName == '') {
367 372 this.alerts += '</br><span>Last Name is required.</span>';
368 373 }
369   - if (this.adduserFrm.value.Password != this.adduserFrm.value.ConfirmPassword) {
370   - this.alerts += '</br><span>Password and confirm password must be same</span>';
371   - }
372   -
  374 +
373 375 if (this.adduserFrm.valid && this.alerts == '') {
374 376 this.adduserFrm.controls['isActive'].setValue(this.adduserFrm.value.UserStatusActive)
375 377  
... ...