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 loadData() { tblImageCategories cat = new tblImageCategories(); cat.LoadByPrimaryKey(Convert.ToInt32(Request["catid"])); TextBox1.Text = cat.ImageCategoryTitle; }
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(); }