initial add
This commit is contained in:
		
							
								
								
									
										112
									
								
								Fab2ApprovalSystem-Copy/Views/Home/AuditList.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										112
									
								
								Fab2ApprovalSystem-Copy/Views/Home/AuditList.cshtml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,112 @@ | ||||
| @{ | ||||
|     Layout = "_HomeLayout.cshtml"; | ||||
| } | ||||
|  | ||||
| @{ | ||||
|     ViewBag.Title = "Audit List"; | ||||
| } | ||||
|  | ||||
| <div class="panel panel-default"> | ||||
|     <div class="panel-heading"> | ||||
|         <table style="width: 100%"> | ||||
|             <tr> | ||||
|                 <td align="center" style="font-size: 15px; font-weight: bold; color: crimson"> | ||||
|                     Audit List | ||||
|                 </td> | ||||
|             </tr> | ||||
|         </table> | ||||
|     </div> | ||||
|     <div id="auditListdiv" class="k-content" style="font-size: 11px"> | ||||
|  | ||||
|  | ||||
|         @(Html.Kendo().Grid<Fab2ApprovalSystem.Models.AuditList>() | ||||
|                         .Name("AuditList") | ||||
|                         .Columns(columns => | ||||
|                         { | ||||
|                             columns.Bound(l => l.CorrectiveActions).Visible(false); | ||||
|                             columns.Bound(l => l.AuditNo) | ||||
|                                         .ClientTemplate("<a href='/Audit/Edit?IssueID=#=AuditNo#'>#=formatIssueID(AuditNo)#</a>").Width("50px"); | ||||
|                              | ||||
|                             columns.Bound(l => l.AuditTitle).Width("100px"); | ||||
|                             columns.Bound(l => l.AuditType).Width("250px"); | ||||
|                             columns.Bound(l => l.Auditors).Width("100px"); | ||||
|                             columns.Bound(l => l.AuditDate).Format("{0:MM/dd/yy}").Width("100px"); | ||||
|                             columns.Bound(l => l.FindingCategories).Width("150px"); | ||||
|                             columns.Bound(l => l.AuditedAreas).Width("100px"); | ||||
|                             columns.Bound(a => a.CADisp).ClientTemplate("#=buildCALinks(CorrectiveActions, CADisp)#").Width("100px").Title("CA Links"); | ||||
|                             columns.Bound(l => l.PendingCAOwners).Width("100px").Title("Open CA Owners"); | ||||
|                             columns.Bound(l => l.PendingCAFindingsAIOwners).Width("100px").Title("Open AI Owners"); | ||||
|                             columns.Bound(l => l.AuditScore).Width("100px"); | ||||
|                             columns.Bound(l => l.AuditStatus).Width("100px"); | ||||
|  | ||||
|                         }) | ||||
|  | ||||
|                             .Selectable(selectable => selectable.Mode(GridSelectionMode.Single).Type(GridSelectionType.Row)) | ||||
|                             .Editable(editable => editable.Mode(GridEditMode.InLine)) | ||||
|                             .HtmlAttributes(new { style = "height:700px; width:100%; font-size: 11px" }) | ||||
|                             .Scrollable() | ||||
|                             .Sortable() | ||||
|                             .Resizable(r => r.Columns(true)) | ||||
|                             .Filterable(filterable => filterable | ||||
|                                             .Extra(false) | ||||
|                                             .Operators(operators => operators | ||||
|                                                 .ForString(str => str | ||||
|                                                     .Clear() | ||||
|                                                     .Contains("Contains") | ||||
|                                                     .DoesNotContain("Does not contain") | ||||
|                                                     .StartsWith("Starts with") | ||||
|                                                     .EndsWith("Ends with") | ||||
|                                                     .IsEqualTo("Is equal to") | ||||
|                                                     .IsNotEqualTo("Is not equal to ") | ||||
|                                                     ) | ||||
|                                                 ) | ||||
|                                 ) | ||||
|                             .Pageable(pageable => pageable | ||||
|                                 .Refresh(true) | ||||
|                                 .PageSizes(true) | ||||
|                                 .ButtonCount(5)) | ||||
|  | ||||
|                             .DataSource(dataSource => dataSource | ||||
|                                         .Ajax() | ||||
|                                         .Model(model => | ||||
|                                     { | ||||
|                                         model.Id(p => p.AuditNo); | ||||
|  | ||||
|                                         //model.Field(p => p.TotalCost).Editable(false); | ||||
|                                     }) | ||||
|                                         .PageSize(50) | ||||
|                                         .Read(read => read.Action("GetAuditList", "Home")) | ||||
|                 //.Destroy(destroy => destroy.Action("DeleteItem", "Home")) | ||||
|                                         ) | ||||
|         ) | ||||
|     </div> | ||||
| </div> | ||||
|  | ||||
| <script> | ||||
|     function formatIssueID(num) { | ||||
|         var length = 5; | ||||
|         var numStr = num.toString(); | ||||
|         while (numStr.length < length) { | ||||
|             numStr = '0' + numStr; | ||||
|         } | ||||
|  | ||||
|         numStr = 'A' + numStr | ||||
|         return numStr; | ||||
|     } | ||||
|  | ||||
|  | ||||
|     function buildCALinks(CAs, CADisp) { | ||||
|         var template = ""; | ||||
|         if (CAs != null) { | ||||
|             var tempValue = CAs.split(','); | ||||
|             var tempValueDisp = CADisp.split(','); | ||||
|             for (var i = 0; i < tempValue.length; i++) { | ||||
|                 template += "<a href='/CorrectiveAction/Edit?IssueID=" + tempValue[i] + "'> " + tempValueDisp[i] + ",</a>" + " "; | ||||
|             } | ||||
|  | ||||
|         } | ||||
|         return template; | ||||
|  | ||||
|     } | ||||
|  | ||||
| </script> | ||||
		Reference in New Issue
	
	Block a user