コード例 #1
0
        public ActionResult Index(Primal primal)
        {
            if (ModelState.IsValid)
            {
                int liczba    = primal.Liczba;
                int ilwierszy = (liczba / 20) + 1;

                PrimaryNumbers pn = new PrimaryNumbers(liczba);
                StringBuilder  sb = new StringBuilder();
                foreach (var item in pn.GetNumbers())
                {
                    sb.Append(item + " ");
                }

                ViewBag.primary = pn.GetNumbers();
                ViewBag.liczby  = sb.ToString();
                ViewBag.rows    = ilwierszy;
                return(View());
            }
            else
            {
                return(View(primal));
            }
        }
コード例 #2
0
        // GET: Primal
        public ActionResult Index()
        {
            Primal primal = new Primal();

            return(View());
        }