Пример #1
0
        // This is the Insert method to insert the entered Religion item
        // USAGE: <asp:FormView InsertMethod="InsertItem">
        public void InsertItem()
        {
            using (_db)
            {
                var item = new RHApp.Models.Religion();

                TryUpdateModel(item);

                if (ModelState.IsValid)
                {
                    // Save changes
                    _db.Religions.Add(item);
                    _db.SaveChanges();

                    Response.Redirect("Default");
                }
            }
        }
Пример #2
0
        // This is the Insert method to insert the entered Religion item
        // USAGE: <asp:FormView InsertMethod="InsertItem">
        public void InsertItem()
        {
            using (_db)
            {
                var item = new RHApp.Models.Religion();

                TryUpdateModel(item);

                if (ModelState.IsValid)
                {
                    // Save changes
                    _db.Religions.Add(item);
                    _db.SaveChanges();

                    Response.Redirect("Default");
                }
            }
        }