-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakeList.aspx
442 lines (361 loc) · 19.8 KB
/
MakeList.aspx
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
<%@ Page Title="" Language="C#" MasterPageFile="~/FDSS.master" AutoEventWireup="true" CodeFile="MakeList.aspx.cs" Inherits="MakeList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<!-- Style.css Start -->
<link rel="stylesheet" type="text/css" href="files/bower_components/datatables.net-bs4/css/dataTables.bootstrap4.min.css" />
<link rel="stylesheet" type="text/css" href="files/bower_components/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="files/assets/pages/data-table/css/buttons.dataTables.min.css" />
<link rel="stylesheet" type="text/css" href="files/bower_components/datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css" />
<link rel="stylesheet" type="text/css" href="files/assets/pages/data-table/extensions/buttons/css/buttons.dataTables.min.css" />
<link rel="stylesheet" href="files/assets/pages/chart/radial/css/radial.css" type="text/css" media="all" />
<link rel="stylesheet" type="text/css" href="css/custom.css" />
<link rel="stylesheet" type="text/css" href="files/assets/css/style.css" />
<link rel="stylesheet" type="text/css" href="files/assets/css/jquery.mCustomScrollbar.css" />
<link rel="stylesheet" type="text/css" href="files/assets/css/sweetalert.css" />
<!-- feather Awesome -->
<link rel="stylesheet" type="text/css" href="files/assets/icon/feather/css/feather.css " />
<link rel="stylesheet" type="text/css" href="files/assets/icon/ion-icon/css/ionicons.min.css" />
<link rel="stylesheet" type="text/css" href="files/assets/icon/icofont/css/icofont.css" />
<link rel="stylesheet" type="text/css" href="files/assets/icon/simple-line-icons/css/simple-line-icons.css" />
<link rel="stylesheet" type="text/css" href="files/assets/css/sweetalert.css" />
<link rel="stylesheet" type="text/css" href="files/assets/icon/material-design/css/material-design-iconic-font.min.css" />
<!-- pnotify -->
<link rel="stylesheet" type="text/css" href="files/bower_components/pnotify/dist/pnotify.css" />
<link rel="stylesheet" type="text/css" href="files/bower_components/pnotify/dist/pnotify.brighttheme.css" />
<link rel="stylesheet" type="text/css" href="files/bower_components/pnotify/dist/pnotify.buttons.css" />
<link rel="stylesheet" type="text/css" href="files/bower_components/pnotify/dist/pnotify.history.css" />
<link rel="stylesheet" type="text/css" href="files/bower_components/pnotify/dist/pnotify.mobile.css" />
<link rel="stylesheet" type="text/css" href="files/assets/pages/pnotify/notify.css" />
<style>
table.dataTable {
clear: both;
margin-top: 6px !important;
margin-bottom: 6px !important;
max-width: none !important;
border-collapse: separate !important;
margin-left: -1px;
}
button.dt-button, div.dt-button, a.dt-button {
position: relative;
display: inline-block;
box-sizing: border-box;
margin-right: 0.333em;
padding: 4px 11px;
border: 1px solid #34A0A4;
background-color: #34A0A4;
width: auto;
height: 35px;
border-radius: 2px;
cursor: pointer;
font-size: 16px;
color: #fff;
white-space: nowrap;
overflow-y: hidden;
}
@media (max-width: 767px) {
button.dt-button, div.dt-button, a.dt-button {
position: relative;
display: inline-block;
box-sizing: border-box;
margin-right: 0.333em;
padding: 4px 11px;
border: 1px solid #34A0A4;
background-color: #34A0A4;
width: auto;
height: 35px;
border-radius: 2px;
cursor: pointer;
font-size: 16px;
color: #fff;
white-space: nowrap;
overflow-y: hidden;
float: right;
}
}
@media (max-width: 500px) {
button.dt-button, div.dt-button, a.dt-button {
position: relative;
display: inline-block;
box-sizing: border-box;
margin-right: 0.333em;
padding: 4px 11px;
border: 1px solid #34A0A4;
background-color: #34A0A4;
float: right;
width: auto;
height: 35px;
border-radius: 2px;
cursor: pointer;
font-size: 16px;
color: #fff;
white-space: nowrap;
overflow-y: hidden;
}
}
div.dataTables_wrapper div.dataTables_filter input {
margin-left: 0.5em;
border: 1px solid #0AC282;
display: inline-block;
width: 170px;
margin-top: 10px;
}
th {
background: #009933 !important;
color: #ffffff;
text-align: center !important;
font-size: 15px !important;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<div class="pcoded-content">
<div class="pcoded-inner-content">
<div class="main-body">
<div class="page-wrapper">
<div class="page-body">
<div class="row">
<div class="col-sm-12">
<div class="card">
<div class="card-block">
<div class="form-group row">
<div class="col-sm-6">
<h1 style="padding:5px 0px 5px 10px;">Make</h1>
</div>
<div class="col-sm-6">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="page-body">
<div class="row">
<div class="col-sm-12">
<div class="card" style="width: 100%; height: auto;">
<div class="card-block" style="padding-left: 10px; padding-right: 10px;">
<div class="access" style="margin-bottom:-30px;padding-left:10px;">
<button type="button" class="btn btn-success f-w-100" id="downloadButton" style="background-color: #34A0A4; color: #ffffff; border: 1px solid#34A0A4; padding: 4px 11px; border-radius: 2px; margin-top: 10px;">Download</button>
</div>
<div class="button" style="float:right;">
<input type="button" class="btn btn-info" value="Add" onclick="newReq()" />
</div>
<div class="dt-responsive table-responsive" style="padding-left: 10px; padding-bottom: 10px;" data-bind="with: formDocument">
<table id="tblfdss_Master" class="table table-striped table-bordered nowrap" data-bind="hidden: formDocument().lstMakeBindObj().length> 0" " style="width: 100%;">
<thead>
<tr>
<th style=" width: 25%;">Make</th>
<th style=" width: 25%;">Updated By</th>
<th style=" width: 25%;">Updated Date</th>
<th style=" width: 25%;">Action</th>
</tr>
</thead>
<tbody data-bind="foreach: formDocument().lstMakeBindObj()" style="width: 100%;">
<tr>
<td style="width: 25%;"><span data-bind="text: Description"></span></td>
<td style="width: 25%;text-align:left;"><span data-bind="text: CreatedBy"></span></td>
<td style="width: 25%;text-align: center;"><span data-bind="text: UpdatedDate"></span></td>
<td style="text-align: center; width: 25%;">
<button type="button" name="data" class="btn btn-success" onclick="EditDate(this)" style="width: 90px; height: auto; background: #009933; margin-top: -3px; padding: 4px 11px;" data-bind="attr: { 'MasterID': MasterID}"><i class="ti-pencil" style="font-size:16px;"></i>Edit</button>
<button type="button" name="data" class="btn btn-success" onclick="DeleteDate(this)" style="width: 90px; height: auto; background: #FF7D7D; border: 1px solid #FF7D7D; margin-top: -3px; padding: 4px 11px;" data-bind="attr: { 'MasterID': MasterID}"><i class="ti-trash" style="font-size:16px;"></i>Delete</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- HTML5 Export Buttons end -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Required Jquery -->
<script type="text/javascript" src="files/bower_components/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="files/bower_components/jquery-ui/jquery-ui.min.js"></script>
<script type="text/javascript" src="files/bower_components/popper.js/dist/umd/popper.min.js"></script>
<script type="text/javascript" src="files/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!--Knockout Script-->
<script src="js/knockout-3.3.0.js" type="text/javascript"></script>
<script src="js/knockout.mapping-latest.js" type="text/javascript"></script>
<script src="js/knockout.validation.js" type="text/javascript"></script>
<!-- data-table js -->
<script src="files/bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
<script src="files/bower_components/datatables.net-buttons/js/dataTables.buttons.min.js"></script>
<script src="files/assets/pages/data-table/js/dataTables.bootstrap4.min.js"></script>
<script type="text/javascript" src="files/assets/js/sweetalert.js"></script>
<script type="text/javascript" src="files/assets/js/modal.js"></script>
<script type="text/javascript" src="files/assets/js/modalEffects.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var objUrlParams = new URLSearchParams(window.location.search);
var flagId = objUrlParams.get('flagId');
if (flagId == 1) {
new PNotify({
title: 'Registered',
text: 'Saved Successfully...',
icon: 'icofont icofont-info-circle',
type: 'success'
});
}
else if (flagId == 2) {
new PNotify({
title: 'Updated',
text: 'Updated Successfully...',
icon: 'icofont icofont-info-circle',
type: 'success'
});
}
else if (flagId == 3) {
new PNotify({
title: 'Notification',
text: 'It already exists...',
icon: 'icofont icofont-info-circle',
type: 'success'
});
}
BindMake();
document.getElementById("downloadButton").addEventListener("click", function () {
// Access the DataTable instance
var table = $('#tblfdss_Master').DataTable();
// Get all the data from DataTables
var tableData = table.rows().data().toArray();
// Get table headings
var headings = table.columns().header().toArray().map(function (cell) {
return $(cell).text(); // Use jQuery to extract text content
});
// Exclude the last column heading
headings.pop();
// Modify each row to exclude the last cell and get text content only
for (var i = 0; i < tableData.length; i++) {
tableData[i] = tableData[i].slice(0, -1).map(function (cell) {
return $(cell).text(); // Use jQuery to extract text content
});
}
// Insert headings as the first row
tableData.unshift(headings);
// Create Excel workbook and worksheet
var wb = XLSX.utils.book_new();
var ws = XLSX.utils.aoa_to_sheet(tableData);
// Add worksheet to workbook
XLSX.utils.book_append_sheet(wb, ws, "TableData");
// Save workbook as a file
XLSX.writeFile(wb, "Make.xlsx");
});
});
function newReq() {
location.href = "Make.aspx";
}
function BindMake() {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "MakeList.aspx/getMakeList",
dataType: "json",
success: function (data) {
formDocument().lstMakeBindObj().constructor();
if ($.fn.dataTable.isDataTable('#tblfdss_Master')) {
$('#tblfdss_Master').DataTable().clear().destroy();
}
ko.mapping.fromJS(data.d, null, formDocument);
$('#tblfdss_Master').DataTable({
"paging": true,
"ordering": false,
responsive: true,
});
},
error: function (response) {
alert(response.responseText);
},
failure: function (response) {
alert(response.responseText);
}
});
}
function EditDate(itemI) {
location.href = "Make.aspx?MasterID=" + itemI.getAttribute('MasterID');
}
function DeleteDate(itemI) {
var iInd = itemI.getAttribute('MasterID');
swal({
title: "Are you sure?",
text: "You will not be able to recover again!",
type: "warning",
showCancelButton: true,
confirmButtonClass: "btn-danger",
confirmButtonText: "Yes, Delete It",
cancelButtonText: "Cancel",
closeOnConfirm: false,
closeOnCancel: false
},
function (isConfirm) {
if (isConfirm) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "MakeList.aspx/DeleteMake",
data: "{lReqId : " + iInd + "}",
dataType: "json",
success: function (data) {
if (data.d != "") {
var inserted = data.d;
if (inserted > 0) {
new PNotify({
title: 'Deleted',
text: 'Deleted Successfully...',
icon: 'icofont icofont-info-circle',
type: 'warning'
});
BindMake();
swal.close();
}
else
alert('pls verify');
}
},
error: function (response) {
alert(response.responseText);
},
failure: function (response) {
alert(response.responseText);
}
});
}
else {
swal.close();
}
});
}
</script>
<!-- pnotify js -->
<script type="text/javascript" src="files/bower_components/pnotify/dist/pnotify.js"></script>
<script type="text/javascript" src="files/bower_components/pnotify/dist/pnotify.desktop.js"></script>
<script type="text/javascript" src="files/bower_components/pnotify/dist/pnotify.buttons.js"></script>
<script type="text/javascript" src="files/bower_components/pnotify/dist/pnotify.confirm.js"></script>
<script type="text/javascript" src="files/bower_components/pnotify/dist/pnotify.callbacks.js"></script>
<script type="text/javascript" src="files/bower_components/pnotify/dist/pnotify.animate.js"></script>
<script type="text/javascript" src="files/bower_components/pnotify/dist/pnotify.history.js"></script>
<script type="text/javascript" src="files/bower_components/pnotify/dist/pnotify.mobile.js"></script>
<script type="text/javascript" src="files/bower_components/pnotify/dist/pnotify.nonblock.js"></script>
<script type="text/javascript" src="files/assets/pages/pnotify/notify.js"></script>
<script src="js/download.js"></script>
<!-- sweet alert js -->
<script type="text/javascript" src="files/assets/js/sweetalert.js"></script>
<script type="text/javascript" src="files/assets/js/modal.js"></script>
<!-- sweet alert modal.js intialize js -->
<!-- modalEffects js nifty modal window effects -->
<script type="text/javascript" src="files/assets/js/modalEffects.js"></script>
<script type="text/javascript" src="files/assets/js/classie.js"></script>
<script type="text/javascript">
var lstMakeObj = function () {
var self = this;
this.lstMakeBindObj = ko.observableArray([{
MasterID: 0, Description: '', CreatedBy: '', UpdatedDate: ''
}]);
};
formDocument = ko.observable(new lstMakeObj());
ko.applyBindings(new lstMakeObj(), document.getElementById("tblfdss_Master"));
</script>
</asp:Content>