// // GET: /Country/Country/Delete/5 public ActionResult Delete(int id) { try { var category = new ASF.Entities.Country(); category.Id = id; countryProcess.Remove(category); } catch (Exception ex) { throw new Exception(ex.Message); } return(RedirectToAction("Index")); }
public ActionResult Create(FormCollection collection) { var name = collection["Name"]; var newCountry = new ASF.Entities.Country(); newCountry.Name = name; newCountry.ChangedOn = DateTime.Now; newCountry.CreatedOn = DateTime.Now; try { newCountry = countryProcess.Add(newCountry); return(RedirectToAction("Index")); } catch { return(View()); } }