Пример #1
0
 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"));
 }
Пример #2
0
 public ActionResult Add(SexyModel x)
 {
     connectToServer();
     cmd.CommandText = $"insert into people values('{x.name}','{x.Address}','{x.number}')";
     cmd.ExecuteNonQuery();
     return(View("Index"));
 }
Пример #3
0
 public ActionResult Delete(SexyModel x, int cin)
 {
     connectToServer();
     cmd.CommandText = $"DELETE FROM people WHERE CIN = {cin}";
     cmd.ExecuteNonQuery();
     con.Close();
     return(View("Index"));
 }
Пример #4
0
 public ActionResult Edit(SexyModel x, int cin)
 {
     ViewData["update"] = "" + cin;
     return(View("newEntry"));
 }