Ejemplo n.º 1
0
        public ActionResult Generate(FormCollection coll)
        {
            try {
                if (ModelState.IsValid)
                {
                    var alaptipp = _repo.GetAlaptippFromCollection(coll);
                    if (_repo.IsValidAlaptipp())
                    {
                        //alaptipp = repo.GetAlaptipp();
                        var tippSor = _repo.GenerateAllFromAlaptipp();

                        var session = System.Web.HttpContext.Current.Session;
                        TotoSessionFactory.Tippsor  = tippSor;
                        TotoSessionFactory.Alaptipp = alaptipp;
                        _pagi.OnePage = TotoConst.DEFPAGECOUNT;
                        _pagi.SetCount(tippSor.TippSor.Count);
                        _pagi.SetActPage(1);
                        TotoSessionFactory.Pagination = _pagi;

                        return(RedirectToAction("Filter"));
                    }
                    else
                    {
                        ViewBag.Error = ERROR1;
                        return(View(_repo.GetAlaptipp()));
                    }
                }
                else
                {
                    return(View(TotoFactory.NewTotoAlapTipp()));
                }
            } catch {
                //TODO: Kiírni a tényleges hibát is!!
                ViewBag.Error = ERROR2;
                return(View(TotoFactory.NewTotoAlapTipp()));
            }
        }