public void AddGate(AddGate p) { string cmd = string.Format("INSERT INTO gate (gatename) values('{0}')", p.Name); MySqlConnection conn = new MySqlConnection(System.Configuration.ConfigurationManager.AppSettings["ConnectionString"]); conn.Open(); MySqlCommand command = new MySqlCommand(cmd, conn); command.ExecuteReader(); conn.Close(); }
public ActionResult AddGate(AddGate gate) { gateRepo.AddGate(gate); return RedirectToAction("Index", "Gate"); }