Ejemplo n.º 1
0
 public ActionResult Edit(TutorialsModel tutorialsModel)
 {
     if (ModelState.IsValid)
     {
         tutorialsModel.UpdateAt = DateTime.Now;
         Tutorials tutorials = tutorialsModel.ToEntity();
         tutorialsCRUD.Update(tutorials);
         return(RedirectToAction("Index"));
     }
     return(View(tutorialsModel));
 }
Ejemplo n.º 2
0
        public void TutorialsUpdate()
        {
            TutorialsService tutorialsCRUD = new TutorialsService();
            Tutorials        tutorials     = new Tutorials();

            tutorials.TutorialsID = "1394f8b1-e734-4231-8c52-d1cba8e2fbf7";
            tutorials.Title       = "爬虫33";
            tutorials.Content     = "";
            tutorials.CreateAt    = DateTime.Now;
            tutorials.Disc        = "Disc";
            tutorials.Notes       = "Notes";
            User user = new User();

            user.UserID    = "1f1c4189-3792-4a91-8d08-c0d04e18a0ae";
            tutorials.user = user;
            tutorialsCRUD.Update(tutorials);
        }