| | |
| | | public DataSet ds = new DataSet(); |
| | | public WebServer webserver = new WebServer(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | |
| | | grdAlignment omdelMian = new grdAlignment(); |
| | | List<grdAlignmentSub> omdelsub = new List<grdAlignmentSub>(); |
| | |
| | | { "zh-Hans", "HFieldName"}, |
| | | { "zh-Hant", "HFieldName"}, |
| | | { "en", "HTranslationText_English"}, |
| | | { "es", "HTranslationText_Spain"} |
| | | { "es", "HTranslationText_Spain"}, |
| | | { "Thai", "HTranslationText_Thai"} |
| | | }; |
| | | |
| | | /// <summary> |
| | |
| | | [HttpGet] |
| | | public object SelectMESLanguage_JSON(string language, bool forceUpdate) |
| | | { |
| | | |
| | | try |
| | | { |
| | | // 判断是否启用多语言配置 |
| | | string enableRemote = oSystemParameter.GetSingleSystemParameter("Xt_grdAlignment_WMES_RemoteTransFileCTL", ref DBUtility.ClsPub.sErrInfo); |
| | | if (enableRemote == "N") |
| | | { |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Success!"; |
| | | objJsonResult.data = null; |
| | | var objJObj = JObject.FromObject(objJsonResult); |
| | | objJObj["EnableRemoteI18n"] = enableRemote; |
| | | return objJObj; |
| | | } |
| | | |
| | | // 获取项目根目录 |
| | | string path = HttpContext.Current.Server.MapPath($"~/LanguagePack"); ; |
| | | string lang; |
| | |
| | | language = "zh-Hans"; |
| | | lang = "HFieldName"; |
| | | } |
| | | ds = oCN.RunProcReturn("select * from h_v_Xt_LanModuleList where 1=1", "h_v_Xt_LanModuleList"); |
| | | ds = oCN.RunProcReturn("select * from h_v_Xt_LanModuleList where 1=1 order by HUpdateDate desc", "h_v_Xt_LanModuleList"); |
| | | |
| | | // 如果目录不存在则创建目录 |
| | | if (!Directory.Exists(path)) |
| | |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Success!"; |
| | | objJsonResult.data = languagePack; |
| | | return objJsonResult; |
| | | var objJObj = JObject.FromObject(objJsonResult); |
| | | objJObj["EnableRemoteI18n"] = enableRemote; |
| | | return objJObj; |
| | | } else |
| | | { |
| | | // 版本号一致, 则直接返回读取的Json字符串 |
| | |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Success!"; |
| | | objJsonResult.data = JObject.Parse(JsonStr1); |
| | | return objJsonResult; |
| | | var objJObj = JObject.FromObject(objJsonResult); |
| | | objJObj["EnableRemoteI18n"] = enableRemote; |
| | | return objJObj; |
| | | } |
| | | } |
| | | catch(Exception e) |
| | |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | var objJObj = JObject.FromObject(objJsonResult); |
| | | objJObj["EnableRemoteI18n"] = "N"; |
| | | return objJObj; |
| | | } |
| | | } |
| | | #endregion |