Example #1
0
 public static JsDataTable add_Column(this JsDataTable jsDataTable, string title, string _class)
 {
     jsDataTable.aoColumns.Add(new JsDataTable.JsDataColumn {
         sTitle = title, sClass = _class
     });
     return(jsDataTable);
 }
 public JsDataTable JsDataTableWithPastRequests()
 {
     var jsDataTable =  new JsDataTable();
     jsDataTable.add_Columns("Url", "Date", "UserName", "SessionID", "PostData");
     foreach(var pastRequest in activityTracking.PastRequests)
         jsDataTable.add_Row(pastRequest.Url, pastRequest.Date, pastRequest.UserName, pastRequest.SessionID, pastRequest.PostData);
     return jsDataTable;
 }
Example #3
0
 public static JsDataTable add_Columns(this JsDataTable jsDataTable, params string[] titles)
 {
     foreach (var title in titles)
     {
         jsDataTable.add_Column(title);
     }
     return(jsDataTable);
 }
        public JsDataTable getDataTableFromGuidanceItems(List<GuidanceItem_V3> rawGuidanceItems)
        {
            var guidanceItems = rawGuidanceItems.GroupBy((guidanceItem)=>guidanceItem.guidanceItemId)
                                                .Select((g)=>g.First())
                                                .ToList();

            var jsDataTable =  new JsDataTable();
            jsDataTable.add_Columns("Check", "Title",  "Technology", "Phase", "Type", "Category", "Id");
            foreach(var guidanceItem in guidanceItems)
                    jsDataTable.add_Row("<input type='checkbox' class='GuidanceItemCheckBox' style='text-align: center'/>",
                                        guidanceItem.title.trim(),
                                        guidanceItem.technology.trim() ,
                                        guidanceItem.phase ?? "",
                                        guidanceItem.rule_Type.trim() ,
                                        //guidanceItem.type ?? "(TBD2)",
                                        guidanceItem.category.trim() ,
                                        guidanceItem.guidanceItemId);
            return jsDataTable;
        }
Example #5
0
 public static JsDataTable add_Column(this JsDataTable jsDataTable, string title)
 {
     return(jsDataTable.add_Column(title, null));
 }
Example #6
0
 public static JsDataTable add_Row(this JsDataTable jsDataTable, List <object> cells)
 {
     jsDataTable.aaData.Add(cells);
     return(jsDataTable);
 }
Example #7
0
 public static JsDataTable add_Row(this JsDataTable jsDataTable, params object[] cells)
 {
     return(jsDataTable.add_Row(cells.ToList()));
 }
Example #8
0
 public static string jsonString(this JsDataTable jsDataTable)
 {
     return(new JavaScriptSerializer().Serialize(jsDataTable));
 }