示例#1
0
 public User CreateAccount(User model)
 {
     model.GroupID = 3;
     model.Password = HashPassword(model.Password);
     db.Insert(model);
     return model;
 }
示例#2
0
        public JsonResult CheckoutAsGest(User user)
        {
            try
            {

                Session["CheckoutGest"] = user;

                return Json(new { success = true });
            }
            catch
            {
                return Json(new { success = false });
            }
        }
示例#3
0
 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;
         }
 }
示例#4
0
 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);
     }
 }
示例#5
0
 public void Update(User user)
 {
     db.Update(user);
 }