コード例 #1
0
        //------ Sub Grid------------
        public JsonResult SubGridData(string id)
        {
            string s = @"
                 SELECT     MEDIA_STATISTICS.*
                FROM         MEDIA_CAT_DIGITAL_PLCMNT INNER JOIN
                 MEDIA_STATISTICS ON MEDIA_CAT_DIGITAL_PLCMNT.PLACEMENT_CODE 
                 = MEDIA_STATISTICS.PLACEMENT_CODE
                and OID_MEDIA_CAT_DIGITAL_PLCMNT =  ";

            s += id.ToString();


            IEnumerable <dynamic> results = tbl.Query(s);

            DynamicModel       myview = new View_Placements_Publications();
            jgridDisplayHelper sh     = new jgridDisplayHelper(ShapeSubGridRow);

            JsonResult myJasonResults = sh.GetJson(results, 0, 0, 0);


            return(myJasonResults);
        }
コード例 #2
0
        public JsonResult DynamicGridData(string sidx, string sord, int page, int rows, bool _search, string filters)
        {
            //note: a view is used here. This is because the we want to display the PUBLICATION_NETWORK field from the PUBLICATION_NETWORKS table
            //OID_PUBLISHER_ID field of the  MEDIA_CAT_DIGITAL_PLCMNT table is hooked up to a combo box: ref method PublishersCombo() which feeds the combo box
            //if just the data from the MEDIA_CAT_DIGITAL_PLCMNT table was to be dispayed you could simply pass in the Placements class like so:
            //SearchHelper sh = new SearchHelper(new Placements(), ShapeGridRow);

            //display a view
            DynamicModel       myview = new View_Placements_Publications();
            jgridDisplayHelper sh     = new jgridDisplayHelper(myview, ShapeGridRow);

            int pageIndex    = Convert.ToInt32(page) - 1;
            int pageSize     = rows;
            int totalRecords = tbl.Count(); //repository.TimeCards.Count();
            int totalPages   = (int)Math.Ceiling((float)totalRecords / (float)pageSize);



            JsonResult mydata = sh.GetSearchResults(sidx, sord, page, rows, _search, filters);

            return(mydata);
        }