public ActionResult Update(SexyModel x, int cin) { connectToServer(); cmd.CommandText = $"UPDATE people SET Name = '{x.name}',address = '{x.Address}',telephone ='{x.number}' where CIN = {cin}"; cmd.ExecuteNonQuery(); return(View("Index")); }
public ActionResult Add(SexyModel x) { connectToServer(); cmd.CommandText = $"insert into people values('{x.name}','{x.Address}','{x.number}')"; cmd.ExecuteNonQuery(); return(View("Index")); }
public ActionResult Delete(SexyModel x, int cin) { connectToServer(); cmd.CommandText = $"DELETE FROM people WHERE CIN = {cin}"; cmd.ExecuteNonQuery(); con.Close(); return(View("Index")); }
public ActionResult Edit(SexyModel x, int cin) { ViewData["update"] = "" + cin; return(View("newEntry")); }