Blog.Controllers.HomeController.Index C# (CSharp) Method

Index() public method

public Index ( int offset ) : System.Web.Mvc.ActionResult
offset int
return System.Web.Mvc.ActionResult
        public ActionResult Index(int? offset)
        {
            ViewData["PostyTagi"] = _postTag.pobierzPorcje(Int16.Parse(_ustawienia.getSettings("ilosc_pozycji_na_strone")),(offset==null||offset==0)?0:(int)offset-1);
            ViewData["Komentarze"] = _komentarze.PobierzWszystkie();
            //Lista(aktywna strona, liczba postow, elementów w porcji)
            ViewData["Nawigacja"] = new List<int> { (offset == null || offset == 0) ? 1 : (int)offset, _postTag.ileWszystkichAktywnych(), Int16.Parse(_ustawienia.getSettings("ilosc_pozycji_na_strone")) };
            return View();
        }

Usage Example

Beispiel #1
0
        public void Index()
        {
            // Arrange
            HomeController controller = new HomeController();

            // Act
            ViewResult result = controller.Index() as ViewResult;

            // Assert
            Assert.AreEqual("Modify this template to jump-start your ASP.NET MVC application.", result.ViewBag.Message);
        }
All Usage Examples Of Blog.Controllers.HomeController::Index