コード例 #1
0
        public void EditUser(Users user)
        {
            var originalUser = (from u in _dataModel.Users1 where u.userId == user.userId select u).First();

            _dataModel.ApplyCurrentValues(originalUser.EntityKey.EntitySetName, user);
            _dataModel.SaveChanges();
        }
コード例 #2
0
        public ActionResult Edit(Users user)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    _userService.EditUser(user);
                }

                return RedirectToAction("Index");
            }

            catch
            {
                return View();
            }
        }
コード例 #3
0
 public string CreateUserData(Users user)
 {
     return user.userId.ToString();
 }
コード例 #4
0
 public void CreateUser(Users user)
 {
     user.userId = Guid.NewGuid();
     _dataModel.AddToUsers1(user);
     _dataModel.SaveChanges();
 }
コード例 #5
0
 public ActionResult LogOn(Users user)
 {
     Users authUser = _userService.AuthenticateUser(user.username, user.password);
     if (authUser != null)
     {
         return Redirect("~/Admin");
     }
     return View();
 }
コード例 #6
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Users1 EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToUsers1(Users users)
 {
     base.AddObject("Users1", users);
 }
コード例 #7
0
 /// <summary>
 /// Create a new Users object.
 /// </summary>
 /// <param name="userId">Initial value of the userId property.</param>
 public static Users CreateUsers(global::System.Guid userId)
 {
     Users users = new Users();
     users.userId = userId;
     return users;
 }