public ActionResult DeleteConfirmed(int id)
        {
            Stud stud = db.Studs.Find(id);

            db.Studs.Remove(stud);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        //
        // GET: /Ansa/Details/5

        public ActionResult Details(int id = 0)
        {
            Stud stud = db.Studs.Find(id);

            if (stud == null)
            {
                return(HttpNotFound());
            }
            return(View(stud));
        }
 public ActionResult Edit(Stud stud)
 {
     if (ModelState.IsValid)
     {
         db.Entry(stud).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserDemoid = new SelectList(db.UserDemos, "UserDemoid", "username", stud.UserDemoid);
     return(View(stud));
 }
        //
        // GET: /Ansa/Edit/5

        public ActionResult Edit(int id = 0)
        {
            Stud stud = db.Studs.Find(id);

            if (stud == null)
            {
                return(HttpNotFound());
            }
            ViewBag.UserDemoid = new SelectList(db.UserDemos, "UserDemoid", "username", stud.UserDemoid);
            return(View(stud));
        }
        public ActionResult Create(Stud stud)
        {
            if (ModelState.IsValid)
            {
                db.Studs.Add(stud);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.UserDemoid = new SelectList(db.UserDemos, "UserDemoid", "username", stud.UserDemoid);
            return(View(stud));
        }