Esempio n. 1
0
        //List the contents of the database
        public ActionResult Show()

        {
            FORMDBContext context = new FORMDBContext();
            List <Lists>  all     = context.Lists.ToList();

            ViewBag.AllListItems = all;
            return(View());
        }
Esempio n. 2
0
        public ActionResult Submit(string textBoxStringData)
        {
            FORMDBContext context   = new FORMDBContext();
            Lists         newObject = new Lists()
            {
                ListData = textBoxStringData,
                ListTime = DateTime.Now
            };

            context.Lists.Add(newObject);
            context.SaveChanges();
            return(RedirectToAction("ConfirmationPage"));
        }