protected void BindAvailableLocales() { this.ddlAvailableLocales.DataSource = LocalizationSqlDataProvider.GetAvailableLocales(); this.ddlAvailableLocales.DataTextField = "LanguageName"; this.ddlAvailableLocales.DataValueField = "LanguageCode"; this.ddlAvailableLocales.DataBind(); }
public void BindLanguageList() { try { string mode = languageMode == "Native" ? "NativeName" : "LanguageName"; List <Language> lstAllCultures = LocaleController.GetCultures(); List <Language> lstAvailableLocales = LocalizationSqlDataProvider.GetAvailableLocales(); List <Language> filterLocales = FilterLocales(lstAllCultures, lstAvailableLocales); ddlLanuage.DataSource = filterLocales; // .OrderBy(item => mode); //ddlLanuage.DataTextField = mode; //ddlLanuage.DataValueField = "LanguageCode"; ddlLanuage.DataBind(); //List<ListItem> listCopy = new List<ListItem>(); //foreach (ListItem item in ddlLanuage.Items) // listCopy.Add(item); //ddlLanuage.Items.Clear(); //foreach (ListItem item in listCopy.OrderBy(item => item.Text)) // ddlLanuage.Items.Add(item); } catch (Exception ex) { ProcessException(ex); } }
protected void BindAvailableLocales() { this.ddlAvailableLocales.DataSource = LocalizationSqlDataProvider.GetAvailableLocales(); this.ddlAvailableLocales.DataTextField = "LanguageName"; this.ddlAvailableLocales.DataValueField = "LanguageCode"; this.ddlAvailableLocales.DataBind(); ddlAvailableLocales.SelectedIndex = ddlAvailableLocales.Items.IndexOf(ddlAvailableLocales.Items.FindByValue(GetCurrentCulture())); }
public void CheckAndAddLanguageToDatabase() { List <Language> lstAvailableLocales = LocalizationSqlDataProvider.GetAvailableLocales(); List <Language> lstAllLocales = LocaleController.GetCultures(); int index = lstAvailableLocales.FindIndex(delegate(Language obj){ return(obj.LanguageCode == GetLocaleFromZipFileName()); }); if (index < 0) { int localeIndex = lstAllLocales.FindIndex(delegate(Language obj) { return(obj.LanguageCode == GetLocaleFromZipFileName()); }); AddToDataBase(lstAllLocales[localeIndex]); } }
public void BindLanguageList() { try { string mode = languageMode == "Native" ? "NativeName" : "LanguageName"; List <Language> lstAllCultures = LocaleController.GetCultures(); List <Language> lstAvailableLocales = LocalizationSqlDataProvider.GetAvailableLocales(); List <Language> filterLocales = FilterLocales(lstAllCultures, lstAvailableLocales); ddlLanuage.DataSource = filterLocales; ddlLanuage.DataBind(); ddlLanuage.SelectedValue = GetCurrentCulture(); } catch (Exception ex) { ProcessException(ex); } }
public void GetLocale() { List <string> localeList = new List <string>(); localeList = GetLocaleList("~/Modules", ".resx", localeList); localeList = GetLocaleList("~/Modules", ".js", localeList); localeList = GetLocaleList("~/Modules", ".xml", localeList); localeList = GetLocaleList("~/XMLMessage", ".xml", localeList); localeList = GetLocaleList("~/Sagin", ".resx", localeList); localeList = GetLocaleList("~/Controls", ".resx", localeList); localeList = GetLocaleList("~/js/SystemLocale", ".js", localeList); List <string> localeListWihoutDuplicates = localeList.Distinct().ToList(); List <Language> lstAllCultures = LocaleController.GetCultures(); List <Language> lstNewCulture = new List <Language>(); foreach (string locale in localeListWihoutDuplicates) { int index = lstAllCultures.FindIndex(delegate(Language obj) { return(obj.LanguageCode == locale); }); if (index > -1) { lstNewCulture.Add(lstAllCultures[index]); } } List <Language> lstAvailableLocales = LocaleController.AddNativeNamesToList(LocalizationSqlDataProvider.GetAvailableLocales()); ddlResourceLocale.DataSource = lstAvailableLocales; ddlResourceLocale.DataTextField = "LanguageName"; ddlResourceLocale.DataValueField = "LanguageCode"; ddlResourceLocale.DataBind(); List <ListItem> listCopy = new List <ListItem>(); foreach (ListItem item in ddlResourceLocale.Items) { listCopy.Add(item); } ddlResourceLocale.Items.Clear(); foreach (ListItem item in listCopy.OrderBy(item => item.Text)) { ddlResourceLocale.Items.Add(item); } }
protected void UpdateLocalizeMenuFields() { Modules_LocalPage_LocalPage localPage = (Modules_LocalPage_LocalPage)this.Parent.FindControl("ctrl_MenuEditor"); DropDownList ddlAvailableLocales = (DropDownList)localPage.FindControl("ddlAvailableLocales"); ddlAvailableLocales.DataSource = LocalizationSqlDataProvider.GetAvailableLocales(); ddlAvailableLocales.DataTextField = "LanguageName"; ddlAvailableLocales.DataValueField = "LanguageCode"; ddlAvailableLocales.DataBind(); List <ListItem> listCopy = new List <ListItem>(); foreach (ListItem item in ddlAvailableLocales.Items) { listCopy.Add(item); } ddlAvailableLocales.Items.Clear(); foreach (ListItem item in listCopy.OrderBy(item => item.Text)) { ddlAvailableLocales.Items.Add(item); } }
public void LoadAllCulturesDropDown(DropDownList ddl) { string mode = languageMode == "Native" ? "NativeName" : "LanguageName"; // List<Language> lstAllCultures = LocaleController.GetCultures(); List <Language> lstAvailableLocales = LocalizationSqlDataProvider.GetAvailableLocales(); ddl.DataSource = lstAvailableLocales; ddl.DataTextField = mode; ddl.DataValueField = "LanguageCode"; ddl.DataBind(); List <ListItem> listCopy = new List <ListItem>(); foreach (ListItem item in ddl.Items) { listCopy.Add(item); } ddl.Items.Clear(); foreach (ListItem item in listCopy.OrderBy(item => item.Text)) { ddl.Items.Add(item); } }
public void BindLanguageList() { List <Language> lstAvailableLocales = LocaleController.AddNativeNamesToList(LocalizationSqlDataProvider.GetAvailableLocales()); ddlLanuage.DataSource = lstAvailableLocales; ddlLanuage.DataBind(); ddlLanuage.SelectedValue = GetCurrentCulture(); }
public void GetLanguageList() { string mode = languageMode == "Native" ? "NativeName" : "LanguageName"; List <Language> lstAvailableLocales = LocaleController.AddNativeNamesToList(LocalizationSqlDataProvider.GetAvailableLocales()); ddlDefaultLanguage.DataSource = lstAvailableLocales; ddlDefaultLanguage.DataTextField = mode; ddlDefaultLanguage.DataValueField = "LanguageCode"; ddlDefaultLanguage.DataBind(); ddlDefaultLanguage.SelectedIndex = ddlDefaultLanguage.Items.IndexOf(ddlDefaultLanguage.Items.FindByValue(ViewState["SelectedLanguageCulture"].ToString())); ViewState["RowCount"] = lstAvailableLocales.Count; }
public void GetUserDetails() { try { UserProfileInfo objinfo = new UserProfileInfo(); objinfo = UserProfileController.GetProfile(GetUsername, GetPortalID); string UserImage = Server.MapPath("~/Modules/Admin/UserManagement/UserPic/"); if (!Directory.Exists(UserImage)) { Directory.CreateDirectory(UserImage); } if (objinfo != null) { string[] Emails = objinfo.Email.Split(','); if (objinfo.Image != "") { imgUser.ImageUrl = "~/Modules/Admin/UserManagement/UserPic/" + objinfo.Image; } else { imgUser.ImageUrl = "~/Modules/Admin/UserManagement/UserPic/NoImage.png"; } imgUser.Visible = true; imgProfileEdit.Visible = true; Session[SessionKeys.SageFrame_UserProfilePic] = objinfo.Image; //else //{ // imgUser.Visible = false; // imgProfileEdit.Visible = false; //} string mode = "LanguageName";// "NativeName" : "LanguageName"; List <Language> lstAllCultures = LocaleController.GetCultures(); List <Language> lstAvailableLocales = LocalizationSqlDataProvider.GetAvailableLocales(); lblDisplayUserName.Text = objinfo.UserName; txtFName.Text = objinfo.FirstName; txtLName.Text = objinfo.LastName; txtFullName.Text = objinfo.FullName; txtLocation.Text = objinfo.Location; txtAboutYou.Text = objinfo.AboutYou; txtEmail1.Text = Emails[0]; txtBirthDate.Text = (objinfo.BirthDate.ToShortDateString() == falseDate || objinfo.BirthDate.ToShortDateString() == defaultDate) ? "" : objinfo.BirthDate.ToShortDateString(); rdbGender.SelectedIndex = objinfo.Gender; if (Emails.Length == 3) { //txtEmail2.Text = Emails[1]; } if (Emails.Length == 4) { //txtEmail2.Text = Emails[1]; //txtEmail3.Text = Emails[2]; } txtResPhone.Text = objinfo.ResPhone; txtMobile.Text = objinfo.Mobile != string.Empty ? objinfo.Mobile : txtMobile.Text = string.Empty; //txtMobile.Text = objinfo.Mobile; txtOthers.Text = objinfo.Others; } } catch (Exception) { throw; } }