users.component.js
4.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@angular/core");
var user_service_1 = require("./user.service");
var router_1 = require("@angular/router");
var forms_1 = require("@angular/forms");
var http_1 = require("@angular/http");
var confirm_service_1 = require("../../Shared/Confirm/confirm.service");
require("rxjs/Rx");
require("rxjs/add/operator/map");
require("rxjs/add/operator/filter");
var UsersList = /** @class */ (function () {
//@ViewChild("profileModal")
//profileModal: ModalComponent;
//errorMessage: any;
function UsersList(userservice, router, fb, http, _confirmService) {
this.userservice = userservice;
this.router = router;
this.fb = fb;
this.http = http;
this._confirmService = _confirmService;
}
UsersList.prototype.ngOnInit = function () {
this.alerts = '';
//this.userservice.GetUserById(this.UserId);
this.Users = this.fb.group({
FirstName: [''],
LastName: [''],
EmailId: [''],
AccountNumber: [''],
UserTypeId: [''],
AccountTypeId: ['']
// Gender: ['', Validators.required],
// Email: ['']
});
this.GetUserType();
this.GetAccountType();
//this.GetUserList();
};
UsersList.prototype.GetUserType = function () {
var _this = this;
this.userservice.GetUserType().subscribe(function (x) { _this.UserTypeList = x; }, function (error) { return _this.error = error; });
};
UsersList.prototype.GetAccountType = function () {
var _this = this;
this.userservice.GetAccountType().subscribe(function (x) { _this.AccountTypeList = x; }, function (error) { return _this.error = error; });
};
UsersList.prototype.GetUserList = function () {
//this.userservice.GetUserList().subscribe(x => { this.UserList = x; }, error => this.error = <any>error);
};
UsersList.prototype.SearchUserList = function () {
var _this = this;
var UserFilterControl = this.Users.value;
this.userservice.GetUserList({
FirstName: this.Users.controls['FirstName'].value,
LastName: this.Users.controls['LastName'].value,
EmailId: this.Users.controls['EmailId'].value,
AccountNumber: this.Users.controls['AccountNumber'].value,
UserTypeId: (this.Users.controls['UserTypeId'].value != null && this.Users.controls['UserTypeId'].value != '' ? this.Users.controls['UserTypeId'].value : 0),
AccountTypeId: (this.Users.controls['AccountTypeId'].value != null && this.Users.controls['AccountTypeId'].value != '' ? this.Users.controls['AccountTypeId'].value : 0),
})
.subscribe(function (x) { _this.UserList = x; }, function (error) { return _this.error = error; });
};
UsersList.prototype.AfterInsertData = function (data) {
if (data == "success") {
this._confirmService.activate("Userid Updated Successfully.", "alertMsg");
}
else {
this.alerts += '<span>' + data + '</span>';
return false;
}
//if (this.closeflag) {
// this.close.emit(null);
//}
//else {
//}
};
UsersList.prototype.ResetFormFields = function () {
//this.ChangeUserIdFrm.reset()
//this.ChangeUserIdFrm.controls['id'].setValue(this.user.Id)
//this.ChangeUserIdFrm.controls['loginid'].setValue(this.user.LoginId)
//this.ChangeUserIdFrm.controls['newloginid'].setValue('')
//this.ChangeUserIdFrm.controls['confirmloginid'].setValue('')
this.alerts = '';
};
UsersList = __decorate([
core_1.Component({
templateUrl: './users.component.html' // '../../../../../wwwroot/html/UpdateProfile/updateuserprofile.component.html'
}),
__metadata("design:paramtypes", [user_service_1.UserService, router_1.Router, forms_1.FormBuilder, http_1.Http,
confirm_service_1.ConfirmService])
], UsersList);
return UsersList;
}());
exports.UsersList = UsersList;
//# sourceMappingURL=users.component.js.map