Example #1
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();
    }
Example #2
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);
    }
Example #3
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);
        }
    }
Example #4
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();
        }
    }