예제 #1
0
    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();
    }
예제 #2
0
    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;
        }
    }
예제 #3
0
    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;
    }
예제 #4
0
    private void loadData()
    {
        tblImageCategories cat = new tblImageCategories();

        cat.LoadByPrimaryKey(Convert.ToInt32(Request["catid"]));

        TextBox1.Text = cat.ImageCategoryTitle;
    }
예제 #5
0
    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();
    }
예제 #6
0
    private void loadData()
    {
        tblImageCategories cat = new tblImageCategories();
        cat.LoadByPrimaryKey(Convert.ToInt32(Request["catid"]));

        TextBox1.Text = cat.ImageCategoryTitle;
    }