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

                TryUpdateModel(item);

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

                    Response.Redirect("Default");
                }
            }
        }
예제 #2
0
파일: Insert.aspx.cs 프로젝트: damgel/RHApp
        // This is the Insert method to insert the entered TipoConstancia item
        // USAGE: <asp:FormView InsertMethod="InsertItem">
        public void InsertItem()
        {
            using (_db)
            {
                var item = new RHApp.Models.TipoConstancia();

                TryUpdateModel(item);

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

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