Esempio n. 1
0
        public ActionResult DetailFAQ(long id)
        {
            try
            {
                Business.ClassBusiness.CommentsNewsBusiness commentsBusiness = new Business.ClassBusiness.CommentsNewsBusiness();

                var faqdetail = commentsBusiness.GetById(id);
                return(View(faqdetail));
            }
            catch (Exception)
            {
                //Write log
                throw;
            }
        }
Esempio n. 2
0
        public ActionResult FAQ(int page = 1, int pageSize = 6)
        {
            try
            {
                Business.ClassBusiness.CommentsNewsBusiness commentsBusiness = new Business.ClassBusiness.CommentsNewsBusiness();

                int totalRecord = 0;
                int totalPage   = 0;
                List <Common.CommentsNew> listcomments = commentsBusiness.ListByCommentsNew(null, ref totalRecord, page, pageSize);
                ViewBag.Total = totalRecord;
                ViewBag.Page  = page;

                int maxPage = 1;

                if (totalRecord % pageSize == 0)
                {
                    totalPage = totalRecord / pageSize;
                }
                else
                {
                    totalPage = totalRecord / pageSize + 1;
                }

                ViewBag.TotalPage = totalPage;
                ViewBag.MaxPage   = maxPage;
                ViewBag.First     = 1;
                ViewBag.Last      = totalPage;
                ViewBag.Next      = page + 1;
                ViewBag.Prev      = page - 1;
                return(View(listcomments));
            }
            catch (FaultException ex)
            {
                var    exep    = Function.GetExeption(ex);
                var    codeExp = exep[1];
                string url     = "Error/ErrorFunction/" + codeExp;
                return(RedirectToActionPermanent(url));
            }
        }