add-user.component.html
11.8 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<div class="container-fluid">
<!-- navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<site-menu></site-menu>
</div>
</nav>
<!-- navigation -->
<div class="clearfix"></div>
<!-- main-heading -->
<div class="row">
<div class="col-sm-12 pageHeading">
<h4>Add User</h4>
</div>
<!-- main-heading -->
<!-- container -->
<div class="col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3">
<div class="container-fluid main-full">
<div class="row">
<div class="well">
<div class="row">
<div class="col-sm-12">
<div class="panel-body">
<!-- form -->
<form class="form-horizontal" #addUserForm="ngForm" (ngSubmit)="addUser(addUserForm.value)" novalidate>
<!--{{ addUserForm.value | json }} -->
<div class="form-group">
<label for="Username" class="col-sm-4 control-label">User Name <span class="red">*</span> :</label>
<div class="col-sm-7">
<input type="text" class="form-control input-sm" id="Username" name="username" #username ="ngModel" ngModel placeholder="" required maxlength="50">
<div *ngIf="username.invalid && (username.dirty || username.touched)" class="alert alert-danger">
<div *ngIf="username.errors.required">
Username is required.
</div>
</div>
</div>
</div>
<div class="form-group">
<label for="Password" class="col-sm-4 control-label">Password <span class="red">*</span> :</label>
<div class="col-sm-7">
<input type="password" class="form-control input-sm" id="Password" name="password" ngModel #password ="ngModel" placeholder="" required maxlength="50" validateEqual="confirmPassword" reverse="true">
<div *ngIf="password.invalid && (password.dirty || password.touched)" class="alert alert-danger">
<div *ngIf="password.errors.required">
Password is required.
</div>
</div>
</div>
</div>
<div class="form-group">
<label for="ConfirmPassword" class="col-sm-4 control-label">Confirm Password <span class="red">*</span> :</label>
<div class="col-sm-7">
<input type="password" class="form-control input-sm" id="ConfirmPassword" name="confirmPassword" ngModel #confirmPassword="ngModel" placeholder="" required validateEqual="password">
<div *ngIf="confirmPassword.invalid && (confirmPassword.dirty || confirmPassword.touched)" class="alert alert-danger">
<!--<div *ngIf="confirmPassword.errors.required">-->
Password not matched.
<!--</div>-->
</div>
</div>
</div>
<div class="form-group">
<label for="Email" class="col-sm-4 control-label">Email Id <span class="red">*</span> :</label>
<div class="col-sm-7">
<input type="email" class="form-control" id="Email" name="email" ngModel #email="ngModel" placeholder="" required maxlength="50" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$">
<div *ngIf="email.invalid && (email.dirty || email.touched)" class="alert alert-danger">
<div *ngIf="email.errors.required">
EmailId is required.
</div>
<div *ngIf="email.errors.pattern">
Email pattern not valid.
</div>
</div>
<!--<small [hidden]="email.valid || (email.pristine && !addUserForm.submitted)">
Email is required (valid email pattern).
</small>
<pre *ngIf="username.errors">{{ email.errors | json }}</pre>-->
</div>
</div>
<div class="form-group">
<label for="FirstName" class="col-sm-4 control-label">First Name <span class="red">*</span> :</label>
<div class="col-sm-7">
<input class="form-control input-sm" id="FirstName" name="firstName" ngModel #firstName="ngModel" placeholder="" type="text" required maxlength="100">
<div *ngIf="firstName.invalid && (firstName.dirty || firstName.touched)" class="alert alert-danger">
<div *ngIf="firstName.errors.required">
FirstName is required.
</div>
</div>
</div>
</div>
<div class="form-group">
<label for="LastName" class="col-sm-4 control-label">Last Name <span class="red">*</span> :</label>
<div class="col-sm-7">
<input class="form-control input-sm" id="LastName" name="lastName" ngModel #lastName="ngModel" placeholder="" type="text" required maxlength="100">
<div *ngIf="lastName.invalid && (lastName.dirty || lastName.touched)" class="alert alert-danger">
<div *ngIf="lastName.errors.required">
LastName is required.
</div>
</div>
</div>
</div>
<div class="form-group">
<label for="AccountNumber" class="col-sm-4 control-label">Account Number <span class="red">*</span> :</label>
<div class="col-sm-7">
<select class="form-control input-sm" id="AccountNumber" name="accNumber" ngModel #accNumber="ngModel" required>
<option>Select</option>
<option *ngFor="let acc of accountNumbers" [value]="acc.Id">{{acc.AccountNo}}</option>
<!--<option selected="">Select</option>
<option>73-0022796</option>
<option>73-0022794</option>
<option>73-0022796</option>
<option>73-0022796</option>-->
</select>
<div *ngIf="accNumber.invalid && (accNumber.dirty || accNumber.touched)" class="alert alert-danger">
<div *ngIf="accNumber.errors.required">
Select an accountNumber.
</div>
</div>
</div>
</div>
<div class="form-group">
<label for="UserType" class="col-sm-4 control-label">User Type <span class="red">*</span> :</label>
<div class="col-sm-7">
<select class="form-control input-sm" id="UserType" name="userType" ngModel #userType="ngModel" required>
<option>Select</option>
<option *ngFor="let userType of userTypes" [value]="userType.Id">{{userType.Title}}</option>
</select>
<div *ngIf="userType.invalid && (userType.dirty || userType.touched)" class="alert alert-danger">
<div *ngIf="userType.errors.required">
Select UserType.
</div>
</div>
</div>
</div>
<div class="form-group">
<label for="ProductEdition" class="col-sm-4 control-label">Product Edition <span class="red">*</span> :</label>
<div class="col-sm-7">
<select class="form-control input-sm" id="ProductEdition" name="productEdition" ngModel #productEdition="ngModel" required>
<option>Select</option>
<option *ngFor="let edition of productEditions" [value]="edition.Id">{{edition.Title}}</option>
</select>
<div *ngIf="productEdition.invalid && (productEdition.dirty || productEdition.touched)" class="alert alert-danger">
<div *ngIf="productEdition.errors.required">
Select an edition.
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 marginTop20 text-center">
<button type="button" class="btn btn-primary btn-sm" [disabled]="!addUserForm.form.valid" data-toggle="modal" data-target="#mymodal"><i class="fa fa-plus-circle"></i> Add</button>
<!--modal-->
<div class="modal fade bs-example-modal-sm text-left" tabindex="-1" role="dialog" id="mymodal">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-header annotation-modal-header ui-draggable-handle">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="">Alert</h4>
</div>
<div class="modal-body">
<h5>Please enter a username</h5>
</div>
<div class="modal-footer">
<div class="row">
<div class="col-sm-12"><button class="btn btn-primary btn-sm">Ok</button></div>
</div>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<button class="btn btn-primary btn-sm"><i class="fa fa-refresh"></i> Reset</button>
<button class="btn btn-primary btn-sm"><i class="fa fa-close"></i> Cancel</button>
</div>
</div>
</form>
<!-- form -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- container -->
</div>
<script src="js/jquery-1.11.3.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/bootstrap-datetimepicker.min.js"></script>
<!--datepicker-->
<script type="text/javascript">
$(function() {
$('#datetimepicker1, #datetimepicker2').datetimepicker({
//language: 'pt-BR'
});
});
</script>
<!--datepicker-->