Пример #1
0
        public void SpremiScore(string nick, int score)
        {
            // Create a new Order o;
            GeoQuizEntities CTX;

            CTX = new GeoQuizEntities();
            HighScore hig = new HighScore
            {
                Nick  = nick,
                Score = score
            };

            CTX.HighScore.Add(hig);


            // Submit the change to the database.
            try
            {
                CTX.SaveChanges();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                // Make some adjustments.
                // ...
                // Try again.
                CTX.SaveChanges();
            }
            //return "";
        }
Пример #2
0
        public ActionResult Create([Bind(Include = "SifraKontinent,NazivKontinentHr,NazivKontinentEng")] Kontinent kontinent)
        {
            if (ModelState.IsValid)
            {
                db.Kontinent.Add(kontinent);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(kontinent));
        }
Пример #3
0
        public ActionResult Create([Bind(Include = "SifraDrzava,SifraKontinent,GlavniGrad,Zastava,BrojStanovnika,NazivDrzavaHr,NazivDrzavaEng")] Drzava drzava)
        {
            if (ModelState.IsValid)
            {
                db.Drzava.Add(drzava);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.SifraKontinent = new SelectList(db.Kontinent, "SifraKontinent", "NazivKontinentHr", drzava.SifraKontinent);
            return(View(drzava));
        }