示例#1
0
        public IActionResult Change(string userName, string oldPassword, string newPassword, string firstName, string lastName, int age, string contact)
        {
            bool isSuccessful = false;

            isSuccessful = service.ChangeVolunteer(userName, oldPassword, newPassword, firstName, lastName, age, contact);
            if (isSuccessful)
            {
                return(RedirectToAction("SuccessfulAction", "Volunteer"));
            }
            else
            {
                return(RedirectToAction("Profile", "Volunteer", new VolunteerProfileViewModel()
                {
                    Username = userName, FirstName = firstName, LastName = lastName,
                    Age = age, Contact = contact
                }));
            }
        }
示例#2
0
        public ActionResult <VolunteerUpdateResModel> Manage_VolunteerInfoSetValues(VolunteerInfoUpdateViewModel updateViewModel)
        {
            VolunteerUpdateResModel returnModel = new VolunteerUpdateResModel();
            int result = _volunteerService.ChangeVolunteer(updateViewModel);

            if (result > 0)
            {
                returnModel.IsSuccess                  = true;
                returnModel.ResultCount                = result;
                returnModel.baseViewModel.Message      = "志愿者信息更新完成";
                returnModel.baseViewModel.ResponseCode = 200;
                //_ILogger.Information("志愿者信息更新完成");
                return(Ok(returnModel));
            }
            else
            {
                returnModel.IsSuccess                  = false;
                returnModel.ResultCount                = 0;
                returnModel.baseViewModel.Message      = "志愿者信息更新失败";
                returnModel.baseViewModel.ResponseCode = 400;
                //_ILogger.Information("志愿者信息更新失败");
                return(BadRequest(returnModel));
            }
        }