public User CreateAccount(User model) { model.GroupID = 3; model.Password = HashPassword(model.Password); db.Insert(model); return model; }
public JsonResult CheckoutAsGest(User user) { try { Session["CheckoutGest"] = user; return Json(new { success = true }); } catch { return Json(new { success = false }); } }
public int Update(User user) { var current =GetUSerByID(user.ID); if (!String.IsNullOrEmpty(user.Password)) { if (ComparerHash(current.Password, user.Password)) { user.Password = HashPassword(user.Password); user.GroupID = 3; db.Update(user); return 0; } else { return 1; } } else { db.Update("User", "ID", new { ID = user.ID, FullName = user.FullName, Gender = user.Gender, Email = user.Email, Phone = user.Phone, Address = user.Address }); return 1; } }
public JsonResult Update(User user) { if (user != null) { _userService.Update(user); return Json(new { success = true, data = user }, JsonRequestBehavior.AllowGet); } else { return Json(new { success = false, msg = "Wrong username or password.", errorcode = 1 }, JsonRequestBehavior.AllowGet); } }
public void Update(User user) { db.Update(user); }