public void AddMaskapai(AddMaskapai p) { string cmd = string.Format("INSERT INTO maskapai (name,jenisid) values('{0}','{1}')", p.Name, p.JenisId); MySqlConnection conn = new MySqlConnection(System.Configuration.ConfigurationManager.AppSettings["ConnectionString"]); conn.Open(); MySqlCommand command = new MySqlCommand(cmd, conn); command.ExecuteReader(); conn.Close(); }
public ActionResult AddMaskapai(AddMaskapai maskapai) { maskapaiRepo.AddMaskapai(maskapai); return RedirectToAction("Index", "Maskapai"); }