Пример #1
0
        public ActionResult SWISetUserProfile(string culture, string defaultView)
        {
            writeDebug("SWISetUserProfile");
            try
            {
                checkSWIAuthentication();
                if (string.IsNullOrEmpty(culture))
                {
                    throw new Exception("Error: culture must be supplied");
                }
                if (culture != Repository.CultureInfo.EnglishName)
                {
                    if (!Repository.SetCultureInfo(culture))
                    {
                        throw new Exception("Invalid culture name:" + culture);
                    }
                    WebUser.ClearCache();
                    setCookie(SealCultureCookieName, culture);
                }

                if (!string.IsNullOrEmpty(defaultView))
                {
                    setCookie(SealLastViewCookieName, defaultView);
                }

                return(Json(new { }));
            }
            catch (Exception ex)
            {
                return(HandleSWIException(ex));
            }
        }