Ejemplo n.º 1
0
 private void UpdateUserLastSeen(User user)
 {
     // Set user last seen
     var db = new SpindleDbContext();
     user.LastSeen = DateTime.Now;
     db.Entry(user).State = EntityState.Modified;
     db.SaveChanges();
 }
Ejemplo n.º 2
0
 public ActionResult ChangeDisplayName(User model)
 {
     var db = new SpindleDbContext();
     if (ModelState.IsValid)
     {
         var profile = db.Users.Find(model.Id);
         profile.DisplayName = model.DisplayName;
         db.Entry(profile).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         User.Identity.RefreshDbContext();
         return RedirectToAction("Manage", new { Message = ManageMessageId.ChangeDisplayNameSuccess });
     }
     // Something went wrong?
     return View("Manage", model);
 }