Beispiel #1
0
        public ActionResult Create(FormCollection collection)
        {
            var FristName = collection["FristName"];
            var LastName  = collection["LastName"];
            var BirthDate = collection["BirthDate"];
            var date      = DateTime.Parse(BirthDate);

            try {
                var repository = new FriendsRepository();
                repository.InsertFriend(FristName, LastName, date);
                return(RedirectToAction("Index"));
            } catch (Exception e) {
                Console.WriteLine(e.Message);
                return(View());
            }
        }