Пример #1
0
 public ActionResult Create(FormCollection formValues)
 {
     Blog blog = new Blog { UserName = "******", RecCreationTime = DateTime.Now, ApplicationName = "/aalferez" };
     if (TryUpdateModel(blog))
     {
         BlogRepo.AddBlog(blog);
         BlogRepo.SaveChanges();
         return RedirectToAction("Details", new { id = blog.BlogID });
     }
     return View();
 }
Пример #2
0
 /// <summary>
 /// Create a new Blog object.
 /// </summary>
 /// <param name="blogID">Initial value of the BlogID property.</param>
 /// <param name="recCreationTime">Initial value of the RecCreationTime property.</param>
 public static Blog CreateBlog(global::System.Int32 blogID, global::System.DateTime recCreationTime)
 {
     Blog blog = new Blog();
     blog.BlogID = blogID;
     blog.RecCreationTime = recCreationTime;
     return blog;
 }
Пример #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Blogs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToBlogs(Blog blog)
 {
     base.AddObject("Blogs", blog);
 }
Пример #4
0
 public ActionResult Create()
 {
     Blog blog = new Blog {UserName = "******",RecCreationTime = DateTime.Now,ApplicationName = "/aalferez" };
     return View(blog);
 }
Пример #5
0
 public void DeleteBlog(Blog BlogToDelete)
 {
     db.Blogs.DeleteObject(BlogToDelete);
     //db.Blogs.DeleteOnSubmit(BlogToDelete);    //LINQ
     //db.SubmitChanges();
 }
Пример #6
0
 public void AddBlog(Blog BlogToAdd)
 {
     db.Blogs.AddObject(BlogToAdd);
     //db.Blogs.InsertOnSubmit(BlogToAdd);
     //db.SubmitChanges();
 }