Пример #1
0
        public ActionResult GetDataforLanguageID(string LanguageID)
        {
            string msg      = "";
            var    listData = _LanguageFactory.GetLanguageDataToTranslateForLogin(LanguageID);

            if (listData != null)
            {
                string Password   = "";
                string LoginBelow = "";
                string Email      = "";
                string Remember   = "";
                string Version    = "";
                string LoginAbove = "";
                foreach (var item in listData)
                {
                    if (item.LanguageLinkName == "Password")
                    {
                        Password = item.Text;
                    }
                    if (item.LanguageLinkName == "Log in")
                    {
                        LoginBelow = item.Text;
                    }
                    if (item.LanguageLinkName == "Email")
                    {
                        Email = item.Text;
                    }
                    if (item.LanguageLinkName == "Remember me")
                    {
                        Remember = item.Text;
                    }
                    if (item.LanguageLinkName == "Version")
                    {
                        Version = item.Text;
                    }
                    if (item.LanguageLinkName == "Login")
                    {
                        LoginAbove = item.Text;
                    }
                }

                string str = "{'Password':'******', 'LoginBelow':'" + LoginBelow + "', 'Email':'" + Email + "', 'Remember':'" + Remember + "', 'Version':'" + Version + "', 'LoginAbove':'" + LoginAbove + "'}";
                JavaScriptSerializer jsSer = new JavaScriptSerializer();
                object obj = jsSer.Deserialize(str, typeof(object));
                return(Json(obj, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(new HttpStatusCodeResult(400, msg));
            }
        }