Пример #1
0
        public JsonResult SaveNewPassword(string Password, string newpassword)
        {
            var    currentuser = userBo.GetById(USERNUMBER);
            string success     = "";

            if (currentuser.Password.ToUpper() == Password.ToUpper())
            {
                currentuser.Password = newpassword;
                userBo.Add(currentuser);
            }
            else
            {
                success = "Old Password Is Incorrect";
            }
            return(Json(new { success }));
            // return RedirectToAction("Login");
        }
Пример #2
0
        public ServiceResult <Core.Model.User> AddUser(Core.Model.User user)
        {
            ServiceResult <Core.Model.User> result = new ServiceResult <Core.Model.User>();

            try
            {
                _userBO.Add(user);

                var _address = user.Addresses.FirstOrDefault();
                _address.UserId = user.Id;

                _addressBO.Add(_address);

                result.Data = user;
            }
            catch (Exception ex)
            {
                result.HasError     = true;
                result.ErrorMessage = ex.Message;
            }

            return(result);
        }