public void SaveData() { tblImageCategories cat = new tblImageCategories(); if (Request["catid"] != null) { cat.LoadByPrimaryKey(Convert.ToInt32(Request["catid"])); } else { cat.AddNew(); } cat.ImageCategoryTitle = TextBox1.Text; if (trLang.Visible) { cat.LanguageId = Convert.ToInt32(ddLanguages.SelectedItem.Value); } else { tblLanguages lang = new tblLanguages(); lang.LoadAll(); cat.LanguageId = lang.LanguageId; } cat.Save(); }
private void createLanguageDD() { int selLang = -1; if (Request["catid"] != null) { tblImageCategories cat = new tblImageCategories(); cat.LoadByPrimaryKey(Convert.ToInt32(Request["catid"])); selLang = cat.LanguageId; } tblLanguages lang = new tblLanguages(); lang.LoadAll(); do { ddLanguages.Items.Add(new ListItem(lang.LanguageTitle, lang.LanguageId.ToString())); if (selLang == lang.LanguageId) { ddLanguages.Items[ddLanguages.Items.Count - 1].Selected = true; } } while (lang.MoveNext()); if (ddLanguages.Items.Count == 1) { trLang.Visible = false; } }
private void createLanguageDD() { int selLang = -1; if (Request["catid"] != null) { tblImageCategories cat = new tblImageCategories(); cat.LoadByPrimaryKey(Convert.ToInt32(Request["catid"])); selLang = cat.LanguageId; } tblLanguages lang = new tblLanguages(); lang.LoadAll(); do { ddLanguages.Items.Add(new ListItem(lang.LanguageTitle, lang.LanguageId.ToString())); if (selLang == lang.LanguageId) ddLanguages.Items[ddLanguages.Items.Count - 1].Selected = true; } while (lang.MoveNext()); if (ddLanguages.Items.Count == 1) trLang.Visible = false; }
private void getLang() { tblLanguages lang = new tblLanguages(); lang.LoadAll(); do { ListItem li = new ListItem(lang.LanguageTitle, lang.LanguageId.ToString()); DropDownList1.Items.Add(li); } while (lang.MoveNext()); if (DropDownList1.Items.Count == 0) DropDownList1.Visible = false; }
private void getLang() { tblLanguages lang = new tblLanguages(); lang.LoadAll(); do { ListItem li = new ListItem(lang.LanguageTitle, lang.LanguageId.ToString()); DropDownList1.Items.Add(li); } while (lang.MoveNext()); if (DropDownList1.Items.Count == 0) { DropDownList1.Visible = false; } }
public void SaveData() { tblImageCategories cat = new tblImageCategories(); if (Request["catid"] != null) cat.LoadByPrimaryKey(Convert.ToInt32(Request["catid"])); else cat.AddNew(); cat.ImageCategoryTitle = TextBox1.Text; if (trLang.Visible) cat.LanguageId = Convert.ToInt32(ddLanguages.SelectedItem.Value); else { tblLanguages lang = new tblLanguages(); lang.LoadAll(); cat.LanguageId = lang.LanguageId; } cat.Save(); }