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")); }
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")); }