public ActionResult DeleteConfirmed(int id)
        {
            DualDatabaseTestSchemeTest dualDatabaseTestSchemeTest = db.DualDatabaseTestSchemeTestDataBase.Find(id);

            db.DualDatabaseTestSchemeTestDataBase.Remove(dualDatabaseTestSchemeTest);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit(string Public, [Bind(Include = "Name,Description,Genre")] DualDatabaseTestSchemeTest dualDatabaseTestSchemeTest)
 {
     if (ModelState.IsValid)
     {
         dualDatabaseTestSchemeTest.Status          = Public;
         dualDatabaseTestSchemeTest.DateModified    = DateTime.Now.ToString();
         db.Entry(dualDatabaseTestSchemeTest).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("PersonalProfile"));
     }
     return(View(dualDatabaseTestSchemeTest));
 }
        // GET: DualDatabaseTestSchemeTests/Delete/5

        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DualDatabaseTestSchemeTest dualDatabaseTestSchemeTest = db.DualDatabaseTestSchemeTestDataBase.Find(id);

            if (dualDatabaseTestSchemeTest == null)
            {
                return(HttpNotFound());
            }
            return(View(dualDatabaseTestSchemeTest));
        }
        //legacy function
        public ActionResult CreateTestObject(string Public, [Bind(Include = "Name,Description,Genre")] DualDatabaseTestSchemeTest newTest)
        {
            //Random is no longer necessary
            //newTest.ID = random.Next(1, 50000);
            newTest.Owner        = System.Web.HttpContext.Current.User.Identity.Name;
            newTest.DateModified = DateTime.Now.ToString();
            newTest.Status       = Public;



            db.DualDatabaseTestSchemeTestDataBase.Add(newTest);
            db.SaveChanges();

            /*
             * db.DualDatabaseTestSchemeTestDataBase.Attach(newTest);
             * db.Entry(newTest).State = EntityState.Modified;
             * db.SaveChanges();*/

            return(RedirectToAction("Index"));
        }
        // GET: DualDatabaseTestSchemeTests/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DualDatabaseTestSchemeTest dualDatabaseTestSchemeTest = db.DualDatabaseTestSchemeTestDataBase.Find(id);

            if (dualDatabaseTestSchemeTest == null)
            {
                return(HttpNotFound());
            }

            //count questions
            ViewBag.countquestions = null;
            if (TempData["countquestions"] != null)
            {
                ViewBag.countquestions = (int)TempData["countquestions"];
            }



            return(View(dualDatabaseTestSchemeTest));
        }