Esempio n. 1
0
    private void mSetGalleryScript(SubjectPlugins subjectPlugins)
    {
        //Javascript

        //Cascade Style Sheet
        //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), galleryPlugin.Plugins.pName + "CSS", sb.ToString(), false);
    }
Esempio n. 2
0
    private bool mValidateDelete(int iDPlugin)
    {
        pMessage.Clear();
        bool           isValid        = true;
        SubjectPlugins subjectPlugins = new SubjectPlugins();

        subjectPlugins.LoadByIDPlugin(iDPlugin);
        GalleryPlugins galleryPlugins = new GalleryPlugins();

        galleryPlugins.LoadByIDPlugin(iDPlugin);
        if (subjectPlugins.RowCount > 0)
        {
            isValid = false;
            pMessage.Add(Farschidus.Translator.AppTranslate["pluginsManaging.default.message.subjectPluginsRelation"], Farschidus.Web.UI.Message.MessageTypes.Warning);
            do
            {
                pMessage.Add(subjectPlugins.Subjects.pTitle, Farschidus.Web.UI.Message.MessageTypes.Information);
            }while (subjectPlugins.MoveNext());
        }
        if (galleryPlugins.RowCount > 0)
        {
            isValid = false;
            pMessage.Add(Farschidus.Translator.AppTranslate["pluginsManaging.default.message.galleryPluginsRelation"], Farschidus.Web.UI.Message.MessageTypes.Warning);
            do
            {
                pMessage.Add(galleryPlugins.Subjects.pTitle, Farschidus.Web.UI.Message.MessageTypes.Information);
            }while (galleryPlugins.MoveNext());
        }
        return(isValid);
    }
Esempio n. 3
0
    private void mRenderScripts(Guid homeID)
    {
        StringBuilder  sb             = new StringBuilder();
        SubjectPlugins subjectPlugins = new SubjectPlugins();

        subjectPlugins.LoadByIDSubject(homeID);

        if (subjectPlugins.RowCount > 0)
        {
            do
            {
                sb.AppendFormat(@"<script src=""{0}{1}""></script>", Global.Constants.FOLDER_PLUGINS.Substring(1), subjectPlugins.Plugins.pJSfileName);
            }while (subjectPlugins.MoveNext());
        }
        litScripts.Text = sb.ToString();
    }
Esempio n. 4
0
    private void mDelete(Guid iDSubject, bool loadList = true)
    {
        if (mValidateDelete(iDSubject))
        {
            DAL.GlobalCore.TransactionMgr tx = DAL.GlobalCore.TransactionMgr.ThreadTransactionMgr();
            try
            {
                tx.BeginTransaction();
                MediaSubjects mediaSubjects = new MediaSubjects();
                mediaSubjects.LoadByIDSubject(iDSubject);
                mediaSubjects.DeleteAll();
                mediaSubjects.Save();

                SubjectPlugins subjectPlugin = new SubjectPlugins();
                subjectPlugin.LoadByIDSubject(iDSubject);
                subjectPlugin.DeleteAll();
                subjectPlugin.Save();

                GalleryPlugins GalleryPlugins = new GalleryPlugins();
                GalleryPlugins.LoadByIDSubject(iDSubject);
                GalleryPlugins.DeleteAll();
                GalleryPlugins.Save();


                Subjects subject = new Subjects(iDSubject);
                subject.MarkAsDeleted(false);
                subject.Save();

                tx.CommitTransaction();
                if (loadList)
                {
                    pMessage.Clear();
                    pMessage.Add(Farschidus.Translator.AppTranslate["general.message.deleted"], Farschidus.Web.UI.Message.MessageTypes.Success);
                    mShowMessage(pMessage);

                    mLoadList();
                }
            }
            catch (Exception ex)
            {
                tx.RollbackTransaction();
                pMessage.Clear();
                pMessage.Add(ex.Message, Farschidus.Web.UI.Message.MessageTypes.Error);
            }
        }
        mShowMessage(pMessage);
    }
Esempio n. 5
0
    private void mDelete(Guid iDUser)
    {
        DAL.GlobalCore.TransactionMgr tx = DAL.GlobalCore.TransactionMgr.ThreadTransactionMgr();
        try
        {
            Subjects subjects = new Subjects();
            subjects.LoadBySubjectAliasAndIDSubjectType(pIDUser.Value.ToString(), (byte)SubjectTypes.Enum.userPage);
            if (subjects.RowCount > 0)
            {
                tx.BeginTransaction();
                MediaSubjects mediaSubjects = new MediaSubjects();
                mediaSubjects.LoadByIDSubject(subjects.pIDSubject);
                mediaSubjects.DeleteAll();
                mediaSubjects.Save();

                SubjectPlugins subjectPlugin = new SubjectPlugins();
                subjectPlugin.LoadByIDSubject(subjects.pIDSubject);
                subjectPlugin.DeleteAll();
                subjectPlugin.Save();

                GalleryPlugins GalleryPlugins = new GalleryPlugins();
                GalleryPlugins.LoadByIDSubject(subjects.pIDSubject);
                GalleryPlugins.DeleteAll();
                GalleryPlugins.Save();

                Subjects subject = new Subjects(subjects.pIDSubject);
                subject.MarkAsDeleted(false);
                subject.Save();

                tx.CommitTransaction();
                pMessage.Clear();
                pMessage.Add(Farschidus.Translator.AppTranslate["general.message.deleted"], Farschidus.Web.UI.Message.MessageTypes.Success);
                mShowMessage(pMessage);

                mLoadList();
            }
        }
        catch (Exception ex)
        {
            tx.RollbackTransaction();
            pMessage.Clear();
            pMessage.Add(ex.Message, Farschidus.Web.UI.Message.MessageTypes.Error);
            mShowMessage(pMessage);
        }
    }
Esempio n. 6
0
    private void mInitializing(Guid SubjectID)
    {
        SubjectPlugins subjectPlugins = new SubjectPlugins();

        subjectPlugins.LoadByIDSubject(SubjectID);
        if (subjectPlugins.RowCount > 0)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("<style type='text/css' rel='stylesheet'>");
            do
            {
                ScriptManager.RegisterClientScriptInclude(this.Page, this.GetType(), subjectPlugins.Plugins.pJSfileName, string.Format("{0}{1}", Global.Constants.FOLDER_PLUGINS.Substring(1), subjectPlugins.Plugins.pJSfileName));
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), subjectPlugins.Plugins.pName, subjectPlugins.Plugins.pJSinit.Replace("#options#", subjectPlugins.pOptions), true);
                sb.Append(subjectPlugins.pCSS);
            }while (subjectPlugins.MoveNext());
            sb.Append("</style>");
            litCSS.Text = sb.ToString();

            uplPlugins.Update();
        }
    }