public ActionResult AddBrewery(FormCollection form)
 {
     if (form["operation"] == "Add")
     {
         var breweries = Session["Breweries"] as List<Brewery>;
         var brewery = new Brewery { ID = breweries.Count > 0 ? breweries[breweries.Count - 1].ID + 1 : 1 };
         formToBrewery(brewery, form);
         (Session["Breweries"] as List<Brewery>).Add(brewery);
     }
     return Redirect("/Breweries/Index");
 }
 private void formToBrewery(Brewery brewery, FormCollection form)
 {
     brewery.Name = form["Name"];
     brewery.Address = form["Address"];
     brewery.City = form["City"];
     var state = AppEnum.StateAbrv.AK;
     if (Enum.TryParse(form["State"], out state))
     {
         brewery.State = state;
     }
     brewery.Zip = form["Zip"];
     brewery.Phone = form["Phone"];
 }