コード例 #1
0
        public ActionResult updateUserDetails(string firstName,
                                              string lastName,
                                              string nickName,
                                              string dateOfBirth)
        {
            int valid = 1;
            var Jcon  = new JsonContainer();
            var objUserAccountHelper = new UserAccountHelper();

            DateTime date;

            if (!DateTime.TryParse(dateOfBirth, out date))
            {
                Jcon.Result = 0;
                return(Json(Jcon));
            }

            var userDetails = new UserAccount
            {
                userId      = long.Parse(Session["userId"].ToString()),
                firstName   = firstName,
                lastName    = lastName,
                nickName    = nickName,
                dateOfBirth = date
            };

            try
            {
                objUserAccountHelper.UpdateUserDetails(userDetails);
            }
            catch (Exception ex)
            {
                valid = 0;
            }

            Jcon.Result = valid;
            return(Json(Jcon));
        }