Commit e9497eda57fdc26e6fa1dea67635118252bf7895
1 parent
a56222b7
User Group And Manage Rights
Showing
238 changed files
with
4388 additions
and
7 deletions
Too many changes.
To preserve performance only 100 of 238 files are displayed.
150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/dbo.usp_GetManageRights.sql
0 → 100644
150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usergroupmergecode/usergroupmergecode/UserGroupController.cs
0 → 100644
1 | +using System; | ||
2 | +using System.Collections.Generic; | ||
3 | +using System.Linq; | ||
4 | +using System.Net; | ||
5 | +using System.Net.Http; | ||
6 | +using System.Web.Http; | ||
7 | +using Newtonsoft.Json; | ||
8 | +using Newtonsoft.Json.Linq; | ||
9 | +using AIAHTML5.ADMIN.API.Models; | ||
10 | +using System.Web.Http.Cors; | ||
11 | +using System.Web.Cors; | ||
12 | +using AIAHTML5.Server.Constants; | ||
13 | +using log4net; | ||
14 | +using System.Text; | ||
15 | +using AIAHTML5.ADMIN.API.Entity; | ||
16 | + | ||
17 | +namespace AIAHTML5.ADMIN.API.Controllers | ||
18 | +{ | ||
19 | + [EnableCors(origins: "http://localhost:4200", headers: "*", methods: "*")] | ||
20 | + [RoutePrefix("UserGroup")] | ||
21 | + public class UserGroupController : ApiController | ||
22 | + { | ||
23 | + AIADatabaseV5Entities dbContext = new AIADatabaseV5Entities(); | ||
24 | + | ||
25 | + [Route("LicenseUserGroups")] | ||
26 | + [HttpGet] | ||
27 | + public HttpResponseMessage GetLicenseUserGroups(int LicenseId) | ||
28 | + { | ||
29 | + List<UserGroupModel> UserGroupList = new List<UserGroupModel>(); | ||
30 | + try | ||
31 | + { | ||
32 | + UserGroupList = UserGroupModel.GetLicenseUserGroups(dbContext, LicenseId); | ||
33 | + return Request.CreateResponse(HttpStatusCode.OK, UserGroupList); | ||
34 | + } | ||
35 | + catch (Exception ex) | ||
36 | + { | ||
37 | + // Log exception code goes here | ||
38 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | ||
39 | + } | ||
40 | + } | ||
41 | + | ||
42 | + [Route("LicenseUserGroupUsers")] | ||
43 | + [HttpGet] | ||
44 | + public HttpResponseMessage GetLicenseUserGroupUsers(int LicenseId, int UserGroupId) | ||
45 | + { | ||
46 | + List<UserModel> UserList = new List<UserModel>(); | ||
47 | + try | ||
48 | + { | ||
49 | + UserList = UserGroupModel.GetLicenseUserGroupUsers(dbContext, LicenseId, UserGroupId); | ||
50 | + return Request.CreateResponse(HttpStatusCode.OK, UserList); | ||
51 | + } | ||
52 | + catch (Exception ex) | ||
53 | + { | ||
54 | + // Log exception code goes here | ||
55 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | ||
56 | + } | ||
57 | + } | ||
58 | + | ||
59 | + [Route("InsertUpdateLicenseUserGroup")] | ||
60 | + [HttpPost] | ||
61 | + public HttpResponseMessage InsertUpdateLicenseUserGroup(JObject jsonData) | ||
62 | + { | ||
63 | + bool Status = false; | ||
64 | + UserGroupModel UserGroupEntity = new UserGroupModel(); | ||
65 | + UserGroupEntity.Id = jsonData["id"].Value<int>(); | ||
66 | + UserGroupEntity.LicenseId = jsonData["licenseId"].Value<int>(); | ||
67 | + UserGroupEntity.Title = jsonData["title"].Value<string>(); | ||
68 | + UserGroupEntity.IsActive = jsonData["isActive"].Value<bool>(); | ||
69 | + UserGroupEntity.CreationDate = jsonData["creationDate"].Value<DateTime>(); | ||
70 | + UserGroupEntity.ModifiedDate = jsonData["modifiedDate"].Value<DateTime>(); | ||
71 | + try | ||
72 | + { | ||
73 | + Status = UserGroupModel.InsertUpdateLicenseUserGroup(dbContext, UserGroupEntity); | ||
74 | + if (Status) | ||
75 | + { | ||
76 | + return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); | ||
77 | + } | ||
78 | + else | ||
79 | + { | ||
80 | + return Request.CreateErrorResponse(HttpStatusCode.BadRequest, Status.ToString()); | ||
81 | + } | ||
82 | + } | ||
83 | + catch (Exception ex) | ||
84 | + { | ||
85 | + // Log exception code goes here | ||
86 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | ||
87 | + } | ||
88 | + } | ||
89 | + | ||
90 | + [Route("UpdateLicenseUserGroupUsers")] | ||
91 | + [HttpPost] | ||
92 | + public HttpResponseMessage UpdateLicenseUserGroupUsers(JObject jsonData) | ||
93 | + { | ||
94 | + bool Status = false; | ||
95 | + int UserGroupId = jsonData["userGroupId"].Value<int>(); | ||
96 | + string UserIds = jsonData["userIds"].Value<string>(); | ||
97 | + try | ||
98 | + { | ||
99 | + Status = UserGroupModel.UpdateLicenseUserGroupUsers(dbContext, UserGroupId, UserIds); | ||
100 | + if (Status) | ||
101 | + { | ||
102 | + return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); | ||
103 | + } | ||
104 | + else | ||
105 | + { | ||
106 | + return Request.CreateErrorResponse(HttpStatusCode.BadRequest, Status.ToString()); | ||
107 | + } | ||
108 | + } | ||
109 | + catch (Exception ex) | ||
110 | + { | ||
111 | + // Log exception code goes here | ||
112 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | ||
113 | + } | ||
114 | + } | ||
115 | + | ||
116 | + [Route("DeleteLicenseUserGroup")] | ||
117 | + [HttpGet] | ||
118 | + public HttpResponseMessage DeleteLicenseUserGroup(int UserGroupId) | ||
119 | + { | ||
120 | + bool Status = false; | ||
121 | + try | ||
122 | + { | ||
123 | + Status = UserGroupModel.DeleteLicenseUserGroup(dbContext, UserGroupId); | ||
124 | + if (Status) | ||
125 | + { | ||
126 | + return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); | ||
127 | + } | ||
128 | + else | ||
129 | + { | ||
130 | + return Request.CreateErrorResponse(HttpStatusCode.BadRequest, Status.ToString()); | ||
131 | + } | ||
132 | + } | ||
133 | + catch (Exception ex) | ||
134 | + { | ||
135 | + // Log exception code goes here | ||
136 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | ||
137 | + } | ||
138 | + } | ||
139 | + } | ||
140 | +} |
150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usergroupmergecode/usergroupmergecode/UserGroupModel.cs
0 → 100644
1 | +using System; | ||
2 | +using System.Collections.Generic; | ||
3 | +using System.Linq; | ||
4 | +using System.Web; | ||
5 | +using AIAHTML5.ADMIN.API.Entity; | ||
6 | + | ||
7 | +namespace AIAHTML5.ADMIN.API.Models | ||
8 | +{ | ||
9 | + public class UserGroupModel | ||
10 | + { | ||
11 | + public int Id { get; set; } | ||
12 | + public int LicenseId { get; set; } | ||
13 | + public string Title { get; set; } | ||
14 | + public DateTime? CreationDate { get; set; } | ||
15 | + public DateTime? ModifiedDate { get; set; } | ||
16 | + public bool? IsActive { get; set; } | ||
17 | + public int? TotalUsers { get; set; } | ||
18 | + | ||
19 | + public static List<UserGroupModel> GetLicenseUserGroups(AIADatabaseV5Entities dbContext, int LicenseId) | ||
20 | + { | ||
21 | + List<UserGroupModel> UserGroupList = new List<UserGroupModel>(); | ||
22 | + UserGroupModel UserGroupObj = new UserGroupModel(); | ||
23 | + try | ||
24 | + { | ||
25 | + var result = dbContext.usp_GetLicenseUserGroups(LicenseId).ToList(); | ||
26 | + foreach (var item in result) | ||
27 | + { | ||
28 | + UserGroupObj = new UserGroupModel(); | ||
29 | + UserGroupObj.Id = item.Id; | ||
30 | + UserGroupObj.LicenseId = item.LicenseId; | ||
31 | + UserGroupObj.Title = item.Title; | ||
32 | + UserGroupObj.IsActive = item.IsActive; | ||
33 | + UserGroupObj.ModifiedDate = item.ModifiedDate; | ||
34 | + UserGroupObj.CreationDate = item.CreationDate; | ||
35 | + UserGroupObj.TotalUsers = item.TotalUsers; | ||
36 | + UserGroupList.Add(UserGroupObj); | ||
37 | + } | ||
38 | + } | ||
39 | + catch (Exception ex) { } | ||
40 | + return UserGroupList; | ||
41 | + } | ||
42 | + | ||
43 | + public static List<UserModel> GetLicenseUserGroupUsers(AIADatabaseV5Entities dbContext, int LicenseId, int UserGroupId) | ||
44 | + { | ||
45 | + List<UserModel> UserList = new List<UserModel>(); | ||
46 | + UserModel UserModelObj = new UserModel(); | ||
47 | + try | ||
48 | + { | ||
49 | + var result = dbContext.GetAllUserWithGroup(LicenseId, UserGroupId).ToList(); | ||
50 | + foreach (var item in result) | ||
51 | + { | ||
52 | + UserModelObj = new UserModel(); | ||
53 | + UserModelObj.Id = item.Id; | ||
54 | + UserModelObj.FirstName = item.FirstName; | ||
55 | + UserModelObj.LastName = item.LastName; | ||
56 | + UserModelObj.LoginId = item.LoginId; | ||
57 | + UserModelObj.EmailId = item.EmailId; | ||
58 | + UserModelObj.ProductEdition = item.Title; | ||
59 | + UserModelObj.InGroup = item.InGroup; | ||
60 | + UserList.Add(UserModelObj); | ||
61 | + } | ||
62 | + } | ||
63 | + catch (Exception ex) { } | ||
64 | + return UserList; | ||
65 | + } | ||
66 | + | ||
67 | + public static bool InsertUpdateLicenseUserGroup(AIADatabaseV5Entities dbContext, UserGroupModel UserGroupEntity) | ||
68 | + { | ||
69 | + var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); | ||
70 | + try | ||
71 | + { | ||
72 | + dbContext.usp_InsertUpdateLicenseUserGroup(UserGroupEntity.Id, UserGroupEntity.LicenseId, UserGroupEntity.Title, | ||
73 | + UserGroupEntity.CreationDate, UserGroupEntity.ModifiedDate, UserGroupEntity.IsActive, spStatus); | ||
74 | + return (bool)spStatus.Value; | ||
75 | + } | ||
76 | + catch (Exception ex) | ||
77 | + { | ||
78 | + return false; | ||
79 | + } | ||
80 | + } | ||
81 | + | ||
82 | + public static bool UpdateLicenseUserGroupUsers(AIADatabaseV5Entities dbContext, int UserGroupId, string UserIds) | ||
83 | + { | ||
84 | + var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); | ||
85 | + try | ||
86 | + { | ||
87 | + dbContext.usp_UpdateLicenseUserGroupUsers(UserGroupId, UserIds, spStatus); | ||
88 | + return (bool)spStatus.Value; | ||
89 | + } | ||
90 | + catch (Exception ex) | ||
91 | + { | ||
92 | + return false; | ||
93 | + } | ||
94 | + } | ||
95 | + | ||
96 | + public static bool DeleteLicenseUserGroup(AIADatabaseV5Entities dbContext, int UserGroupId) | ||
97 | + { | ||
98 | + var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); | ||
99 | + try | ||
100 | + { | ||
101 | + dbContext.usp_DeleteLicenseUserGroup(UserGroupId, spStatus); | ||
102 | + return (bool)spStatus.Value; | ||
103 | + } | ||
104 | + catch (Exception ex) | ||
105 | + { | ||
106 | + return false; | ||
107 | + } | ||
108 | + } | ||
109 | + | ||
110 | + } | ||
111 | + | ||
112 | +} | ||
0 | \ No newline at end of file | 113 | \ No newline at end of file |
150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usergroupmergecode/usergroupmergecode/UserModel.cs
0 → 100644
1 | +using System; | ||
2 | +using System.Collections.Generic; | ||
3 | +using System.Linq; | ||
4 | +using System.Web; | ||
5 | +using AIAHTML5.ADMIN.API.Entity; | ||
6 | + | ||
7 | +namespace AIAHTML5.ADMIN.API.Models | ||
8 | +{ | ||
9 | + public class UserModel | ||
10 | + { | ||
11 | + public int Id { get; set; } | ||
12 | + public string FirstName { get; set; } | ||
13 | + public string LastName { get; set; } | ||
14 | + public string EmailId { get; set; } | ||
15 | + public string LoginId { get; set; } | ||
16 | + public string NewLoginId { get; set; } | ||
17 | + public string Password { get; set; } | ||
18 | + public int SecurityQuestionId { get; set; } | ||
19 | + public string SecurityAnswer { get; set; } | ||
20 | + public int CreatorId { get; set; } | ||
21 | + public DateTime CreationDate { get; set; } | ||
22 | + public DateTime DeactivationDate { get; set; } | ||
23 | + public int ModifierId { get; set; } | ||
24 | + public DateTime ModifiedDate { get; set; } | ||
25 | + public int UserTypeId { get; set; } | ||
26 | + public bool IsActive { get; set; } | ||
27 | + public string ProductEdition { get; set; } | ||
28 | + public int InGroup { get; set; } | ||
29 | + | ||
30 | + public static bool UpdateUserProfile(AIADatabaseV5Entities dbContext, int intUserID, string strFirstName, string strLastName, string strEmailID) | ||
31 | + { | ||
32 | + var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); | ||
33 | + try | ||
34 | + { | ||
35 | + dbContext.UpdateUserProfile(intUserID, strFirstName, strLastName, strEmailID, spStatus); | ||
36 | + if (spStatus.Value.ToString() == "1") | ||
37 | + { | ||
38 | + return true; | ||
39 | + } | ||
40 | + else | ||
41 | + { | ||
42 | + return false; | ||
43 | + } | ||
44 | + } | ||
45 | + catch (Exception ex) | ||
46 | + { | ||
47 | + return false; | ||
48 | + } | ||
49 | + } | ||
50 | + public static bool UpdateUserPassword(AIADatabaseV5Entities dbContext, int intUserID, string newPassword) | ||
51 | + { | ||
52 | + var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); | ||
53 | + try | ||
54 | + { | ||
55 | + dbContext.UpdateAiaUserPassword(intUserID, newPassword, spStatus); | ||
56 | + return (bool)spStatus.Value; | ||
57 | + } | ||
58 | + catch (Exception ex) | ||
59 | + { | ||
60 | + return false; | ||
61 | + } | ||
62 | + } | ||
63 | + public static string UpdateUserId(AIADatabaseV5Entities dbContext, int id, string userId, string oldUserId) | ||
64 | + { | ||
65 | + var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); | ||
66 | + try | ||
67 | + { | ||
68 | + dbContext.usp_UpdateUserId(id, userId, oldUserId, spStatus); | ||
69 | + if (spStatus.Value.ToString() == "1") | ||
70 | + { | ||
71 | + // return "success"; | ||
72 | + return "1"; | ||
73 | + } | ||
74 | + else if (spStatus.Value.ToString() == "2") | ||
75 | + { | ||
76 | + return "2"; | ||
77 | + // return "Already Exist Userid"; | ||
78 | + } | ||
79 | + else | ||
80 | + { | ||
81 | + return "fail"; | ||
82 | + } | ||
83 | + } | ||
84 | + catch (Exception ex) | ||
85 | + { | ||
86 | + return ex.Message; | ||
87 | + } | ||
88 | + } | ||
89 | + } | ||
90 | +} | ||
0 | \ No newline at end of file | 91 | \ No newline at end of file |
150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usergroupmergecode/usergroupmergecode/mergecode.txt
0 → 100644
1 | +//user.service.ts | ||
2 | + | ||
3 | + GetLicenseUserGroups(licensId: number) { | ||
4 | + return this.http.get(this.commonService.resourceBaseUrl + "UserGroup/LicenseUserGroups?LicenseId=" + licensId) | ||
5 | + .map(this.extractData) | ||
6 | + .catch((res: Response) => this.handleError(res)); | ||
7 | + } | ||
8 | + | ||
9 | + GetLicenseUserGroupUsers(licensId: number, UserGroupId: number) { | ||
10 | + return this.http.get(this.commonService.resourceBaseUrl + "UserGroup/LicenseUserGroupUsers?LicenseId=" + licensId + "&UserGroupId=" + UserGroupId) | ||
11 | + .map(this.extractData) | ||
12 | + .catch((res: Response) => this.handleError(res)); | ||
13 | + } | ||
14 | + | ||
15 | + InsertUpdateLicenseUserGroup(obj: any) { | ||
16 | + //let options = new RequestOptions({ headers: this.headers }); | ||
17 | + var jsonData = {'id': obj.id, 'licenseId': obj.licenseId, 'creationDate': obj.creationDate, 'modifiedDate': obj.modifiedDate, 'title': obj.title, 'isActive': obj.isActive }; | ||
18 | + var headers = new Headers({ | ||
19 | + 'Content-Type': 'application/json' | ||
20 | + }); | ||
21 | + return this.http.post(this.commonService.resourceBaseUrl + "UserGroup/InsertUpdateLicenseUserGroup", | ||
22 | + JSON.stringify(jsonData), {headers: headers}) | ||
23 | + .map(this.extractData) | ||
24 | + .catch((res: Response) => this.handleError(res)); | ||
25 | + } | ||
26 | + | ||
27 | + UpdateLicenseUserGroupUsers(userGroupId: number, userIds: string) { | ||
28 | + //let options = new RequestOptions({ headers: this.headers }); | ||
29 | + var jsonData = {'userGroupId': userGroupId, 'userIds': userIds }; | ||
30 | + var headers = new Headers({ | ||
31 | + 'Content-Type': 'application/json' | ||
32 | + }); | ||
33 | + return this.http.post(this.commonService.resourceBaseUrl + "UserGroup/UpdateLicenseUserGroupUsers", | ||
34 | + JSON.stringify(jsonData), {headers: headers}) | ||
35 | + .map(this.extractData) | ||
36 | + .catch((res: Response) => this.handleError(res)); | ||
37 | + } | ||
38 | + | ||
39 | + DeleteLicenseUserGroup(userGroupId: number) { | ||
40 | + return this.http.get(this.commonService.resourceBaseUrl + "UserGroup/DeleteLicenseUserGroup?UserGroupId=" + userGroupId) | ||
41 | + .map(this.extractData) | ||
42 | + .catch((res: Response) => this.handleError(res)); | ||
43 | +} | ||
44 | + | ||
45 | + | ||
46 | +//app.routing.module | ||
47 | + | ||
48 | +import { UserGroup } from './components/UserEntity/usergroup.component'; | ||
49 | + | ||
50 | + | ||
51 | + { path: 'usergroup', component: UserGroup } | ||
52 | + | ||
53 | + | ||
54 | +//app.module.ts | ||
55 | + | ||
56 | +import { UserGroup } from './components/UserEntity/usergroup.component'; | ||
57 | + | ||
58 | +UserGroup | ||
59 | + | ||
60 | +//app.component.html | ||
61 | + | ||
62 | + <li><a [routerLink]="['usergroup']">User Group</a></li> |
150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usergroupmergecode/usergroupmergecode/usergroup.component.html
0 → 100644
1 | +<!-- main-heading --> | ||
2 | +<div class="row"> | ||
3 | + | ||
4 | + <div class="col-sm-12 pageHeading" style="margin-left: 15px;"> | ||
5 | + <h4>{{mode}} User Group</h4> | ||
6 | + </div> | ||
7 | + | ||
8 | + <ng-template #template> | ||
9 | + <div class="modal-header"> | ||
10 | + <h4 class="modal-title pull-left">Delete</h4> | ||
11 | + <button type="button" class="close pull-right" aria-label="Close" (click)="modalRef.hide()"> | ||
12 | + <span aria-hidden="true">×</span> | ||
13 | + </button> | ||
14 | + </div> | ||
15 | + <div class="modal-body"> | ||
16 | + <p>Do you want to delete the selected user group?</p> | ||
17 | + </div> | ||
18 | + <div class="modal-footer"> | ||
19 | + <button type="button" class="btn btn-primary btn-sm" (click)="DeleteLicenseUserGroup(templatesuccess)">Yes</button> | ||
20 | + <button type="button" class="btn btn-primary btn-sm" (click)="modalRef.hide()">No</button> | ||
21 | + </div> | ||
22 | + </ng-template> | ||
23 | + | ||
24 | + <ng-template #templatesuccess> | ||
25 | + <div class="modal-header"> | ||
26 | + <h4 class="modal-title pull-left">Confirmation</h4> | ||
27 | + <button type="button" class="close pull-right" aria-label="Close" (click)="modalRef.hide()"> | ||
28 | + <span aria-hidden="true">×</span> | ||
29 | + </button> | ||
30 | + </div> | ||
31 | + <div class="modal-body" [innerHTML]="modalAlerts"> | ||
32 | + </div> | ||
33 | + <div class="modal-footer"> | ||
34 | + </div> | ||
35 | + </ng-template> | ||
36 | + | ||
37 | + <div class="col-sm-12"> | ||
38 | + | ||
39 | + <div class="container-fluid main-full"> | ||
40 | + <div class="row" [style.visibility]="(mode == 'Search') ? 'visible' : 'hidden'"> | ||
41 | + <div class="well no-margin-btm"> | ||
42 | + <div class="row"> | ||
43 | + <div class="form-group" *ngIf="alerts != ''"> | ||
44 | + <div class="col-xs-12"> | ||
45 | + <div class="alert alert-danger" [innerHTML]="alerts"> | ||
46 | + </div> | ||
47 | + </div> | ||
48 | + </div> | ||
49 | + <div class="col-lg-4 col-sm-4"> | ||
50 | + <div class="row"> | ||
51 | + <div class="col-sm-12"> | ||
52 | + <div class="form-group marginTop5"> | ||
53 | + <label for="AccountNumber" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">Account Number :</label> | ||
54 | + <div class="col-sm-12 col-lg-6 padd-left0 padd-right0"> | ||
55 | + <select #accountvalue class="form-control input-sm " id="AccountNumber" (change)="AccountNumberChanged($event.target.value)"> | ||
56 | + <option value="0">Select</option> | ||
57 | + <option *ngFor="let item of lstAccountNumbers;" value="{{item.Id}}">{{item.AccountNumber}}</option> | ||
58 | + </select> | ||
59 | + </div> | ||
60 | + </div> | ||
61 | + </div> | ||
62 | + </div> | ||
63 | + </div> | ||
64 | + <div class="col-lg-4 col-sm-4 padd-right0"> | ||
65 | + <div class="row"> | ||
66 | + <div class="col-sm-12"> | ||
67 | + <div class="form-group marginTop5"> | ||
68 | + <label for="New Group" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">New Group :</label> | ||
69 | + </div> | ||
70 | + <div class="col-sm-12 col-lg-6 padd-left0"> | ||
71 | + <input type="text" #title class="form-control input-sm" id="new-group" maxlength="100"> | ||
72 | + </div> | ||
73 | + </div> | ||
74 | + </div> | ||
75 | + </div> | ||
76 | + | ||
77 | + <div class="col-lg-4 col-sm-4"> | ||
78 | + <div class="row"> | ||
79 | + <div class="col-sm-2 padd-left0"> | ||
80 | + <div class="form-group marginTop5"> | ||
81 | + <label for="New Group" class="col-sm-12 col-md-1 paddTop7 padd-left0 padd-right0 hidden-xs"> </label> | ||
82 | + </div> | ||
83 | + <div class="col-sm-12 col-lg-2 padd-left0 padd-right0 mar-left6 mobile_1"> | ||
84 | + <button class="btn btn-primary btn-sm" type="button" (click)="InsertLicenseUserGroup(title.value, templatesuccess)" | ||
85 | + [disabled]="accountvalue.value==0"><i class="fa fa-plus-circle"></i> Add</button> | ||
86 | + </div> | ||
87 | + </div> | ||
88 | + </div> | ||
89 | + </div> | ||
90 | + | ||
91 | + </div> | ||
92 | + | ||
93 | + </div> | ||
94 | + | ||
95 | + <div class="well"> | ||
96 | + <div class="table-responsive blue"> | ||
97 | + <table id="tblLicenseUserGroups" class="table table-condensed table-bordered margin-btm0 table-striped table-hover table-fixed"> | ||
98 | + <thead> | ||
99 | + <tr> | ||
100 | + <th>Group Name</th> | ||
101 | + <th>Number of User(s)</th> | ||
102 | + <th>Created Date</th> | ||
103 | + <th>Last Modified Date</th> | ||
104 | + </tr> | ||
105 | + </thead> | ||
106 | + <tbody> | ||
107 | + <tr *ngFor="let item of lstLicenseUserGroups; let i = index;" (click)="SetClickedRow(i, item)" [class.active]="i == selectedRow" | ||
108 | + [class.inactive]="i != selectedRow"> | ||
109 | + <td> | ||
110 | + <input type="hidden" value={{item.Id}}/> {{item.Title}} | ||
111 | + </td> | ||
112 | + <td>{{item.TotalUsers}}</td> | ||
113 | + <td>{{item.CreationDate | date: 'MM/dd/yyyy'}}</td> | ||
114 | + <td>{{item.ModifiedDate | date: 'MM/dd/yyyy'}}</td> | ||
115 | + </tr> | ||
116 | + </tbody> | ||
117 | + </table> | ||
118 | + </div> | ||
119 | + | ||
120 | + <div class="row"> | ||
121 | + <div class="col-sm-12 marginTop20 text-center"> | ||
122 | + <button class="btn btn-primary btn-sm" (click)="ViewLicenseUserGroup()"><i class="fa fa-eye"></i> View</button> | ||
123 | + <button class="btn btn-primary btn-sm" (click)="EditLicenseUserGroup()"><i class="fa fa-edit"></i> Edit</button> | ||
124 | + <button class="btn btn-primary btn-sm" (click)="openModal(template)"><i class="fa fa-trash"></i> Remove</button> | ||
125 | + </div> | ||
126 | + </div> | ||
127 | + | ||
128 | + </div> | ||
129 | + </div> | ||
130 | + | ||
131 | + <form class="row" style="position: absolute; z-index: 100;" [style.top]="topPos" [style.visibility]="(mode == 'View' || mode == 'Edit') ? 'visible' : 'hidden'" | ||
132 | + [formGroup]="updateUserGroupFrm" (submit)="UpdateLicenseUserGroup(templatesuccess)"> | ||
133 | + | ||
134 | + <div class="well no-margin-btm"> | ||
135 | + <div class="row"> | ||
136 | + <div class="form-group" *ngIf="alerts != ''"> | ||
137 | + <div class="col-xs-12"> | ||
138 | + <div class="alert alert-danger" [innerHTML]="alerts"> | ||
139 | + </div> | ||
140 | + </div> | ||
141 | + </div> | ||
142 | + <div class="col-lg-4 col-sm-4 padd-right0"> | ||
143 | + <div class="row"> | ||
144 | + <div class="col-sm-12"> | ||
145 | + <div class="form-group marginTop5"> | ||
146 | + <label for="GroupName" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">Group Name :</label> | ||
147 | + </div> | ||
148 | + <div class="col-sm-12 col-lg-6 padd-left0"> | ||
149 | + <input type="text" class="form-control input-sm" formControlName="userGroupName" id="GroupName" maxlength="100"> | ||
150 | + <div *ngIf="!updateUserGroupFrm.controls.userGroupName.valid && updateUserGroupFrm.controls.userGroupName.dirty" class="alert alert-danger" style="padding: 2px; margin-bottom: 2px;">User group name is required</div> | ||
151 | + </div> | ||
152 | + </div> | ||
153 | + </div> | ||
154 | + </div> | ||
155 | + </div> | ||
156 | + </div> | ||
157 | + | ||
158 | + <div class="well"> | ||
159 | + | ||
160 | + <div class="table-responsive blue"> | ||
161 | + | ||
162 | + <table id="fixed_hdr2" class="table-hover"> | ||
163 | + <thead> | ||
164 | + <tr> | ||
165 | + <th [style.display]="(mode == 'Edit') ? 'block' : 'none'">Select</th> | ||
166 | + <th>First Name</th> | ||
167 | + <th>Last Name</th> | ||
168 | + <th>User ID</th> | ||
169 | + <th>Email ID</th> | ||
170 | + <th>Product Edition</th> | ||
171 | + </tr> | ||
172 | + </thead> | ||
173 | + <tbody> | ||
174 | + <tr *ngFor="let item of lstLicenseUserGroupUsers; let i = index"> | ||
175 | + <td [style.display]="(mode == 'Edit') ? 'block' : 'none'"> | ||
176 | + <input type="hidden" value="{{item.Id}}"> | ||
177 | + <input type="checkbox" (change)="onChange(i, item.Id, $event.target.checked)" [checked]="item.InGroup"> | ||
178 | + </td> | ||
179 | + <td>{{item.FirstName}}</td> | ||
180 | + <td>{{item.LastName}}</td> | ||
181 | + <td>{{item.UserId}}</td> | ||
182 | + <td>{{item.EmailId}}</td> | ||
183 | + <td>{{item.ProductEdition}}</td> | ||
184 | + </tr> | ||
185 | + </tbody> | ||
186 | + </table> | ||
187 | + | ||
188 | + </div> | ||
189 | + | ||
190 | + <div class="row"> | ||
191 | + <div class="col-sm-12 marginTop20 text-center"> | ||
192 | + <button class="btn btn-primary btn-sm" type="submit" [disabled]="!updateUserGroupFrm.valid" [style.visibility]="(mode == 'Edit') ? 'visible' : 'hidden'"><i class="fa fa-plus-circle"></i> Update</button> | ||
193 | + <button class="btn btn-primary btn-sm" type="button" (click)="CancelAddEdit()"><i class="fa fa-times-circle"></i> Cancel</button> | ||
194 | + </div> | ||
195 | + </div> | ||
196 | + | ||
197 | + </div> | ||
198 | + | ||
199 | + </form> | ||
200 | + | ||
201 | + </div> | ||
202 | + </div> | ||
203 | +</div> | ||
204 | +<!-- main-heading --> | ||
0 | \ No newline at end of file | 205 | \ No newline at end of file |
150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usergroupmergecode/usergroupmergecode/usergroup.component.ts
0 → 100644
1 | +import { Component, OnInit, AfterViewInit, Input, Output, EventEmitter, Pipe, PipeTransform, TemplateRef } from '@angular/core'; | ||
2 | +import { UserService } from './user.service'; | ||
3 | +import { Router, ActivatedRoute } from '@angular/router'; | ||
4 | +import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; | ||
5 | +import { License } from '../UserEntity/datamodel'; | ||
6 | +import { BsDatepickerModule } from 'ngx-bootstrap'; | ||
7 | +import { Http, Response } from '@angular/http'; | ||
8 | +import { DatePipe } from '@angular/common'; | ||
9 | +import { BsModalService } from 'ngx-bootstrap/modal'; | ||
10 | +import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'; | ||
11 | + | ||
12 | +declare var $:any; | ||
13 | + | ||
14 | +@Component({ | ||
15 | + templateUrl: './usergroup.component.html' | ||
16 | +}) | ||
17 | + | ||
18 | +export class UserGroup implements OnInit { | ||
19 | + | ||
20 | + lstAccountNumbers: any; | ||
21 | + lstLicenseUserGroups: any; | ||
22 | + licenseUserGroup: any; | ||
23 | + lstLicenseUserGroupUsers: any; | ||
24 | + lstAllUsers: any; | ||
25 | + mode: string = 'Search'; | ||
26 | + license: License; | ||
27 | + updateUserGroupFrm: FormGroup; | ||
28 | + error: any; | ||
29 | + alerts: string; | ||
30 | + modalAlerts: string; | ||
31 | + divClass: string = ''; | ||
32 | + topPos: string = '2000px'; | ||
33 | + selectedRow: number = 0; | ||
34 | + selectedId: number = 0; | ||
35 | + modalRef: BsModalRef; | ||
36 | + checkedRecords: Array<number>; | ||
37 | + | ||
38 | + constructor(private userService: UserService, private router: Router, private activeRoute: ActivatedRoute, private fb: FormBuilder, private modalService: BsModalService) { } | ||
39 | + | ||
40 | + ngOnInit(): void | ||
41 | + { | ||
42 | + this.selectedRow = 0; | ||
43 | + this.divClass = 'col-sm-12'; | ||
44 | + this.license = new License(); | ||
45 | + this.alerts = ''; | ||
46 | + this.updateUserGroupFrm = this.fb.group({ | ||
47 | + userGroupName: ['', Validators.required], | ||
48 | + }); | ||
49 | + this.GetLicenseAccounts(); | ||
50 | + | ||
51 | + $('#fixed_hdr2').fxdHdrCol({ | ||
52 | + fixedCols: 0, | ||
53 | + width: "100%", | ||
54 | + height: 330, | ||
55 | + colModal: [ | ||
56 | + { width: 80, align: 'center' }, | ||
57 | + { width: 200, align: 'center' }, | ||
58 | + { width: 200, align: 'Center' }, | ||
59 | + { width: 200, align: 'Center' }, | ||
60 | + { width: 200, align: 'Center' }, | ||
61 | + { width: 250, align: 'Center' }, | ||
62 | + ], | ||
63 | + sort: true | ||
64 | + }); | ||
65 | + if(document.getElementById("fixed_table_rc") != undefined){ | ||
66 | + document.getElementById("fixed_table_rc").remove(); | ||
67 | + } | ||
68 | + var testScript = document.createElement("script"); | ||
69 | + testScript.setAttribute("id", "fixed_table_rc"); | ||
70 | + testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js"); | ||
71 | + testScript.setAttribute("type", "text/javascript"); | ||
72 | + document.body.appendChild(testScript); | ||
73 | + } | ||
74 | + | ||
75 | + openModal(template: TemplateRef<any>) { | ||
76 | + this.modalRef = this.modalService.show(template); | ||
77 | + } | ||
78 | + | ||
79 | + onChange(Idx: number, Id: number, isChecked: boolean){ | ||
80 | + if(isChecked){ | ||
81 | + this.checkedRecords[Idx] = Id; | ||
82 | + } | ||
83 | + else{ | ||
84 | + this.checkedRecords[Idx] = 0; | ||
85 | + } | ||
86 | + } | ||
87 | + | ||
88 | + SetClickedRow(i: number, item: any) { | ||
89 | + this.selectedRow = i; | ||
90 | + this.selectedId = item['Id']; | ||
91 | + this.licenseUserGroup = item; | ||
92 | + } | ||
93 | + | ||
94 | + BindFormFields(data){ | ||
95 | + this.lstLicenseUserGroups = data; | ||
96 | + this.licenseUserGroup = this.lstLicenseUserGroups[this.selectedRow]; | ||
97 | + this.selectedId = this.licenseUserGroup['Id']; | ||
98 | + } | ||
99 | + | ||
100 | + BindUserFormFields(data){ | ||
101 | + this.lstLicenseUserGroupUsers = data; | ||
102 | + if(this.mode == 'Edit'){ | ||
103 | + this.checkedRecords = new Array<number>(this.lstLicenseUserGroupUsers.length); | ||
104 | + for (let i = 0; i < this.lstLicenseUserGroupUsers.length ; i++) { | ||
105 | + if(this.lstLicenseUserGroupUsers[i].InGroup > 0){ | ||
106 | + this.checkedRecords[i] = this.lstLicenseUserGroupUsers[i].Id; | ||
107 | + } | ||
108 | + } | ||
109 | + } | ||
110 | + else{ | ||
111 | + this.lstLicenseUserGroupUsers = this.lstLicenseUserGroupUsers.filter(C => C.InGroup> 0); | ||
112 | + } | ||
113 | + } | ||
114 | + | ||
115 | + GetLicenseAccounts() { | ||
116 | + this.userService.GetAccountNumber() | ||
117 | + .subscribe(st => { this.lstAccountNumbers = st; }, error => this.error = <any>error); | ||
118 | + } | ||
119 | + | ||
120 | + GetLicenseUserGroups() { | ||
121 | + this.alerts = ''; | ||
122 | + this.userService.GetLicenseUserGroups(this.license.LicenseId) | ||
123 | + .subscribe(st => { this.BindFormFields(st); }, error => this.error = <any>error); | ||
124 | + } | ||
125 | + | ||
126 | + GetLicenseUserGroupUsers() { | ||
127 | + this.alerts = ''; | ||
128 | + this.userService.GetLicenseUserGroupUsers(this.license.LicenseId, this.selectedId) | ||
129 | + .subscribe(st => { this.BindUserFormFields(st); }, error => this.error = <any>error); | ||
130 | + } | ||
131 | + | ||
132 | + AccountNumberChanged(LicenseId: number){ | ||
133 | + this.license.LicenseId = LicenseId; | ||
134 | + this.lstLicenseUserGroups = null; | ||
135 | + this.GetLicenseUserGroups(); | ||
136 | + } | ||
137 | + | ||
138 | + AfterDeleteData(data, template) { | ||
139 | + if (data.Status == "false") { | ||
140 | + this.alerts = "<span>License user group delete unsuccessfull</span>"; | ||
141 | + } else { | ||
142 | + this.modalAlerts = "<p>License user group deleted successfully</p>"; | ||
143 | + this.modalRef = this.modalService.show(template); | ||
144 | + this.GetLicenseUserGroups(); | ||
145 | + } | ||
146 | + } | ||
147 | + | ||
148 | + AfterInsertData(data, template) { | ||
149 | + if (data.Status == "false") { | ||
150 | + this.alerts = "<span>License user group save unsuccessfull</span>"; | ||
151 | + } else { | ||
152 | + this.modalAlerts = "<p>License user group saved successfully</p>"; | ||
153 | + this.modalRef = this.modalService.show(template); | ||
154 | + this.GetLicenseUserGroups(); | ||
155 | + } | ||
156 | + } | ||
157 | + | ||
158 | + AfterUpdateData(data, template) { | ||
159 | + if (data.Status == "false") { | ||
160 | + this.alerts = "<span>License user group update unsuccessfull</span>"; | ||
161 | + } else { | ||
162 | + this.modalAlerts = "<p>License user group updated successfully</p>"; | ||
163 | + this.modalRef = this.modalService.show(template); | ||
164 | + this.GetLicenseUserGroups(); | ||
165 | + } | ||
166 | + } | ||
167 | + | ||
168 | + InsertLicenseUserGroup(title: string, template: TemplateRef<any>) { | ||
169 | + this.alerts = ''; | ||
170 | + if(title == '' || title == undefined){ | ||
171 | + this.alerts = "<span>Please enter a name for user group.</span>"; | ||
172 | + return; | ||
173 | + } | ||
174 | + var obj = { | ||
175 | + 'id': 0, 'licenseId': this.license.LicenseId, 'title': title, | ||
176 | + 'isActive': true, 'creationDate': new Date(), | ||
177 | + 'modifiedDate': new Date() | ||
178 | + }; | ||
179 | + if(this.alerts == ''){ | ||
180 | + return this.userService.InsertUpdateLicenseUserGroup(obj) | ||
181 | + .subscribe( | ||
182 | + n => (this.AfterInsertData(n, template)), | ||
183 | + error => this.error = <any>error); | ||
184 | + } | ||
185 | + } | ||
186 | + | ||
187 | + UpdateLicenseUserGroup(template: TemplateRef<any>) { | ||
188 | + this.alerts = ''; | ||
189 | + var obj = { | ||
190 | + 'id': this.licenseUserGroup.Id, | ||
191 | + 'licenseId': this.license.LicenseId, | ||
192 | + 'title': this.updateUserGroupFrm.controls['userGroupName'].value, | ||
193 | + 'isActive': this.licenseUserGroup.IsActive, | ||
194 | + 'creationDate': this.licenseUserGroup.CreationDate, | ||
195 | + 'modifiedDate': this.licenseUserGroup.ModifiedDate | ||
196 | + }; | ||
197 | + if(this.alerts == ''){ | ||
198 | + return this.userService.InsertUpdateLicenseUserGroup(obj) | ||
199 | + .subscribe( | ||
200 | + n => ( | ||
201 | + this.UpdateLicenseUserGroupUsers(template) | ||
202 | + ), | ||
203 | + error => this.error = <any>error); | ||
204 | + } | ||
205 | + } | ||
206 | + | ||
207 | + UpdateLicenseUserGroupUsers(template: TemplateRef<any>) { | ||
208 | + var userIds = ''; | ||
209 | + this.checkedRecords.filter(C => C > 0).forEach(element => { | ||
210 | + if(element > 0){ | ||
211 | + userIds += element + ','; | ||
212 | + } | ||
213 | + }); | ||
214 | + if(userIds!=''){ | ||
215 | + userIds = userIds.substr(0, userIds.length - 1); | ||
216 | + } | ||
217 | + return this.userService.UpdateLicenseUserGroupUsers(this.selectedId, userIds) | ||
218 | + .subscribe( | ||
219 | + n => ( | ||
220 | + this.AfterUpdateData(n, template) | ||
221 | + ), | ||
222 | + error => this.error = <any>error); | ||
223 | + } | ||
224 | + | ||
225 | + DeleteLicenseUserGroup(template: TemplateRef<any>){ | ||
226 | + this.modalRef.hide(); | ||
227 | + this.alerts = ''; | ||
228 | + if(this.selectedId == 0){ | ||
229 | + this.alerts = "<span>Please select a license user group</span>"; | ||
230 | + } | ||
231 | + if(this.alerts == ''){ | ||
232 | + return this.userService.DeleteLicenseUserGroup(this.selectedId) | ||
233 | + .subscribe( | ||
234 | + data => (this.AfterDeleteData(data, template)), | ||
235 | + error => { | ||
236 | + this.error = <any>error; | ||
237 | + this.alerts = "<span>License user group delete unsuccessfull</span>"; | ||
238 | + }); | ||
239 | + } | ||
240 | + } | ||
241 | + | ||
242 | + EditLicenseUserGroup(){ | ||
243 | + $('.ft_r thead tr th:eq(0)').show(); | ||
244 | + this.mode = 'Edit'; | ||
245 | + this.topPos = '100px'; | ||
246 | + this.alerts = ''; | ||
247 | + this.updateUserGroupFrm.controls['userGroupName'].setValue(this.licenseUserGroup.Title); | ||
248 | + this.GetLicenseUserGroupUsers(); | ||
249 | + } | ||
250 | + | ||
251 | + ViewLicenseUserGroup(){ | ||
252 | + $('.ft_r thead tr th:eq(0)').hide(); | ||
253 | + this.mode = 'View'; | ||
254 | + this.topPos = '100px'; | ||
255 | + this.alerts = ''; | ||
256 | + this.updateUserGroupFrm.controls['userGroupName'].setValue(this.licenseUserGroup.Title); | ||
257 | + this.GetLicenseUserGroupUsers(); | ||
258 | + } | ||
259 | + | ||
260 | + CancelAddEdit(){ | ||
261 | + this.mode = 'Search'; | ||
262 | + this.topPos = '2000px'; | ||
263 | + this.GetLicenseUserGroups(); | ||
264 | + this.selectedRow = this.lstLicenseUserGroups.findIndex(C => C.Id == this.selectedId); | ||
265 | + this.SetClickedRow(this.selectedRow, this.lstLicenseUserGroups.find(C => C.Id == this.selectedId)); | ||
266 | + } | ||
267 | +} |
150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usergroupmergecode/usergroupmergecode/users.component.ts
0 → 100644
1 | +import { Component, OnInit, AfterViewInit,ViewChild } from '@angular/core'; | ||
2 | +import { UserService } from './user.service'; | ||
3 | +import { Router } from '@angular/router'; | ||
4 | +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; | ||
5 | +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; | ||
6 | +import { User } from '../UserEntity/datamodel'; | ||
7 | +import { UserManageRightsModel } from '../UserEntity/datamodel'; | ||
8 | +import { Http, Response } from '@angular/http'; | ||
9 | +//import { Global } from '../../Shared/global'; | ||
10 | +//import { DBOperation } from 'S'; | ||
11 | +import { Observable } from 'rxjs/Observable'; | ||
12 | +import { ConfirmService } from '../../Shared/Confirm/confirm.service'; | ||
13 | +import 'rxjs/Rx'; | ||
14 | +import 'rxjs/add/operator/map'; | ||
15 | +import 'rxjs/add/operator/filter'; | ||
16 | +import { LoadingService } from '../../shared/loading.service'; | ||
17 | +declare var $: any; | ||
18 | +import { DatePipe } from '@angular/common'; | ||
19 | +import { GlobalService } from '../../Shared/global'; | ||
20 | +@Component({ | ||
21 | + templateUrl:'./users.component.html' // '../../../../../wwwroot/html/UpdateProfile/updateuserprofile.component.html' | ||
22 | +}) | ||
23 | + | ||
24 | +export class UsersList implements OnInit { | ||
25 | + | ||
26 | + Mode: string = 'Manage'; | ||
27 | + modalTitle: string; | ||
28 | + Users: FormGroup; | ||
29 | + adduserFrm: FormGroup; | ||
30 | + managerightFrm: FormGroup; | ||
31 | + alerts: string; | ||
32 | + public UserTypeList: any; | ||
33 | + public AccountTypeList: any; | ||
34 | + public UserList: any; | ||
35 | + public UserManageRightsList: Array<UserManageRightsModel>; | ||
36 | + emailPattern = "^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$"; | ||
37 | + public UserTypeListByLicense: any; | ||
38 | + public AccountNumberList: any; | ||
39 | + public ProductEditionList: any; | ||
40 | + UserEntity: User; | ||
41 | + public UserManageRightsEntity: UserManageRightsModel; | ||
42 | + topPos: string = '2000px'; | ||
43 | + datePipe: DatePipe = new DatePipe('en-US'); | ||
44 | + error; | ||
45 | + selectedRow: number = 0; | ||
46 | + selectedId: number = 0; | ||
47 | + divClass: string; | ||
48 | + isActive: boolean; | ||
49 | + NoRecord: string; | ||
50 | + //@ViewChild("profileModal") | ||
51 | + //profileModal: ModalComponent; | ||
52 | + //errorMessage: any; | ||
53 | + constructor(private _loadingService: LoadingService,private userservice: UserService, private router: Router, private fb: FormBuilder, private http: Http, | ||
54 | + private _confirmService: ConfirmService,private global:GlobalService | ||
55 | + ) { } | ||
56 | + | ||
57 | + ngOnInit(): void { | ||
58 | + this.modalTitle = 'LIST USER'; | ||
59 | + this.alerts = ''; | ||
60 | + this.NoRecord = this.global.NoRecords; | ||
61 | + this.Users = this.fb.group({ | ||
62 | + FirstName:[''], | ||
63 | + LastName: [''], | ||
64 | + EmailId: [''], | ||
65 | + AccountNumber: [''], | ||
66 | + UserTypeId: [0], //bug#28162 | ||
67 | + AccountTypeId: [0] | ||
68 | + // Gender: ['', Validators.required], | ||
69 | + // Email: [''] | ||
70 | + | ||
71 | + }); | ||
72 | + this.adduserFrm = this.fb.group({ | ||
73 | + id: [''], | ||
74 | + UserName: ['', Validators.required], | ||
75 | + Password: ['', [Validators.required, Validators.minLength(8)]], | ||
76 | + ConfirmPassword: ['', Validators.required], | ||
77 | + FirstName: ['', Validators.required], | ||
78 | + LastName: ['', Validators.required], | ||
79 | + EmailId: ['', Validators.required], | ||
80 | + AccountNumber: [''], | ||
81 | + UserType: [''], | ||
82 | + AccountType: [''], | ||
83 | + Createddate: [''], | ||
84 | + LastModifiedDate: [''], | ||
85 | + Createdby: [''], | ||
86 | + Modifiedby: [''], | ||
87 | + DeactivationDate: [''], | ||
88 | + isActive: [false], | ||
89 | + UserStatusActive: ['false'], | ||
90 | + UserStatusInActive:[''] | ||
91 | + }); | ||
92 | + this.managerightFrm = this.fb.group({ | ||
93 | + id: [''], | ||
94 | + UserTypeTitle: [''] | ||
95 | + }); | ||
96 | + this._loadingService.ShowLoading("global-loading"); | ||
97 | + this.GetUserType(); | ||
98 | + this.GetAccountType(); | ||
99 | + this._loadingService.HideLoading("global-loading"); | ||
100 | + $('#fixed_hdr2').fxdHdrCol({ | ||
101 | + fixedCols: 0, | ||
102 | + width: "100%", | ||
103 | + height: 300, | ||
104 | + colModal: [ | ||
105 | + { width: 180, align: 'center' }, | ||
106 | + { width: 230, align: 'center' }, | ||
107 | + { width: 150, align: 'Center' }, | ||
108 | + { width: 150, align: 'Center' }, | ||
109 | + { width: 350, align: 'Center' }, | ||
110 | + { width: 200, align: 'Center' }, | ||
111 | + { width: 130, align: 'Center' }, | ||
112 | + { width: 120, align: 'center' }, | ||
113 | + { width: 280, align: 'Center' }, | ||
114 | + { width: 180, align: 'center' }, | ||
115 | + { width: 200, align: 'center' }, | ||
116 | + { width: 170, align: 'center' }, | ||
117 | + { width: 80, align: 'center' }, | ||
118 | + { width: 150, align: 'center' }, | ||
119 | + { width: 150, align: 'center' }, | ||
120 | + { width: 180, align: 'Center' }, | ||
121 | + { width: 400, align: 'Center' }, | ||
122 | + { width: 150, align: 'center' }, | ||
123 | + { width: 110, align: 'center' }, | ||
124 | + ], | ||
125 | + sort: true | ||
126 | + }); | ||
127 | + document.getElementById("fixed_table_rc").remove(); | ||
128 | + var testScript = document.createElement("script"); | ||
129 | + testScript.setAttribute("id", "fixed_table_rc"); | ||
130 | + testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js"); | ||
131 | + testScript.setAttribute("type", "text/javascript"); | ||
132 | + document.body.appendChild(testScript); | ||
133 | + this._loadingService.ShowLoading("global-loading"); | ||
134 | + //this.bindUsers(); | ||
135 | + this._loadingService.HideLoading("global-loading"); | ||
136 | + | ||
137 | + //this.GetUserList(); | ||
138 | + } | ||
139 | + handleChange(evt) { | ||
140 | + debugger; | ||
141 | + var target = evt.target; | ||
142 | + if (target.value == 'true') { | ||
143 | + this.isActive = true; | ||
144 | + } | ||
145 | + else if (target.value == 'false') { | ||
146 | + this.isActive = false; | ||
147 | + } | ||
148 | + } | ||
149 | + | ||
150 | + public SetClickedRow(i: number, item: any) { | ||
151 | + this.selectedRow = i; | ||
152 | + this.selectedId = item['Id']; | ||
153 | + this.UserEntity = item; | ||
154 | + } | ||
155 | + public SetClickedRowManageRight(j: number, item: any) { | ||
156 | + this.selectedRow = j; | ||
157 | + this.selectedId = item['Id']; | ||
158 | + this.UserManageRightsList = item; | ||
159 | + } | ||
160 | + redirect() { | ||
161 | + this.router.navigate(['/']); | ||
162 | + } | ||
163 | + | ||
164 | + GetUserType() { | ||
165 | + this.userservice.GetUserType().subscribe(x => { this.UserTypeList = x; }, error => this.error = <any>error); | ||
166 | + } | ||
167 | + GetAccountType() { | ||
168 | + this.userservice.GetAccountType().subscribe(x => { this.AccountTypeList = x; }, error => this.error = <any>error); | ||
169 | + } | ||
170 | + GetUserList() { | ||
171 | + //this.userservice.GetUserList().subscribe(x => { this.UserList = x; }, error => this.error = <any>error); | ||
172 | + } | ||
173 | + GetUserRights() { | ||
174 | + this.userservice.GetManageUserRights({ | ||
175 | + UserId: this.managerightFrm.controls['id'].value, | ||
176 | + UserType: this.managerightFrm.controls['UserTypeTitle'].value | ||
177 | + }) | ||
178 | + .subscribe(x => { console.log(x); this.UserManageRightsList = x }, error => { | ||
179 | + this.error = <any>error; | ||
180 | + this.alerts = "<span>" + this.error + "</span>"; | ||
181 | + }); | ||
182 | + } | ||
183 | + SearchUserList(this) | ||
184 | + { | ||
185 | + this._loadingService.ShowLoading("global-loading"); | ||
186 | + var UserFilterControl = this.Users.value; | ||
187 | + this.userservice.GetUserList( | ||
188 | + { | ||
189 | + FirstName: this.Users.controls['FirstName'].value, | ||
190 | + LastName: this.Users.controls['LastName'].value, | ||
191 | + EmailId: this.Users.controls['EmailId'].value, | ||
192 | + AccountNumber: this.Users.controls['AccountNumber'].value, | ||
193 | + UserTypeId: (this.Users.controls['UserTypeId'].value != null && this.Users.controls['UserTypeId'].value !='' ? this.Users.controls['UserTypeId'].value:0), | ||
194 | + AccountTypeId: (this.Users.controls['AccountTypeId'].value != null && this.Users.controls['AccountTypeId'].value != ''? this.Users.controls['AccountTypeId'].value : 0), | ||
195 | + | ||
196 | + | ||
197 | + }) | ||
198 | + | ||
199 | + .subscribe(x => { this.BindFormFields(x) }, error => this.error = <any>error); | ||
200 | + | ||
201 | + } | ||
202 | + BindFormFields(data) { | ||
203 | + this.UserList = data; | ||
204 | + if (this.UserList.length > 0) { | ||
205 | + this.NoRecord = ''; | ||
206 | + this._loadingService.HideLoading("global-loading"); | ||
207 | + } | ||
208 | + if (this.UserList.length == 0) { | ||
209 | + this.NoRecord = this.global.NoRecords; | ||
210 | + this._loadingService.HideLoading("global-loading"); | ||
211 | + } | ||
212 | + } | ||
213 | + EditUser() { | ||
214 | + debugger; | ||
215 | + this.Mode = 'Edit'; | ||
216 | + this.modalTitle = 'Edit USER'; | ||
217 | + this.topPos = '100px'; | ||
218 | + this.divClass = 'col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3'; | ||
219 | + this.alerts = ''; | ||
220 | + this.adduserFrm.controls['id'].setValue(this.UserEntity.Id) | ||
221 | + this.adduserFrm.controls['FirstName'].setValue(this.UserEntity.FirstName) | ||
222 | + this.adduserFrm.controls['LastName'].setValue(this.UserEntity.LastName) | ||
223 | + this.adduserFrm.controls['EmailId'].setValue(this.UserEntity.EmailId) | ||
224 | + this.adduserFrm.controls['UserName'].setValue(this.UserEntity.LoginId) | ||
225 | + this.adduserFrm.controls['Password'].setValue(this.UserEntity.Password) | ||
226 | + this.adduserFrm.controls['ConfirmPassword'].setValue(this.UserEntity.Password) | ||
227 | + this.adduserFrm.controls['AccountNumber'].setValue(this.UserEntity.AccountNumber) | ||
228 | + this.adduserFrm.controls['UserType'].setValue(this.UserEntity.UserTypeTitle) | ||
229 | + this.adduserFrm.controls['AccountType'].setValue(this.UserEntity.AccountTypeTitle) | ||
230 | + this.adduserFrm.controls['Createddate'].setValue(this.datePipe.transform(this.UserEntity.CreationDate, 'MM/dd/yyyy')) | ||
231 | + this.adduserFrm.controls['LastModifiedDate'].setValue(this.datePipe.transform(this.UserEntity.ModifiedDate, 'MM/dd/yyyy')) | ||
232 | + this.adduserFrm.controls['Createdby'].setValue(this.UserEntity.Createdby) | ||
233 | + this.adduserFrm.controls['Modifiedby'].setValue(this.UserEntity.Modifiedby) | ||
234 | + this.adduserFrm.controls['DeactivationDate'].setValue(this.datePipe.transform(this.UserEntity.DeactivationDate, 'MM/dd/yyyy')) | ||
235 | + if (this.UserEntity.UserStatus == 'Active') { | ||
236 | + this.adduserFrm.controls['UserStatusActive'].setValue('true') | ||
237 | + } | ||
238 | + else { | ||
239 | + this.adduserFrm.controls['UserStatusActive'].setValue('false') | ||
240 | + } | ||
241 | + //this.adduserFrm.controls['UserStatusActive'].setValue(true) | ||
242 | + //this.adduserFrm.controls['UserStatusInActive'].setValue(false) | ||
243 | + this.isActive = (this.UserEntity.UserStatus=='Active'?true :false) | ||
244 | + | ||
245 | + } | ||
246 | + | ||
247 | + EditManageUserRights() { | ||
248 | + this.Mode = 'ManageRight'; | ||
249 | + this.modalTitle = 'MANAGE USER Right'; | ||
250 | + this.topPos = '100px'; | ||
251 | + this.divClass = 'col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3'; | ||
252 | + this.alerts = ''; | ||
253 | + this.managerightFrm.controls['id'].setValue(this.UserEntity.Id); | ||
254 | + this.managerightFrm.controls['UserTypeTitle'].setValue(this.UserEntity.UserTypeTitle); | ||
255 | + this.GetUserRights(); | ||
256 | + } | ||
257 | + | ||
258 | + public UpdateUser(this) { | ||
259 | + this.alerts = ''; | ||
260 | + if (this.adduserFrm.value.UserName == '') { | ||
261 | + this.alerts += '<span>User Name is required.</span>'; | ||
262 | + } | ||
263 | + if (this.adduserFrm.value.Password == '') { | ||
264 | + this.alerts += '</br><span>Password of minimum 8 characters is required.</span>'; | ||
265 | + } | ||
266 | + if (this.adduserFrm.value.ConfirmPassword == '') { | ||
267 | + this.alerts += '</br><span>Confirm Password is required.</span>'; | ||
268 | + } | ||
269 | + if (this.adduserFrm.value.EmailId == '') { | ||
270 | + this.alerts += '</br><span>Email Id is required.</span>'; | ||
271 | + } | ||
272 | + if (this.adduserFrm.value.FirstName == '') { | ||
273 | + this.alerts += '</br><span>First Name is required.</span>'; | ||
274 | + } | ||
275 | + if (this.adduserFrm.value.LastName == '') { | ||
276 | + this.alerts += '</br><span>Last Name is required.</span>'; | ||
277 | + } | ||
278 | + if (this.adduserFrm.value.newPassword != this.adduserFrm.value.confirmPassword) { | ||
279 | + this.alerts += '</br><span>Password and confirm password must be same</span>'; | ||
280 | + } | ||
281 | + | ||
282 | + if (this.adduserFrm.valid && this.alerts == '') { | ||
283 | + this.adduserFrm.controls['isActive'].setValue(this.adduserFrm.value.UserStatusActive) | ||
284 | + | ||
285 | + var UserEntity = this.adduserFrm.value; | ||
286 | + | ||
287 | + return this.userservice.UpdateUserEntity(UserEntity) | ||
288 | + .subscribe( | ||
289 | + n => (this.AfterInsertData(n)), | ||
290 | + error => { | ||
291 | + this.error = <any>error; | ||
292 | + this.alerts = "<span>" + this.error + "</span>"; | ||
293 | + }); | ||
294 | + } | ||
295 | + | ||
296 | + } | ||
297 | + | ||
298 | + //public DeleteUnblockedUser(this) { | ||
299 | + // this.alerts = ''; | ||
300 | + //} | ||
301 | + | ||
302 | + AfterInsertData(data) { | ||
303 | + | ||
304 | + if (data == "User updated successfully") { | ||
305 | + this.alerts = ''; | ||
306 | + this._confirmService.activate("User updated successfully.", "alertMsg"); | ||
307 | + } | ||
308 | + //if (this.closeflag) { | ||
309 | + // this.close.emit(null); | ||
310 | + //} | ||
311 | + //else { | ||
312 | + //} | ||
313 | + } | ||
314 | + | ||
315 | + ResetFormFields() { | ||
316 | + //this.ChangeUserIdFrm.reset() | ||
317 | + //this.ChangeUserIdFrm.controls['id'].setValue(this.user.Id) | ||
318 | + //this.ChangeUserIdFrm.controls['loginid'].setValue(this.user.LoginId) | ||
319 | + //this.ChangeUserIdFrm.controls['newloginid'].setValue('') | ||
320 | + //this.ChangeUserIdFrm.controls['confirmloginid'].setValue('') | ||
321 | + this.alerts = ''; | ||
322 | + } | ||
323 | + | ||
324 | +} |
150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_DeleteLicenseUserGroup.sql
0 → 100644
1 | +SET QUOTED_IDENTIFIER ON | ||
2 | +GO | ||
3 | +SET ANSI_NULLS ON | ||
4 | +GO | ||
5 | + | ||
6 | +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_DeleteLicenseUserGroup]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) | ||
7 | +drop procedure [dbo].[usp_DeleteLicenseUserGroup] | ||
8 | +GO | ||
9 | + | ||
10 | +-- ==================================================== | ||
11 | +-- Author: Magic Software | ||
12 | +-- Create date: 14-Feb-2018 | ||
13 | +-- Description: To insert or update a user group users of a license | ||
14 | +-- ==================================================== | ||
15 | +create PROCEDURE [dbo].[usp_DeleteLicenseUserGroup] | ||
16 | + -- Add the parameters for the stored procedure here | ||
17 | + @UserGroupId int, @Status bit out | ||
18 | +AS | ||
19 | +BEGIN | ||
20 | +SET NOCOUNT ON; | ||
21 | + | ||
22 | + set @Status = 0; | ||
23 | + BEGIN TRY | ||
24 | + BEGIN TRANSACTION | ||
25 | + | ||
26 | + delete from UserGroupToAIAUser where UserGroupId = @UserGroupId; | ||
27 | + delete from UserGroup where Id = @UserGroupId; | ||
28 | + | ||
29 | + COMMIT TRANSACTION | ||
30 | + set @Status = 1; | ||
31 | + END TRY | ||
32 | + BEGIN CATCH | ||
33 | + IF @@TRANCOUNT > 0 | ||
34 | + ROLLBACK TRANSACTION | ||
35 | + END CATCH | ||
36 | + | ||
37 | +END | ||
38 | + | ||
39 | +GO | ||
40 | +SET QUOTED_IDENTIFIER OFF | ||
41 | +GO | ||
42 | +SET ANSI_NULLS ON | ||
43 | +GO | ||
0 | \ No newline at end of file | 44 | \ No newline at end of file |
150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetLicenseUserGroups.sql
0 → 100644
1 | +SET QUOTED_IDENTIFIER ON | ||
2 | +GO | ||
3 | +SET ANSI_NULLS ON | ||
4 | +GO | ||
5 | + | ||
6 | +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetLicenseUserGroups]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) | ||
7 | +drop procedure [dbo].[usp_GetLicenseUserGroups] | ||
8 | +GO | ||
9 | + | ||
10 | +-- ==================================================== | ||
11 | +-- Author: Magic Software | ||
12 | +-- Create date: 09-Feb-2018 | ||
13 | +-- Description: To get all user groups of a license | ||
14 | +-- ==================================================== | ||
15 | +create PROCEDURE [dbo].[usp_GetLicenseUserGroups] | ||
16 | + -- Add the parameters for the stored procedure here | ||
17 | + @LicenseId int | ||
18 | +AS | ||
19 | +BEGIN | ||
20 | + -- SET NOCOUNT ON added to prevent extra result sets from | ||
21 | + -- interfering with SELECT statements. | ||
22 | + SET NOCOUNT ON; | ||
23 | + | ||
24 | + -- Insert statements for procedure here | ||
25 | + select UG.*, UGU.TotalUsers from UserGroup UG left outer join | ||
26 | + (select count(*) as TotalUsers, UserGroupId from UserGroupToAIAUser | ||
27 | + group by UserGroupId) UGU on UG.Id = UGU.UserGroupId where UG.LicenseId = @LicenseId; | ||
28 | + | ||
29 | +END | ||
30 | + | ||
31 | +GO | ||
32 | +SET QUOTED_IDENTIFIER OFF | ||
33 | +GO | ||
34 | +SET ANSI_NULLS ON | ||
35 | +GO | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + |
150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_InsertDeleteUserManageRights.sql
0 → 100644
1 | +SET QUOTED_IDENTIFIER ON | ||
2 | +GO | ||
3 | +SET ANSI_NULLS ON | ||
4 | +GO | ||
5 | + | ||
6 | +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_InsertDeleteUserManageRights]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) | ||
7 | +drop procedure [dbo].[usp_InsertDeleteUserManageRights] | ||
8 | +GO | ||
9 | + | ||
10 | +-- ==================================================== | ||
11 | +-- Author: Ebix | ||
12 | +-- Create date: 12-Feb-2018 | ||
13 | +-- Description: To delete and insert User Rights | ||
14 | +-- ==================================================== | ||
15 | +create PROCEDURE [dbo].[usp_InsertDeleteUserManageRights] | ||
16 | + -- Add the parameters for the stored procedure here | ||
17 | + @RoleName varchar(50),@ActivityId int, @UserId int,@RequestType varchar(20), | ||
18 | + @Status bit out | ||
19 | +AS | ||
20 | +BEGIN | ||
21 | + -- SET NOCOUNT ON added to prevent extra result sets from | ||
22 | + -- interfering with SELECT statements. | ||
23 | +SET NOCOUNT ON; | ||
24 | +declare @RoleId int; | ||
25 | +declare @ParentId int; | ||
26 | +Set @RoleId=(Select Id From UserType WHere Title=@RoleName); | ||
27 | +set @ParentId=(select top 1 ParentId FROM Activity WHERE id =@ActivityId) | ||
28 | + set @Status = 0; | ||
29 | + BEGIN TRY | ||
30 | + BEGIN TRANSACTION | ||
31 | + if(@RequestType='insert') | ||
32 | + Begin | ||
33 | + INSERT INTO AIAUserActivity(UserId,RoleId,ActivityId) | ||
34 | + Select @UserId,@RoleId,Id from Activity Where ParentId=@ActivityId and IsActive=1 | ||
35 | + End; | ||
36 | + if(@RequestType='Remove') | ||
37 | + begin | ||
38 | + DELETE FROM AIAUserActivity | ||
39 | + WHERE UserId = @UserId AND RoleId = @RoleId AND ActivityId IN (SELECT id FROM Activity WHERE ParentId=@ActivityId ) | ||
40 | + end | ||
41 | + | ||
42 | + | ||
43 | + COMMIT TRANSACTION | ||
44 | + set @Status = 1; | ||
45 | + END TRY | ||
46 | + BEGIN CATCH | ||
47 | + IF @@TRANCOUNT > 0 | ||
48 | + ROLLBACK TRANSACTION | ||
49 | + END CATCH | ||
50 | + | ||
51 | +END | ||
52 | + | ||
53 | +GO | ||
54 | +SET QUOTED_IDENTIFIER OFF | ||
55 | +GO | ||
56 | +SET ANSI_NULLS ON | ||
57 | +GO | ||
58 | + |
150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_InsertUpdateLicenseUserGroup.sql
0 → 100644
1 | +SET QUOTED_IDENTIFIER ON | ||
2 | +GO | ||
3 | +SET ANSI_NULLS ON | ||
4 | +GO | ||
5 | + | ||
6 | +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_InsertUpdateLicenseUserGroup]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) | ||
7 | +drop procedure [dbo].[usp_InsertUpdateLicenseUserGroup] | ||
8 | +GO | ||
9 | + | ||
10 | +-- ==================================================== | ||
11 | +-- Author: Magic Software | ||
12 | +-- Create date: 12-Feb-2018 | ||
13 | +-- Description: To insert or update a user group of a license | ||
14 | +-- ==================================================== | ||
15 | +create PROCEDURE [dbo].[usp_InsertUpdateLicenseUserGroup] | ||
16 | + -- Add the parameters for the stored procedure here | ||
17 | + @Id int, @LicenseId int, @Title varchar(100), @CreationDate datetime, @ModifiedDate datetime, @IsActive bit, @Status bit out | ||
18 | +AS | ||
19 | +BEGIN | ||
20 | + | ||
21 | + SET NOCOUNT ON; | ||
22 | + set @Status = 0; | ||
23 | + BEGIN TRY | ||
24 | + BEGIN TRANSACTION | ||
25 | + if(@Id = 0) | ||
26 | + begin | ||
27 | + insert into UserGroup(LicenseId, Title, CreationDate, ModifiedDate, IsActive) values(@LicenseId, @Title, @CreationDate, @ModifiedDate, @IsActive); | ||
28 | + end | ||
29 | + else | ||
30 | + begin | ||
31 | + update UserGroup set Title = @Title, CreationDate = @CreationDate, ModifiedDate = @ModifiedDate, @IsActive = @IsActive where Id = @Id; | ||
32 | + end | ||
33 | + COMMIT TRANSACTION | ||
34 | + set @Status = 1; | ||
35 | + END TRY | ||
36 | + BEGIN CATCH | ||
37 | + IF @@TRANCOUNT > 0 | ||
38 | + ROLLBACK TRANSACTION | ||
39 | + END CATCH | ||
40 | + | ||
41 | +END | ||
42 | + | ||
43 | +GO | ||
44 | +SET QUOTED_IDENTIFIER OFF | ||
45 | +GO | ||
46 | +SET ANSI_NULLS ON | ||
47 | +GO | ||
0 | \ No newline at end of file | 48 | \ No newline at end of file |
150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_UpdateLicenseUserGroupUsers.sql
0 → 100644
1 | +SET QUOTED_IDENTIFIER ON | ||
2 | +GO | ||
3 | +SET ANSI_NULLS ON | ||
4 | +GO | ||
5 | + | ||
6 | +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_UpdateLicenseUserGroupUsers]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) | ||
7 | +drop procedure [dbo].[usp_UpdateLicenseUserGroupUsers] | ||
8 | +GO | ||
9 | + | ||
10 | +-- ==================================================== | ||
11 | +-- Author: Magic Software | ||
12 | +-- Create date: 14-Feb-2018 | ||
13 | +-- Description: To insert or update a user group users of a license | ||
14 | +-- ==================================================== | ||
15 | +create PROCEDURE [dbo].[usp_UpdateLicenseUserGroupUsers] | ||
16 | + -- Add the parameters for the stored procedure here | ||
17 | + @UserGroupId int, @UserIds varchar(2000), @Status bit out | ||
18 | +AS | ||
19 | +BEGIN | ||
20 | +SET NOCOUNT ON; | ||
21 | + | ||
22 | +DECLARE @pos INT, @tempUserId int; | ||
23 | +DECLARE @len INT; | ||
24 | +DECLARE @value varchar(10); | ||
25 | + | ||
26 | +if(@UserIds != '') | ||
27 | +begin | ||
28 | + set @UserIds = @UserIds + ','; | ||
29 | +end | ||
30 | + | ||
31 | + set @Status = 0; | ||
32 | + BEGIN TRY | ||
33 | + BEGIN TRANSACTION | ||
34 | + | ||
35 | + delete UGU from UserGroupToAIAUser UGU where UserGroupId = @UserGroupId; | ||
36 | + | ||
37 | + set @pos = 0 | ||
38 | + set @len = 0 | ||
39 | + | ||
40 | + WHILE CHARINDEX(',', @UserIds, @pos+1)>0 | ||
41 | + BEGIN | ||
42 | + set @len = CHARINDEX(',', @UserIds, @pos+1) - @pos; | ||
43 | + set @value = SUBSTRING(@UserIds, @pos, @len); | ||
44 | + set @tempUserId = convert(int, @value); | ||
45 | + insert into UserGroupToAIAUser(UserGroupId, UserId) values(@UserGroupId, @tempUserId); | ||
46 | + set @pos = CHARINDEX(',', @UserIds, @pos+@len) + 1; | ||
47 | + END | ||
48 | + | ||
49 | + COMMIT TRANSACTION | ||
50 | + set @Status = 1; | ||
51 | + END TRY | ||
52 | + BEGIN CATCH | ||
53 | + IF @@TRANCOUNT > 0 | ||
54 | + ROLLBACK TRANSACTION | ||
55 | + END CATCH | ||
56 | + | ||
57 | +END | ||
58 | + | ||
59 | +GO | ||
60 | +SET QUOTED_IDENTIFIER OFF | ||
61 | +GO | ||
62 | +SET ANSI_NULLS ON | ||
63 | +GO | ||
0 | \ No newline at end of file | 64 | \ No newline at end of file |
400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj
@@ -167,6 +167,7 @@ | @@ -167,6 +167,7 @@ | ||
167 | <Compile Include="Controllers\SiteController.cs" /> | 167 | <Compile Include="Controllers\SiteController.cs" /> |
168 | <Compile Include="Controllers\SubscriptionPriceController.cs" /> | 168 | <Compile Include="Controllers\SubscriptionPriceController.cs" /> |
169 | <Compile Include="Controllers\UserController.cs" /> | 169 | <Compile Include="Controllers\UserController.cs" /> |
170 | + <Compile Include="Controllers\UserGroupController.cs" /> | ||
170 | <Compile Include="Entity\AccountType.cs"> | 171 | <Compile Include="Entity\AccountType.cs"> |
171 | <DependentUpon>AIADBEntity.tt</DependentUpon> | 172 | <DependentUpon>AIADBEntity.tt</DependentUpon> |
172 | </Compile> | 173 | </Compile> |
@@ -731,6 +732,9 @@ | @@ -731,6 +732,9 @@ | ||
731 | <Compile Include="Entity\usp_GetLicenseTypes_Result.cs"> | 732 | <Compile Include="Entity\usp_GetLicenseTypes_Result.cs"> |
732 | <DependentUpon>AIADBEntity.tt</DependentUpon> | 733 | <DependentUpon>AIADBEntity.tt</DependentUpon> |
733 | </Compile> | 734 | </Compile> |
735 | + <Compile Include="Entity\usp_GetLicenseUserGroups_Result.cs"> | ||
736 | + <DependentUpon>AIADBEntity.tt</DependentUpon> | ||
737 | + </Compile> | ||
734 | <Compile Include="Entity\usp_GetManageRights_Result.cs"> | 738 | <Compile Include="Entity\usp_GetManageRights_Result.cs"> |
735 | <DependentUpon>AIADBEntity.tt</DependentUpon> | 739 | <DependentUpon>AIADBEntity.tt</DependentUpon> |
736 | </Compile> | 740 | </Compile> |
@@ -791,6 +795,7 @@ | @@ -791,6 +795,7 @@ | ||
791 | <Compile Include="Models\SubscriptionPriceModel.cs" /> | 795 | <Compile Include="Models\SubscriptionPriceModel.cs" /> |
792 | <Compile Include="Models\User.cs" /> | 796 | <Compile Include="Models\User.cs" /> |
793 | <Compile Include="Models\DiscountCodeModel.cs" /> | 797 | <Compile Include="Models\DiscountCodeModel.cs" /> |
798 | + <Compile Include="Models\UserGroupModel.cs" /> | ||
794 | <Compile Include="Models\UserModel.cs" /> | 799 | <Compile Include="Models\UserModel.cs" /> |
795 | <Compile Include="Properties\AssemblyInfo.cs" /> | 800 | <Compile Include="Properties\AssemblyInfo.cs" /> |
796 | </ItemGroup> | 801 | </ItemGroup> |
400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs
@@ -16,7 +16,7 @@ using AIAHTML5.ADMIN.API.Entity; | @@ -16,7 +16,7 @@ using AIAHTML5.ADMIN.API.Entity; | ||
16 | 16 | ||
17 | namespace AIAHTML5.ADMIN.API.Controllers | 17 | namespace AIAHTML5.ADMIN.API.Controllers |
18 | { | 18 | { |
19 | - //[EnableCors(origins: "http://localhost:4200", headers: "*", methods: "*")] | 19 | + // [EnableCors(origins: "http://localhost:4200", headers: "*", methods: "*")] |
20 | [RoutePrefix("User")] | 20 | [RoutePrefix("User")] |
21 | 21 | ||
22 | public class UserController : ApiController | 22 | public class UserController : ApiController |
@@ -211,7 +211,69 @@ namespace AIAHTML5.ADMIN.API.Controllers | @@ -211,7 +211,69 @@ namespace AIAHTML5.ADMIN.API.Controllers | ||
211 | throw new HttpResponseException(message); | 211 | throw new HttpResponseException(message); |
212 | } | 212 | } |
213 | } | 213 | } |
214 | - | 214 | + |
215 | + [Route("InsertDeleteUserManageRights")] | ||
216 | + [HttpPost] | ||
217 | + public HttpResponseMessage InsertDeleteUserManageRights(JObject jsonUserData) | ||
218 | + { | ||
219 | + bool Status = false; | ||
220 | + var jsonString = jsonUserData; | ||
221 | + try | ||
222 | + { | ||
223 | + int UserId = 0; | ||
224 | + string RoleName = string.Empty; | ||
225 | + List<int> CheckedUserRights = new List<int>(); | ||
226 | + List<int> UnCheckedUserRights = new List<int>(); | ||
227 | + foreach (var item in jsonUserData) | ||
228 | + { | ||
229 | + if(item.Key=="UserId") | ||
230 | + { | ||
231 | + UserId = Convert.ToInt32(item.Value); | ||
232 | + } | ||
233 | + else if (item.Key == "UserType") | ||
234 | + { | ||
235 | + RoleName = item.Value.ToString(); | ||
236 | + } | ||
237 | + else if (item.Key == "CheckedUserRights") | ||
238 | + { | ||
239 | + JArray jsonVal = JArray.Parse(item.Value.ToString()) as JArray; | ||
240 | + dynamic CheckedUserRightsList = jsonVal; | ||
241 | + foreach (dynamic itemCheckedUserRights in CheckedUserRightsList) | ||
242 | + { | ||
243 | + CheckedUserRights.Add(Convert.ToInt32(itemCheckedUserRights)); | ||
244 | + } | ||
245 | + } | ||
246 | + else if (item.Key == "UnCheckedUserRights") | ||
247 | + { | ||
248 | + JArray jsonVal = JArray.Parse(item.Value.ToString()) as JArray; | ||
249 | + dynamic CheckedUserRightsList = jsonVal; | ||
250 | + foreach (dynamic itemCheckedUserRights in CheckedUserRightsList) | ||
251 | + { | ||
252 | + UnCheckedUserRights.Add(Convert.ToInt32(itemCheckedUserRights)); | ||
253 | + } | ||
254 | + } | ||
255 | + | ||
256 | + | ||
257 | + } | ||
258 | + Status = UserModel.InsertDeleteUserManageRight(dbContext, CheckedUserRights, UnCheckedUserRights, UserId, RoleName); | ||
259 | + if (Status) | ||
260 | + { | ||
261 | + return Request.CreateResponse(HttpStatusCode.OK, "Done"); | ||
262 | + } | ||
263 | + else | ||
264 | + { | ||
265 | + return Request.CreateErrorResponse(HttpStatusCode.BadRequest, Status.ToString()); | ||
266 | + } | ||
267 | + | ||
268 | + | ||
269 | + } | ||
270 | + catch (Exception ex) | ||
271 | + { | ||
272 | + // Log exception code goes here | ||
273 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | ||
274 | + } | ||
275 | + } | ||
276 | + | ||
215 | #endregion | 277 | #endregion |
216 | #region Add User | 278 | #region Add User |
217 | [Route("GetUserTypebyLicenseId")] | 279 | [Route("GetUserTypebyLicenseId")] |
400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserGroupController.cs
0 → 100644
1 | +using System; | ||
2 | +using System.Collections.Generic; | ||
3 | +using System.Linq; | ||
4 | +using System.Net; | ||
5 | +using System.Net.Http; | ||
6 | +using System.Web.Http; | ||
7 | +using Newtonsoft.Json; | ||
8 | +using Newtonsoft.Json.Linq; | ||
9 | +using AIAHTML5.ADMIN.API.Models; | ||
10 | +using System.Web.Http.Cors; | ||
11 | +using System.Web.Cors; | ||
12 | +using AIAHTML5.Server.Constants; | ||
13 | +using log4net; | ||
14 | +using System.Text; | ||
15 | +using AIAHTML5.ADMIN.API.Entity; | ||
16 | + | ||
17 | +namespace AIAHTML5.ADMIN.API.Controllers | ||
18 | +{ | ||
19 | + //[EnableCors(origins: "http://localhost:4200", headers: "*", methods: "*")] | ||
20 | + [RoutePrefix("UserGroup")] | ||
21 | + public class UserGroupController : ApiController | ||
22 | + { | ||
23 | + AIADatabaseV5Entities dbContext = new AIADatabaseV5Entities(); | ||
24 | + | ||
25 | + [Route("LicenseUserGroups")] | ||
26 | + [HttpGet] | ||
27 | + public HttpResponseMessage GetLicenseUserGroups(int LicenseId) | ||
28 | + { | ||
29 | + List<UserGroupModel> UserGroupList = new List<UserGroupModel>(); | ||
30 | + try | ||
31 | + { | ||
32 | + UserGroupList = UserGroupModel.GetLicenseUserGroups(dbContext, LicenseId); | ||
33 | + return Request.CreateResponse(HttpStatusCode.OK, UserGroupList); | ||
34 | + } | ||
35 | + catch (Exception ex) | ||
36 | + { | ||
37 | + // Log exception code goes here | ||
38 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | ||
39 | + } | ||
40 | + } | ||
41 | + | ||
42 | + [Route("LicenseUserGroupUsers")] | ||
43 | + [HttpGet] | ||
44 | + public HttpResponseMessage GetLicenseUserGroupUsers(int LicenseId, int UserGroupId) | ||
45 | + { | ||
46 | + List<UserModel> UserList = new List<UserModel>(); | ||
47 | + try | ||
48 | + { | ||
49 | + UserList = UserGroupModel.GetLicenseUserGroupUsers(dbContext, LicenseId, UserGroupId); | ||
50 | + return Request.CreateResponse(HttpStatusCode.OK, UserList); | ||
51 | + } | ||
52 | + catch (Exception ex) | ||
53 | + { | ||
54 | + // Log exception code goes here | ||
55 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | ||
56 | + } | ||
57 | + } | ||
58 | + | ||
59 | + [Route("InsertUpdateLicenseUserGroup")] | ||
60 | + [HttpPost] | ||
61 | + public HttpResponseMessage InsertUpdateLicenseUserGroup(JObject jsonData) | ||
62 | + { | ||
63 | + bool Status = false; | ||
64 | + UserGroupModel UserGroupEntity = new UserGroupModel(); | ||
65 | + UserGroupEntity.Id = jsonData["id"].Value<int>(); | ||
66 | + UserGroupEntity.LicenseId = jsonData["licenseId"].Value<int>(); | ||
67 | + UserGroupEntity.Title = jsonData["title"].Value<string>(); | ||
68 | + UserGroupEntity.IsActive = jsonData["isActive"].Value<bool>(); | ||
69 | + UserGroupEntity.CreationDate = jsonData["creationDate"].Value<DateTime>(); | ||
70 | + UserGroupEntity.ModifiedDate = jsonData["modifiedDate"].Value<DateTime>(); | ||
71 | + try | ||
72 | + { | ||
73 | + Status = UserGroupModel.InsertUpdateLicenseUserGroup(dbContext, UserGroupEntity); | ||
74 | + if (Status) | ||
75 | + { | ||
76 | + return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); | ||
77 | + } | ||
78 | + else | ||
79 | + { | ||
80 | + return Request.CreateErrorResponse(HttpStatusCode.BadRequest, Status.ToString()); | ||
81 | + } | ||
82 | + } | ||
83 | + catch (Exception ex) | ||
84 | + { | ||
85 | + // Log exception code goes here | ||
86 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | ||
87 | + } | ||
88 | + } | ||
89 | + | ||
90 | + [Route("UpdateLicenseUserGroupUsers")] | ||
91 | + [HttpPost] | ||
92 | + public HttpResponseMessage UpdateLicenseUserGroupUsers(JObject jsonData) | ||
93 | + { | ||
94 | + bool Status = false; | ||
95 | + int UserGroupId = jsonData["userGroupId"].Value<int>(); | ||
96 | + string UserIds = jsonData["userIds"].Value<string>(); | ||
97 | + try | ||
98 | + { | ||
99 | + Status = UserGroupModel.UpdateLicenseUserGroupUsers(dbContext, UserGroupId, UserIds); | ||
100 | + if (Status) | ||
101 | + { | ||
102 | + return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); | ||
103 | + } | ||
104 | + else | ||
105 | + { | ||
106 | + return Request.CreateErrorResponse(HttpStatusCode.BadRequest, Status.ToString()); | ||
107 | + } | ||
108 | + } | ||
109 | + catch (Exception ex) | ||
110 | + { | ||
111 | + // Log exception code goes here | ||
112 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | ||
113 | + } | ||
114 | + } | ||
115 | + | ||
116 | + [Route("DeleteLicenseUserGroup")] | ||
117 | + [HttpGet] | ||
118 | + public HttpResponseMessage DeleteLicenseUserGroup(int UserGroupId) | ||
119 | + { | ||
120 | + bool Status = false; | ||
121 | + try | ||
122 | + { | ||
123 | + Status = UserGroupModel.DeleteLicenseUserGroup(dbContext, UserGroupId); | ||
124 | + if (Status) | ||
125 | + { | ||
126 | + return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); | ||
127 | + } | ||
128 | + else | ||
129 | + { | ||
130 | + return Request.CreateErrorResponse(HttpStatusCode.BadRequest, Status.ToString()); | ||
131 | + } | ||
132 | + } | ||
133 | + catch (Exception ex) | ||
134 | + { | ||
135 | + // Log exception code goes here | ||
136 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | ||
137 | + } | ||
138 | + } | ||
139 | + } | ||
140 | +} |
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs
@@ -3449,5 +3449,86 @@ namespace AIAHTML5.ADMIN.API.Entity | @@ -3449,5 +3449,86 @@ namespace AIAHTML5.ADMIN.API.Entity | ||
3449 | 3449 | ||
3450 | return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateLicenseModuleStatus", licenseIdParameter, moduleIdParameter, moduleStatusParameter, status); | 3450 | return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateLicenseModuleStatus", licenseIdParameter, moduleIdParameter, moduleStatusParameter, status); |
3451 | } | 3451 | } |
3452 | + | ||
3453 | + public virtual int usp_InsertDeleteUserManageRights(string roleName, Nullable<int> activityId, Nullable<int> userId, string requestType, ObjectParameter status) | ||
3454 | + { | ||
3455 | + var roleNameParameter = roleName != null ? | ||
3456 | + new ObjectParameter("RoleName", roleName) : | ||
3457 | + new ObjectParameter("RoleName", typeof(string)); | ||
3458 | + | ||
3459 | + var activityIdParameter = activityId.HasValue ? | ||
3460 | + new ObjectParameter("ActivityId", activityId) : | ||
3461 | + new ObjectParameter("ActivityId", typeof(int)); | ||
3462 | + | ||
3463 | + var userIdParameter = userId.HasValue ? | ||
3464 | + new ObjectParameter("UserId", userId) : | ||
3465 | + new ObjectParameter("UserId", typeof(int)); | ||
3466 | + | ||
3467 | + var requestTypeParameter = requestType != null ? | ||
3468 | + new ObjectParameter("RequestType", requestType) : | ||
3469 | + new ObjectParameter("RequestType", typeof(string)); | ||
3470 | + | ||
3471 | + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_InsertDeleteUserManageRights", roleNameParameter, activityIdParameter, userIdParameter, requestTypeParameter, status); | ||
3472 | + } | ||
3473 | + | ||
3474 | + public virtual int usp_DeleteLicenseUserGroup(Nullable<int> userGroupId, ObjectParameter status) | ||
3475 | + { | ||
3476 | + var userGroupIdParameter = userGroupId.HasValue ? | ||
3477 | + new ObjectParameter("UserGroupId", userGroupId) : | ||
3478 | + new ObjectParameter("UserGroupId", typeof(int)); | ||
3479 | + | ||
3480 | + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_DeleteLicenseUserGroup", userGroupIdParameter, status); | ||
3481 | + } | ||
3482 | + | ||
3483 | + public virtual ObjectResult<usp_GetLicenseUserGroups_Result> usp_GetLicenseUserGroups(Nullable<int> licenseId) | ||
3484 | + { | ||
3485 | + var licenseIdParameter = licenseId.HasValue ? | ||
3486 | + new ObjectParameter("LicenseId", licenseId) : | ||
3487 | + new ObjectParameter("LicenseId", typeof(int)); | ||
3488 | + | ||
3489 | + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<usp_GetLicenseUserGroups_Result>("usp_GetLicenseUserGroups", licenseIdParameter); | ||
3490 | + } | ||
3491 | + | ||
3492 | + public virtual int usp_InsertUpdateLicenseUserGroup(Nullable<int> id, Nullable<int> licenseId, string title, Nullable<System.DateTime> creationDate, Nullable<System.DateTime> modifiedDate, Nullable<bool> isActive, ObjectParameter status) | ||
3493 | + { | ||
3494 | + var idParameter = id.HasValue ? | ||
3495 | + new ObjectParameter("Id", id) : | ||
3496 | + new ObjectParameter("Id", typeof(int)); | ||
3497 | + | ||
3498 | + var licenseIdParameter = licenseId.HasValue ? | ||
3499 | + new ObjectParameter("LicenseId", licenseId) : | ||
3500 | + new ObjectParameter("LicenseId", typeof(int)); | ||
3501 | + | ||
3502 | + var titleParameter = title != null ? | ||
3503 | + new ObjectParameter("Title", title) : | ||
3504 | + new ObjectParameter("Title", typeof(string)); | ||
3505 | + | ||
3506 | + var creationDateParameter = creationDate.HasValue ? | ||
3507 | + new ObjectParameter("CreationDate", creationDate) : | ||
3508 | + new ObjectParameter("CreationDate", typeof(System.DateTime)); | ||
3509 | + | ||
3510 | + var modifiedDateParameter = modifiedDate.HasValue ? | ||
3511 | + new ObjectParameter("ModifiedDate", modifiedDate) : | ||
3512 | + new ObjectParameter("ModifiedDate", typeof(System.DateTime)); | ||
3513 | + | ||
3514 | + var isActiveParameter = isActive.HasValue ? | ||
3515 | + new ObjectParameter("IsActive", isActive) : | ||
3516 | + new ObjectParameter("IsActive", typeof(bool)); | ||
3517 | + | ||
3518 | + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_InsertUpdateLicenseUserGroup", idParameter, licenseIdParameter, titleParameter, creationDateParameter, modifiedDateParameter, isActiveParameter, status); | ||
3519 | + } | ||
3520 | + | ||
3521 | + public virtual int usp_UpdateLicenseUserGroupUsers(Nullable<int> userGroupId, string userIds, ObjectParameter status) | ||
3522 | + { | ||
3523 | + var userGroupIdParameter = userGroupId.HasValue ? | ||
3524 | + new ObjectParameter("UserGroupId", userGroupId) : | ||
3525 | + new ObjectParameter("UserGroupId", typeof(int)); | ||
3526 | + | ||
3527 | + var userIdsParameter = userIds != null ? | ||
3528 | + new ObjectParameter("UserIds", userIds) : | ||
3529 | + new ObjectParameter("UserIds", typeof(string)); | ||
3530 | + | ||
3531 | + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateLicenseUserGroupUsers", userGroupIdParameter, userIdsParameter, status); | ||
3532 | + } | ||
3452 | } | 3533 | } |
3453 | } | 3534 | } |
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx
@@ -2616,6 +2616,10 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does | @@ -2616,6 +2616,10 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does | ||
2616 | <Parameter Name="Status" Type="int" Mode="InOut" /> | 2616 | <Parameter Name="Status" Type="int" Mode="InOut" /> |
2617 | </Function> | 2617 | </Function> |
2618 | <Function Name="usp_DB_TblRowCOUNT" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo" /> | 2618 | <Function Name="usp_DB_TblRowCOUNT" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo" /> |
2619 | + <Function Name="usp_DeleteLicenseUserGroup" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> | ||
2620 | + <Parameter Name="UserGroupId" Type="int" Mode="In" /> | ||
2621 | + <Parameter Name="Status" Type="bit" Mode="InOut" /> | ||
2622 | + </Function> | ||
2619 | <Function Name="usp_DeleteSiteAccount" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> | 2623 | <Function Name="usp_DeleteSiteAccount" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> |
2620 | <Parameter Name="iSiteId" Type="int" Mode="In" /> | 2624 | <Parameter Name="iSiteId" Type="int" Mode="In" /> |
2621 | <Parameter Name="LicenseId" Type="int" Mode="In" /> | 2625 | <Parameter Name="LicenseId" Type="int" Mode="In" /> |
@@ -2654,6 +2658,9 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does | @@ -2654,6 +2658,9 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does | ||
2654 | <Parameter Name="bisActive" Type="bit" Mode="In" /> | 2658 | <Parameter Name="bisActive" Type="bit" Mode="In" /> |
2655 | </Function> | 2659 | </Function> |
2656 | <Function Name="usp_GetLicenseTypes" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo" /> | 2660 | <Function Name="usp_GetLicenseTypes" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo" /> |
2661 | + <Function Name="usp_GetLicenseUserGroups" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> | ||
2662 | + <Parameter Name="LicenseId" Type="int" Mode="In" /> | ||
2663 | + </Function> | ||
2657 | <Function Name="usp_GetManageRights" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> | 2664 | <Function Name="usp_GetManageRights" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> |
2658 | <Parameter Name="UserId" Type="int" Mode="In" /> | 2665 | <Parameter Name="UserId" Type="int" Mode="In" /> |
2659 | <Parameter Name="RoleName" Type="varchar" Mode="In" /> | 2666 | <Parameter Name="RoleName" Type="varchar" Mode="In" /> |
@@ -2697,6 +2704,13 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does | @@ -2697,6 +2704,13 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does | ||
2697 | <Parameter Name="iEditionId" Type="tinyint" Mode="In" /> | 2704 | <Parameter Name="iEditionId" Type="tinyint" Mode="In" /> |
2698 | <Parameter Name="Status" Type="int" Mode="InOut" /> | 2705 | <Parameter Name="Status" Type="int" Mode="InOut" /> |
2699 | </Function> | 2706 | </Function> |
2707 | + <Function Name="usp_InsertDeleteUserManageRights" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> | ||
2708 | + <Parameter Name="RoleName" Type="varchar" Mode="In" /> | ||
2709 | + <Parameter Name="ActivityId" Type="int" Mode="In" /> | ||
2710 | + <Parameter Name="UserId" Type="int" Mode="In" /> | ||
2711 | + <Parameter Name="RequestType" Type="varchar" Mode="In" /> | ||
2712 | + <Parameter Name="Status" Type="bit" Mode="InOut" /> | ||
2713 | + </Function> | ||
2700 | <Function Name="usp_InsertSubscriptionPlan" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> | 2714 | <Function Name="usp_InsertSubscriptionPlan" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> |
2701 | <Parameter Name="Id" Type="tinyint" Mode="In" /> | 2715 | <Parameter Name="Id" Type="tinyint" Mode="In" /> |
2702 | <Parameter Name="Title" Type="varchar" Mode="In" /> | 2716 | <Parameter Name="Title" Type="varchar" Mode="In" /> |
@@ -2706,6 +2720,15 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does | @@ -2706,6 +2720,15 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does | ||
2706 | <Parameter Name="IsActive" Type="bit" Mode="In" /> | 2720 | <Parameter Name="IsActive" Type="bit" Mode="In" /> |
2707 | <Parameter Name="Status" Type="bit" Mode="InOut" /> | 2721 | <Parameter Name="Status" Type="bit" Mode="InOut" /> |
2708 | </Function> | 2722 | </Function> |
2723 | + <Function Name="usp_InsertUpdateLicenseUserGroup" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> | ||
2724 | + <Parameter Name="Id" Type="int" Mode="In" /> | ||
2725 | + <Parameter Name="LicenseId" Type="int" Mode="In" /> | ||
2726 | + <Parameter Name="Title" Type="varchar" Mode="In" /> | ||
2727 | + <Parameter Name="CreationDate" Type="datetime" Mode="In" /> | ||
2728 | + <Parameter Name="ModifiedDate" Type="datetime" Mode="In" /> | ||
2729 | + <Parameter Name="IsActive" Type="bit" Mode="In" /> | ||
2730 | + <Parameter Name="Status" Type="bit" Mode="InOut" /> | ||
2731 | + </Function> | ||
2709 | <Function Name="usp_InsertUpdateSiteAccount" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> | 2732 | <Function Name="usp_InsertUpdateSiteAccount" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> |
2710 | <Parameter Name="iSiteId" Type="int" Mode="In" /> | 2733 | <Parameter Name="iSiteId" Type="int" Mode="In" /> |
2711 | <Parameter Name="sSiteIP" Type="varchar" Mode="In" /> | 2734 | <Parameter Name="sSiteIP" Type="varchar" Mode="In" /> |
@@ -2771,6 +2794,11 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does | @@ -2771,6 +2794,11 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does | ||
2771 | <Parameter Name="ModuleStatus" Type="bit" Mode="In" /> | 2794 | <Parameter Name="ModuleStatus" Type="bit" Mode="In" /> |
2772 | <Parameter Name="Status" Type="bit" Mode="InOut" /> | 2795 | <Parameter Name="Status" Type="bit" Mode="InOut" /> |
2773 | </Function> | 2796 | </Function> |
2797 | + <Function Name="usp_UpdateLicenseUserGroupUsers" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> | ||
2798 | + <Parameter Name="UserGroupId" Type="int" Mode="In" /> | ||
2799 | + <Parameter Name="UserIds" Type="varchar" Mode="In" /> | ||
2800 | + <Parameter Name="Status" Type="bit" Mode="InOut" /> | ||
2801 | + </Function> | ||
2774 | <Function Name="usp_UpdateSubscriptionPlan" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> | 2802 | <Function Name="usp_UpdateSubscriptionPlan" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> |
2775 | <Parameter Name="Id" Type="tinyint" Mode="In" /> | 2803 | <Parameter Name="Id" Type="tinyint" Mode="In" /> |
2776 | <Parameter Name="Title" Type="varchar" Mode="In" /> | 2804 | <Parameter Name="Title" Type="varchar" Mode="In" /> |
@@ -6224,7 +6252,7 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]</Definin | @@ -6224,7 +6252,7 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]</Definin | ||
6224 | <Parameter Name="Status" Mode="InOut" Type="Int32" /> | 6252 | <Parameter Name="Status" Mode="InOut" Type="Int32" /> |
6225 | </FunctionImport> | 6253 | </FunctionImport> |
6226 | <FunctionImport Name="usp_GetAccountNumber" ReturnType="Collection(AIADatabaseV5Model.usp_GetAccountNumber_Result)" > | 6254 | <FunctionImport Name="usp_GetAccountNumber" ReturnType="Collection(AIADatabaseV5Model.usp_GetAccountNumber_Result)" > |
6227 | - <Parameter Name="LicenseType" Mode="In" Type="Int32" /> | 6255 | + <Parameter Name="LicenseType" Mode="In" Type="Int32" /> |
6228 | </FunctionImport> | 6256 | </FunctionImport> |
6229 | <FunctionImport Name="usp_GetProductEditionByLicense" ReturnType="Collection(AIADatabaseV5Model.usp_GetProductEditionByLicense_Result)"> | 6257 | <FunctionImport Name="usp_GetProductEditionByLicense" ReturnType="Collection(AIADatabaseV5Model.usp_GetProductEditionByLicense_Result)"> |
6230 | <Parameter Name="iLicenseId" Mode="In" Type="Int32" /> | 6258 | <Parameter Name="iLicenseId" Mode="In" Type="Int32" /> |
@@ -6329,7 +6357,7 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]</Definin | @@ -6329,7 +6357,7 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]</Definin | ||
6329 | <Parameter Name="LicenseId" Mode="In" Type="Int32" /> | 6357 | <Parameter Name="LicenseId" Mode="In" Type="Int32" /> |
6330 | </FunctionImport> | 6358 | </FunctionImport> |
6331 | <FunctionImport Name="usp_GetSiteById" ReturnType="Collection(AIADatabaseV5Model.usp_GetSiteById_Result)"> | 6359 | <FunctionImport Name="usp_GetSiteById" ReturnType="Collection(AIADatabaseV5Model.usp_GetSiteById_Result)"> |
6332 | - <Parameter Name="SiteId" Mode="In" Type="Int32" /> | 6360 | + <Parameter Name="SiteId" Mode="In" Type="Int32" /> |
6333 | </FunctionImport> | 6361 | </FunctionImport> |
6334 | <FunctionImport Name="usp_InsertUpdateSiteAccount"> | 6362 | <FunctionImport Name="usp_InsertUpdateSiteAccount"> |
6335 | <Parameter Name="iSiteId" Mode="In" Type="Int32" /> | 6363 | <Parameter Name="iSiteId" Mode="In" Type="Int32" /> |
@@ -6381,6 +6409,34 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]</Definin | @@ -6381,6 +6409,34 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]</Definin | ||
6381 | <Parameter Name="ModuleStatus" Mode="In" Type="Boolean" /> | 6409 | <Parameter Name="ModuleStatus" Mode="In" Type="Boolean" /> |
6382 | <Parameter Name="Status" Mode="InOut" Type="Boolean" /> | 6410 | <Parameter Name="Status" Mode="InOut" Type="Boolean" /> |
6383 | </FunctionImport> | 6411 | </FunctionImport> |
6412 | + <FunctionImport Name="usp_InsertDeleteUserManageRights"> | ||
6413 | + <Parameter Name="RoleName" Mode="In" Type="String" /> | ||
6414 | + <Parameter Name="ActivityId" Mode="In" Type="Int32" /> | ||
6415 | + <Parameter Name="UserId" Mode="In" Type="Int32" /> | ||
6416 | + <Parameter Name="RequestType" Mode="In" Type="String" /> | ||
6417 | + <Parameter Name="Status" Mode="InOut" Type="Boolean" /> | ||
6418 | + </FunctionImport> | ||
6419 | + <FunctionImport Name="usp_DeleteLicenseUserGroup"> | ||
6420 | + <Parameter Name="UserGroupId" Mode="In" Type="Int32" /> | ||
6421 | + <Parameter Name="Status" Mode="InOut" Type="Boolean" /> | ||
6422 | + </FunctionImport> | ||
6423 | + <FunctionImport Name="usp_GetLicenseUserGroups" ReturnType="Collection(AIADatabaseV5Model.usp_GetLicenseUserGroups_Result)"> | ||
6424 | + <Parameter Name="LicenseId" Mode="In" Type="Int32" /> | ||
6425 | + </FunctionImport> | ||
6426 | + <FunctionImport Name="usp_InsertUpdateLicenseUserGroup"> | ||
6427 | + <Parameter Name="Id" Mode="In" Type="Int32" /> | ||
6428 | + <Parameter Name="LicenseId" Mode="In" Type="Int32" /> | ||
6429 | + <Parameter Name="Title" Mode="In" Type="String" /> | ||
6430 | + <Parameter Name="CreationDate" Mode="In" Type="DateTime" /> | ||
6431 | + <Parameter Name="ModifiedDate" Mode="In" Type="DateTime" /> | ||
6432 | + <Parameter Name="IsActive" Mode="In" Type="Boolean" /> | ||
6433 | + <Parameter Name="Status" Mode="InOut" Type="Boolean" /> | ||
6434 | + </FunctionImport> | ||
6435 | + <FunctionImport Name="usp_UpdateLicenseUserGroupUsers"> | ||
6436 | + <Parameter Name="UserGroupId" Mode="In" Type="Int32" /> | ||
6437 | + <Parameter Name="UserIds" Mode="In" Type="String" /> | ||
6438 | + <Parameter Name="Status" Mode="InOut" Type="Boolean" /> | ||
6439 | + </FunctionImport> | ||
6384 | </EntityContainer> | 6440 | </EntityContainer> |
6385 | <ComplexType Name="DA_GetBaseLayer_Result"> | 6441 | <ComplexType Name="DA_GetBaseLayer_Result"> |
6386 | <Property Type="Int32" Name="Id" Nullable="false" /> | 6442 | <Property Type="Int32" Name="Id" Nullable="false" /> |
@@ -7334,6 +7390,15 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]</Definin | @@ -7334,6 +7390,15 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]</Definin | ||
7334 | <Property Type="String" Name="FirstName" Nullable="true" MaxLength="100" /> | 7390 | <Property Type="String" Name="FirstName" Nullable="true" MaxLength="100" /> |
7335 | <Property Type="String" Name="EmailId" Nullable="true" MaxLength="50" /> | 7391 | <Property Type="String" Name="EmailId" Nullable="true" MaxLength="50" /> |
7336 | </ComplexType> | 7392 | </ComplexType> |
7393 | + <ComplexType Name="usp_GetLicenseUserGroups_Result"> | ||
7394 | + <Property Type="Int32" Name="Id" Nullable="false" /> | ||
7395 | + <Property Type="String" Name="Title" Nullable="false" MaxLength="100" /> | ||
7396 | + <Property Type="Int32" Name="LicenseId" Nullable="false" /> | ||
7397 | + <Property Type="DateTime" Name="CreationDate" Nullable="false" Precision="23" /> | ||
7398 | + <Property Type="DateTime" Name="ModifiedDate" Nullable="true" Precision="23" /> | ||
7399 | + <Property Type="Boolean" Name="IsActive" Nullable="false" /> | ||
7400 | + <Property Type="Int32" Name="TotalUsers" Nullable="true" /> | ||
7401 | + </ComplexType> | ||
7337 | </Schema> | 7402 | </Schema> |
7338 | </edmx:ConceptualModels> | 7403 | </edmx:ConceptualModels> |
7339 | <!-- C-S mapping content --> | 7404 | <!-- C-S mapping content --> |
@@ -9845,6 +9910,23 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]</Definin | @@ -9845,6 +9910,23 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]</Definin | ||
9845 | <FunctionImportMapping FunctionImportName="usp_UpdateLicenseBasicSettings" FunctionName="AIADatabaseV5Model.Store.usp_UpdateLicenseBasicSettings" /> | 9910 | <FunctionImportMapping FunctionImportName="usp_UpdateLicenseBasicSettings" FunctionName="AIADatabaseV5Model.Store.usp_UpdateLicenseBasicSettings" /> |
9846 | <FunctionImportMapping FunctionImportName="usp_UpdateLicenseModestySettings" FunctionName="AIADatabaseV5Model.Store.usp_UpdateLicenseModestySettings" /> | 9911 | <FunctionImportMapping FunctionImportName="usp_UpdateLicenseModestySettings" FunctionName="AIADatabaseV5Model.Store.usp_UpdateLicenseModestySettings" /> |
9847 | <FunctionImportMapping FunctionImportName="usp_UpdateLicenseModuleStatus" FunctionName="AIADatabaseV5Model.Store.usp_UpdateLicenseModuleStatus" /> | 9912 | <FunctionImportMapping FunctionImportName="usp_UpdateLicenseModuleStatus" FunctionName="AIADatabaseV5Model.Store.usp_UpdateLicenseModuleStatus" /> |
9913 | + <FunctionImportMapping FunctionImportName="usp_InsertDeleteUserManageRights" FunctionName="AIADatabaseV5Model.Store.usp_InsertDeleteUserManageRights" /> | ||
9914 | + <FunctionImportMapping FunctionImportName="usp_DeleteLicenseUserGroup" FunctionName="AIADatabaseV5Model.Store.usp_DeleteLicenseUserGroup" /> | ||
9915 | + <FunctionImportMapping FunctionImportName="usp_GetLicenseUserGroups" FunctionName="AIADatabaseV5Model.Store.usp_GetLicenseUserGroups"> | ||
9916 | + <ResultMapping> | ||
9917 | + <ComplexTypeMapping TypeName="AIADatabaseV5Model.usp_GetLicenseUserGroups_Result"> | ||
9918 | + <ScalarProperty Name="Id" ColumnName="Id" /> | ||
9919 | + <ScalarProperty Name="Title" ColumnName="Title" /> | ||
9920 | + <ScalarProperty Name="LicenseId" ColumnName="LicenseId" /> | ||
9921 | + <ScalarProperty Name="CreationDate" ColumnName="CreationDate" /> | ||
9922 | + <ScalarProperty Name="ModifiedDate" ColumnName="ModifiedDate" /> | ||
9923 | + <ScalarProperty Name="IsActive" ColumnName="IsActive" /> | ||
9924 | + <ScalarProperty Name="TotalUsers" ColumnName="TotalUsers" /> | ||
9925 | + </ComplexTypeMapping> | ||
9926 | + </ResultMapping> | ||
9927 | + </FunctionImportMapping> | ||
9928 | + <FunctionImportMapping FunctionImportName="usp_InsertUpdateLicenseUserGroup" FunctionName="AIADatabaseV5Model.Store.usp_InsertUpdateLicenseUserGroup" /> | ||
9929 | + <FunctionImportMapping FunctionImportName="usp_UpdateLicenseUserGroupUsers" FunctionName="AIADatabaseV5Model.Store.usp_UpdateLicenseUserGroupUsers" /> | ||
9848 | </EntityContainerMapping> | 9930 | </EntityContainerMapping> |
9849 | </Mapping> | 9931 | </Mapping> |
9850 | </edmx:Mappings> | 9932 | </edmx:Mappings> |
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroups_Result.cs
0 → 100644
1 | +//------------------------------------------------------------------------------ | ||
2 | +// <auto-generated> | ||
3 | +// This code was generated from a template. | ||
4 | +// | ||
5 | +// Manual changes to this file may cause unexpected behavior in your application. | ||
6 | +// Manual changes to this file will be overwritten if the code is regenerated. | ||
7 | +// </auto-generated> | ||
8 | +//------------------------------------------------------------------------------ | ||
9 | + | ||
10 | +namespace AIAHTML5.ADMIN.API.Entity | ||
11 | +{ | ||
12 | + using System; | ||
13 | + | ||
14 | + public partial class usp_GetLicenseUserGroups_Result | ||
15 | + { | ||
16 | + public int Id { get; set; } | ||
17 | + public string Title { get; set; } | ||
18 | + public int LicenseId { get; set; } | ||
19 | + public System.DateTime CreationDate { get; set; } | ||
20 | + public Nullable<System.DateTime> ModifiedDate { get; set; } | ||
21 | + public bool IsActive { get; set; } | ||
22 | + public Nullable<int> TotalUsers { get; set; } | ||
23 | + } | ||
24 | +} |
400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserGroupModel.cs
0 → 100644
1 | +using System; | ||
2 | +using System.Collections.Generic; | ||
3 | +using System.Linq; | ||
4 | +using System.Web; | ||
5 | +using AIAHTML5.ADMIN.API.Entity; | ||
6 | + | ||
7 | +namespace AIAHTML5.ADMIN.API.Models | ||
8 | +{ | ||
9 | + public class UserGroupModel | ||
10 | + { | ||
11 | + public int Id { get; set; } | ||
12 | + public int LicenseId { get; set; } | ||
13 | + public string Title { get; set; } | ||
14 | + public DateTime? CreationDate { get; set; } | ||
15 | + public DateTime? ModifiedDate { get; set; } | ||
16 | + public bool? IsActive { get; set; } | ||
17 | + public int? TotalUsers { get; set; } | ||
18 | + | ||
19 | + public static List<UserGroupModel> GetLicenseUserGroups(AIADatabaseV5Entities dbContext, int LicenseId) | ||
20 | + { | ||
21 | + List<UserGroupModel> UserGroupList = new List<UserGroupModel>(); | ||
22 | + UserGroupModel UserGroupObj = new UserGroupModel(); | ||
23 | + try | ||
24 | + { | ||
25 | + var result = dbContext.usp_GetLicenseUserGroups(LicenseId).ToList(); | ||
26 | + foreach (var item in result) | ||
27 | + { | ||
28 | + UserGroupObj = new UserGroupModel(); | ||
29 | + UserGroupObj.Id = item.Id; | ||
30 | + UserGroupObj.LicenseId = item.LicenseId; | ||
31 | + UserGroupObj.Title = item.Title; | ||
32 | + UserGroupObj.IsActive = item.IsActive; | ||
33 | + UserGroupObj.ModifiedDate = item.ModifiedDate; | ||
34 | + UserGroupObj.CreationDate = item.CreationDate; | ||
35 | + UserGroupObj.TotalUsers = item.TotalUsers; | ||
36 | + UserGroupList.Add(UserGroupObj); | ||
37 | + } | ||
38 | + } | ||
39 | + catch (Exception ex) { } | ||
40 | + return UserGroupList; | ||
41 | + } | ||
42 | + | ||
43 | + public static List<UserModel> GetLicenseUserGroupUsers(AIADatabaseV5Entities dbContext, int LicenseId, int UserGroupId) | ||
44 | + { | ||
45 | + List<UserModel> UserList = new List<UserModel>(); | ||
46 | + UserModel UserModelObj = new UserModel(); | ||
47 | + try | ||
48 | + { | ||
49 | + var result = dbContext.GetAllUserWithGroup(LicenseId, UserGroupId).ToList(); | ||
50 | + foreach (var item in result) | ||
51 | + { | ||
52 | + UserModelObj = new UserModel(); | ||
53 | + UserModelObj.Id = item.Id; | ||
54 | + UserModelObj.FirstName = item.FirstName; | ||
55 | + UserModelObj.LastName = item.LastName; | ||
56 | + UserModelObj.LoginId = item.LoginId; | ||
57 | + UserModelObj.EmailId = item.EmailId; | ||
58 | + UserModelObj.ProductEdition = item.Title; | ||
59 | + UserModelObj.InGroup = item.InGroup; | ||
60 | + UserList.Add(UserModelObj); | ||
61 | + } | ||
62 | + } | ||
63 | + catch (Exception ex) { } | ||
64 | + return UserList; | ||
65 | + } | ||
66 | + | ||
67 | + public static bool InsertUpdateLicenseUserGroup(AIADatabaseV5Entities dbContext, UserGroupModel UserGroupEntity) | ||
68 | + { | ||
69 | + var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); | ||
70 | + try | ||
71 | + { | ||
72 | + dbContext.usp_InsertUpdateLicenseUserGroup(UserGroupEntity.Id, UserGroupEntity.LicenseId, UserGroupEntity.Title, | ||
73 | + UserGroupEntity.CreationDate, UserGroupEntity.ModifiedDate, UserGroupEntity.IsActive, spStatus); | ||
74 | + return (bool)spStatus.Value; | ||
75 | + } | ||
76 | + catch (Exception ex) | ||
77 | + { | ||
78 | + return false; | ||
79 | + } | ||
80 | + } | ||
81 | + | ||
82 | + public static bool UpdateLicenseUserGroupUsers(AIADatabaseV5Entities dbContext, int UserGroupId, string UserIds) | ||
83 | + { | ||
84 | + var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); | ||
85 | + try | ||
86 | + { | ||
87 | + dbContext.usp_UpdateLicenseUserGroupUsers(UserGroupId, UserIds, spStatus); | ||
88 | + return (bool)spStatus.Value; | ||
89 | + } | ||
90 | + catch (Exception ex) | ||
91 | + { | ||
92 | + return false; | ||
93 | + } | ||
94 | + } | ||
95 | + | ||
96 | + public static bool DeleteLicenseUserGroup(AIADatabaseV5Entities dbContext, int UserGroupId) | ||
97 | + { | ||
98 | + var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); | ||
99 | + try | ||
100 | + { | ||
101 | + dbContext.usp_DeleteLicenseUserGroup(UserGroupId, spStatus); | ||
102 | + return (bool)spStatus.Value; | ||
103 | + } | ||
104 | + catch (Exception ex) | ||
105 | + { | ||
106 | + return false; | ||
107 | + } | ||
108 | + } | ||
109 | + | ||
110 | + } | ||
111 | + | ||
112 | +} | ||
0 | \ No newline at end of file | 113 | \ No newline at end of file |
400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserModel.cs
@@ -27,7 +27,8 @@ namespace AIAHTML5.ADMIN.API.Models | @@ -27,7 +27,8 @@ namespace AIAHTML5.ADMIN.API.Models | ||
27 | public int LicenseId { get; set; } | 27 | public int LicenseId { get; set; } |
28 | public int EditionId { get; set; } | 28 | public int EditionId { get; set; } |
29 | public short iUserTypeId { get; set; } | 29 | public short iUserTypeId { get; set; } |
30 | - | 30 | + public int InGroup { get; set; } |
31 | + public string ProductEdition { get; set; } | ||
31 | 32 | ||
32 | public static bool UpdateUserProfile(AIADatabaseV5Entities dbContext, int intUserID, string strFirstName, string strLastName, string strEmailID) | 33 | public static bool UpdateUserProfile(AIADatabaseV5Entities dbContext, int intUserID, string strFirstName, string strLastName, string strEmailID) |
33 | { | 34 | { |
@@ -136,5 +137,29 @@ namespace AIAHTML5.ADMIN.API.Models | @@ -136,5 +137,29 @@ namespace AIAHTML5.ADMIN.API.Models | ||
136 | return false; | 137 | return false; |
137 | } | 138 | } |
138 | } | 139 | } |
140 | + | ||
141 | + public static bool InsertDeleteUserManageRight(AIADatabaseV5Entities dbContext, List<int> SelectectedUserRights, List<int> UncheckedUserRights, | ||
142 | + int UserId,string RoleName) | ||
143 | + { | ||
144 | + var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); | ||
145 | + try | ||
146 | + { | ||
147 | + foreach (var item in SelectectedUserRights) | ||
148 | + { | ||
149 | + dbContext.usp_InsertDeleteUserManageRights(RoleName,item,UserId,"Insert", spStatus); | ||
150 | + if (!(bool)spStatus.Value) break; | ||
151 | + } | ||
152 | + foreach (var item in UncheckedUserRights) | ||
153 | + { | ||
154 | + dbContext.usp_InsertDeleteUserManageRights(RoleName, item, UserId, "Remove", spStatus); | ||
155 | + if (!(bool)spStatus.Value) break; | ||
156 | + } | ||
157 | + return (bool)spStatus.Value; | ||
158 | + } | ||
159 | + catch (Exception ex) | ||
160 | + { | ||
161 | + return false; | ||
162 | + } | ||
163 | + } | ||
139 | } | 164 | } |
140 | } | 165 | } |
141 | \ No newline at end of file | 166 | \ No newline at end of file |
400-SOURCECODE/Admin/dist/assets/styles/angular-custom.css
@@ -75,7 +75,7 @@ cursor-pointer { | @@ -75,7 +75,7 @@ cursor-pointer { | ||
75 | } | 75 | } |
76 | 76 | ||
77 | .alert-header-custom { | 77 | .alert-header-custom { |
78 | - /* background-color: #5d8fc2 !important; */ | 78 | + background-color: #5d8fc2 !important; |
79 | padding: 8px !important; | 79 | padding: 8px !important; |
80 | color: white; | 80 | color: white; |
81 | } | 81 | } |
400-SOURCECODE/Admin/dist/index.html
@@ -37,4 +37,4 @@ | @@ -37,4 +37,4 @@ | ||
37 | //}); | 37 | //}); |
38 | });</script><!--Nav--><script>$('.modal').draggable({ | 38 | });</script><!--Nav--><script>$('.modal').draggable({ |
39 | handle: '.modal-header' | 39 | handle: '.modal-header' |
40 | - })</script><script type="text/javascript" src="inline.e3bb4443248108769d6d.bundle.js"></script><script type="text/javascript" src="polyfills.35726d60cdf25fecc5f1.bundle.js"></script><script type="text/javascript" src="vendor.a409cb1c2d64015b0bed.bundle.js"></script><script type="text/javascript" src="main.15a80b0c5f7c541ad212.bundle.js"></script></body></html> | ||
41 | \ No newline at end of file | 40 | \ No newline at end of file |
41 | + })</script><script type="text/javascript" src="inline.72c9e2de3e55105c986b.bundle.js"></script><script type="text/javascript" src="polyfills.35726d60cdf25fecc5f1.bundle.js"></script><script type="text/javascript" src="vendor.a409cb1c2d64015b0bed.bundle.js"></script><script type="text/javascript" src="main.2e3e428a647ac019f929.bundle.js"></script></body></html> | ||
42 | \ No newline at end of file | 42 | \ No newline at end of file |
500-DBDump/AIA-StoredProcedures/dbo.ClearSessionManager.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetBackGroundArtList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetBaseLayer.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetBitmask.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetBodyRegion.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetBodyRegionList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetBodyRegionView.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetBodyRegionViewList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetDissectibleContent.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetGenderList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetLayerModel.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetLayerdata.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetLexiconTermList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetNavigatorModel.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetOverLayLayerList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetPLRModel.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetPolygonForId.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetStructureGroupId.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetStructureGroupList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetStructureList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetTermList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetTermNumberForContentId.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetViewOrientation.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetViewOrientationList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_GetVocabTermModal.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DA_LayerNumberInternal.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DeleteIncorrectLoginAttempts.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DeleteLicense.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.DeleteUserSession.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.EC_CreateUser.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.EC_GetAccountTypeList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.EC_GetCountryList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.EC_GetCourseConductedList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.EC_GetInstitutionList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.EC_GetInternetProductList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.EC_GetMultimediaProductList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.EC_GetProductRequiredList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.EC_GetReferList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.EC_GetSecurityQuestionList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.EC_GetStateList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.EC_GetSubscriptionDuration.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.EC_GetSubscriptionEndDate.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.EC_GetSubscriptionPlan.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.EC_GetSubscriptionPlanInfo.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.EC_GetSubscriptionPrice.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.EC_GetUsername.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.EC_InsertPaymentTransaction.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.EC_UpdateUser.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetAIALicenseDetails.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetAccountModule.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetAllEditionForLicense.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetAllLoginFailureCauses.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetAllModuleStatus.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetAllModuleStatusWithSlug.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetAllUserWithGroup.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetAttributeTypeList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetAttributeValueList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetBlockedUserByAccNoAndType.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetBlockedUserByAccNoAndType.sql
0 → 100644
1 | + | ||
2 | +-- ============================================= | ||
3 | +-- Author: Magic Software | ||
4 | +-- Create date: 12-May-2009 | ||
5 | +-- Description: To get the list of blocked user who have attempt 5 times wrong login | ||
6 | +-- ============================================= | ||
7 | +CREATE PROCEDURE [dbo].[GetBlockedUserByAccNoAndType] | ||
8 | + -- Add the parameters for the stored procedure here | ||
9 | + @iUserTypeId tinyint, @iLicenseId int | ||
10 | +AS | ||
11 | +BEGIN | ||
12 | + -- returns the metadata | ||
13 | + IF 1=0 BEGIN | ||
14 | + SET FMTONLY OFF | ||
15 | + END | ||
16 | + SELECT DISTINCT | ||
17 | + AIAUser.Id, | ||
18 | + AIAUser.FirstName, | ||
19 | + AIAUser.LastName, | ||
20 | + AIAUser.LoginId, | ||
21 | + AIAUser.Password, | ||
22 | + AIAUser.EmailId, | ||
23 | + ISNULL(License.AccountNumber,'') AccountNumber, | ||
24 | + IncorrectLoginAttempts.LoginTime | ||
25 | + FROM | ||
26 | + IncorrectLoginAttempts | ||
27 | + INNER JOIN AIAUser ON IncorrectLoginAttempts.UserId = AIAUser.Id | ||
28 | + INNER JOIN UserType ON AIAUser.UserTypeId = UserType.Id | ||
29 | + LEFT JOIN AIAUserToLicenseEdition ON AIAUser.Id = AIAUserToLicenseEdition.UserId | ||
30 | + LEFT JOIN LicenseToEdition ON AIAUserToLicenseEdition.LicenseEditionId = LicenseToEdition.Id | ||
31 | + LEFT JOIN License ON LicenseToEdition.LicenseId = License.Id | ||
32 | + WHERE | ||
33 | + IncorrectLoginAttempts.CntIncorrectLogins >= 5 | ||
34 | + AND UserType.Priority >= (SELECT UserType.Priority FROM UserType WHERE UserType.Id=@iUserTypeId) | ||
35 | + AND ((@iLicenseId =0) OR (License.Id = @iLicenseId)) | ||
36 | + AND License.IsActive = 1 | ||
37 | +END | ||
38 | + | ||
39 | + |
500-DBDump/AIA-StoredProcedures/dbo.GetBlockedUserByUserId.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetBlockedUserByUserType.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetBlockedUserDetailsByUserIdAndUserTypeId.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetCAMSearch.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetCancelledLicenses.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetContentAttributeData.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetContentList.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetCustomerSummary.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetCustomerSummary_25042017.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetCustomerSummary_bkp.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetDiscountCodes.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetDiscountCodes.sql
0 → 100644
1 | +SET QUOTED_IDENTIFIER ON | ||
2 | +GO | ||
3 | +SET ANSI_NULLS ON | ||
4 | +GO | ||
5 | + | ||
6 | +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GetDiscountCodes]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) | ||
7 | +drop procedure [dbo].[GetDiscountCodes] | ||
8 | +GO | ||
9 | + | ||
10 | +-- ==================================================== | ||
11 | +-- Author: Magic Software | ||
12 | +-- Create date: 23-Dec-2009 | ||
13 | +-- Description: To get the details of all discounts | ||
14 | +-- ==================================================== | ||
15 | +CREATE PROCEDURE [dbo].[GetDiscountCodes] | ||
16 | + -- Add the parameters for the stored procedure here | ||
17 | + @sDiscountCode VARCHAR(255) = '', @sStartDate VARCHAR(20) = '', @sEndDate VARCHAR(20) = '' | ||
18 | +AS | ||
19 | +BEGIN | ||
20 | + -- SET NOCOUNT ON added to prevent extra result sets from | ||
21 | + -- interfering with SELECT statements. | ||
22 | + SET NOCOUNT ON; | ||
23 | + DECLARE @dtStartDate DATETIME, @dtEndDate DATETIME | ||
24 | + | ||
25 | + -- convert the datatype of startdate & enddate parameter to datetime | ||
26 | + SELECT @dtStartDate = CONVERT(DATETIME,@sStartDate) | ||
27 | + SELECT @dtEndDate = CONVERT(DATETIME,@sEndDate) | ||
28 | + | ||
29 | + SELECT Id, DiscountCode, Percentage, CONVERT(VARCHAR(10),StartDate,101) as StartDate, CONVERT(VARCHAR(10),EndDate,101) as EndDate, | ||
30 | + (CASE IsActive WHEN 1 THEN 'Active' ELSE 'Inactive' END) AS Status | ||
31 | + FROM Discount WHERE StartDate >= (CASE WHEN LEN(@sStartDate) > 0 THEN @dtStartDate ELSE StartDate END) | ||
32 | + AND EndDate <= (CASE WHEN LEN(@sEndDate) > 0 THEN @dtEndDate ELSE EndDate END) | ||
33 | + AND DiscountCode like (CASE WHEN LEN(@sDiscountCode) > 0 THEN '%' + @sDiscountCode + '%' ELSE DiscountCode END) | ||
34 | + ORDER BY Status | ||
35 | +END | ||
36 | + | ||
37 | +GO | ||
38 | +SET QUOTED_IDENTIFIER OFF | ||
39 | +GO | ||
40 | +SET ANSI_NULLS ON | ||
41 | +GO | ||
42 | + |
500-DBDump/AIA-StoredProcedures/dbo.GetDiscountDetails.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetDiscountReport.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetDiscountedPrice.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetEditionsBySiteAccount.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetEncyclopediaSearch.StoredProcedure.sql
0 → 100644
500-DBDump/AIA-StoredProcedures/dbo.GetExpiringLicenses.StoredProcedure.sql
0 → 100644