예제 #1
0
        public IActionResult Edit(IFormCollection collection)
        {
            string id          = collection["id"].ToString();
            string subject     = collection["subject"].ToString();
            string description = collection["description"].ToString();

            Debug.WriteLine(collection.ToString());

            database.command("update notes set subject='" + subject + "', description='" + description + "' where id=" + id);
            return(Redirect("../Index"));
        }
예제 #2
0
        public ActionResult Add(IFormCollection collection)
        {
            AccountID = HttpContext.Session.GetString("AccountID");

            string subject     = collection["subject"].ToString();
            string description = collection["description"].ToString();

            Debug.WriteLine(collection.ToString());

            database.command("insert into mvcdb.notes (account_id,subject,description) values(" + AccountID + ",'" + subject.Replace("'", "") + "','" + description.Replace("'", "") + "')");

            return(Redirect("Index"));
        }