Exemple #1
0
 public ActionResult CityForm(FormCollection fc)
 {
     if (fc["btnInsert"] == "Insert")
     {
         City city = new City()
         {
             City1   = fc["txtCity"],
             StateID = int.Parse(fc["txtState"])
         };
         Bc.AddCity(city);
     }
     else if (fc["btnUpdate"] == "Update")
     {
         City city = new City()
         {
             CityID = int.Parse(fc["txtCityID"]),
             City1  = fc["txtCity"]
         };
         Bc.UpdateCity(city);
     }
     return(RedirectToAction("CityForm"));
 }