Example #1
0
    private void LoadMasterPage(string id)
    {
        try
        {
            int mpId = Convert.ToInt32(id);

            db_config_master_page dcm = new db_config_master_page();
            dcm.Open();

            MasterPage mp = dcm.Get(mpId);

            mp_id.Value = mp.ID.ToString(CultureInfo.InvariantCulture);
            mp_title.Value = mp.Title;
            mp_desc.InnerText = mp.Description;
            mp_options.InnerText = mp.Options;

            SetPageTitle(mp.Title);

            dcm.Close();
        }
        catch (Exception ex)
        {
            Generic.JavaScriptInjector("alert('" + ex.Message + "');");
        }
    }
Example #2
0
    /// <summary>
    /// Save current master page that user is editing
    /// </summary>
    private static void SaveMasterPage(int id, string title, string desc, string options)
    {
        try
        {
            db_config_master_page dcm = new db_config_master_page();
            dcm.Open();

            MasterPage mp = id >= 0
                            ? dcm.Get(id)
                            : new MasterPage();

            mp.Title = title;
            mp.Description = desc;
            mp.Options = options;

            if (id >= 0)
                dcm.Commit();
            else
                dcm.Add(mp);

            dcm.Close();

            Generic.ParentJavascriptMethodInjector("RefreshTree()");
        }
        catch (Exception ex)
        {
            Generic.JavaScriptInjector("alert('" + ex.Message + "');");
        }
    }