예제 #1
0
 public ActionResult Create(User customer)
 {
     ReturnObj returnObj = new ReturnObj();
     customer.UserID = Guid.NewGuid();
     customer.Password = MD5Helper.ToString(customer.Password);
     if (iUserManager.Save(customer) > 0)
     {
         returnObj.State = 1;
         returnObj.Msg = "保存成功!";
     }
     else
     {
         returnObj.State = -1;
         returnObj.Msg = "保存失败!";
     }
     return Json(returnObj, JsonRequestBehavior.AllowGet);
 }
예제 #2
0
 /// <summary>
 /// 用于向 Users EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
 /// </summary>
 public void AddToUsers(User user)
 {
     base.AddObject("Users", user);
 }
예제 #3
0
 /// <summary>
 /// 创建新的 User 对象。
 /// </summary>
 /// <param name="userID">UserID 属性的初始值。</param>
 /// <param name="loginID">LoginID 属性的初始值。</param>
 /// <param name="password">Password 属性的初始值。</param>
 public static User CreateUser(global::System.Guid userID, global::System.String loginID, global::System.String password)
 {
     User user = new User();
     user.UserID = userID;
     user.LoginID = loginID;
     user.Password = password;
     return user;
 }
예제 #4
0
 public ActionResult Edit(User user)
 {
     iUserManager.Update(user);
     return RedirectToAction("Index");
 }