//[HttpPost] //public ActionResult Index(ResourceViewModel model) //{ // var changes = model.ResourceModels.SelectMany(m => m.Resources.Where(r => r.IsChange)).ToList(); // var langs = changes.Select(m => m.LanguageCode).Distinct(); // foreach (var lang in langs) // { // var path1 = ""; // var path2 = ""; // if (lang.ToLower().Contains("en")) // { // path1 = Server.MapPath("~/App_GlobalResources/MenuResource.resx"); // path2 = Server.MapPath("~/App_GlobalResources/Resource.resx"); // } // else // { // path1 = Server.MapPath("~/App_GlobalResources/MenuResource." + lang + ".resx"); // path2 = Server.MapPath("~/App_GlobalResources/Resource." + lang + ".resx"); // } // model.EditAnyResourceByLanguage(changes.Where(m => m.LanguageCode == lang), path1, path2); // } // model.Prepare(); // return View(model); //} public JsonResult EditResource(string[] langs, string code) { var languages = _unitRepository.GetAllLanguages().ToList(); var model = new ResourceModel(); for (int i = 0; i < languages.Count(); i++) { if (!string.IsNullOrEmpty(langs[i])) { var path1 = ""; var path2 = ""; if (languages[i].Value.ToLower().Contains("en")) { path1 = Server.MapPath("~/App_GlobalResources/MenuResource.resx"); path2 = Server.MapPath("~/App_GlobalResources/Resource.resx"); } else { path1 = Server.MapPath("~/App_GlobalResources/MenuResource." + languages[i].Value + ".resx"); path2 = Server.MapPath("~/App_GlobalResources/Resource." + languages[i].Value + ".resx"); } model.EditOneResource(langs[i], code, path1, path2); } } return(Json(Resource.UpdateSuccessful)); }