Esempio n. 1
0
        public ActionResult Detail(int seq, int row_page_h = 5, int pageNumber = 1)
        {
            //List<string> list = new List<string>();
            //IEnumerable<string> enumerable = new List<string>();
            //ICollection<string> collection = new List<string>();
            //IList<string> iList = new List<string>();



            //up_submit_selectdetail_Result model = new up_submit_selectdetail_Result();
            Detail_List model = new Detail_List();

            model.detail = DB.up_submit_selectdetail
                           (
                seq
                           ).SingleOrDefault();
            ObjectParameter totalRecords = new ObjectParameter("TotalRecords", typeof(int));

            model.coment_list = DB.up_coment_select_list
                                (
                seq,
                row_page_h,
                pageNumber,
                totalRecords
                                ).ToList();
            int totalblock = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(totalRecords.Value) / row_page_h));
            int firstpage  = Convert.ToInt32(Math.Ceiling(Convert.ToDouble((pageNumber - 1) / row_page_h) * row_page_h + 1));
            int lastpage   = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(pageNumber) / row_page_h) * row_page_h);

            if (lastpage > totalblock)
            {
                lastpage = totalblock;
            }

            ViewBag.seq         = seq;
            ViewBag.lastpage    = lastpage;
            ViewBag.firstpage   = firstpage;
            ViewBag.totalblock  = totalblock;
            ViewBag.nowpage     = pageNumber;
            ViewBag.rowsPerPage = row_page_h;

            return(View(model));
        }