コード例 #1
0
        public ActionResult UserProfile(ProfileEditViewModel model)
        {
            if (ModelState.IsValid)
            {
                ObjectParameter output = new ObjectParameter("responseMessage", typeof(string));
                db.PR_UpdateUser(model.profileData.IdCard, model.profileData.Username, model.profileData.FirstName,
                                 model.profileData.MiddleName, model.profileData.LastName, model.profileData.SecondLastName, output);

                if (output.Value.Equals("Success"))
                {
                    TempData["Success"] = "Good.";
                }
                else
                {
                    ModelState.AddModelError("", output.Value.ToString());
                }

                return(View("UserProfile", model));
            }
            return(View("UserProfile", model));
        }