Esempio n. 1
0
    public string mGenerateImageInfo(string filename, string description, DateTime date)
    {
        GalleryPlugins galleryPlugin = new GalleryPlugins();

        galleryPlugin.LoadByIDSubject(Subject.pIDSubject);

        StringBuilder sb = new StringBuilder();

        if (galleryPlugin.pGenerateTitle || galleryPlugin.pGenerateDesc || galleryPlugin.pGenerateDate)
        {
            sb.Append("<div>");
            sb.Append("<h1>");

            if (galleryPlugin.pGenerateTitle)
            {
                sb.Append(filename + "<br>");
            }
            if (galleryPlugin.pGenerateDate)
            {
                sb.Append(date.Year.ToString() + "<br>");
            }
            if (galleryPlugin.pGenerateDesc)
            {
                sb.Append(description);
            }

            sb.Append("</h1>");
            sb.Append("</div>");
        }

        return(sb.ToString());
    }
Esempio n. 2
0
    private void mDeleteSubjectPlugin()
    {
        GalleryPlugins galleryPlugin = new GalleryPlugins();

        galleryPlugin.LoadByIDSubject(pSubjectID);
        galleryPlugin.MarkAsDeleted(false);
        galleryPlugin.Save();
    }
Esempio n. 3
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. 4
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. 5
0
 private void mSetGalleryScript()
 {
     if (Subject != null && Subject.pBannerType == Subjects.BannerTypes.gallery.ToString())
     {
         GalleryPlugins galleryPlugin = new GalleryPlugins();
         galleryPlugin.LoadByIDSubject(Subject.pIDSubject);
         if (galleryPlugin.RowCount > 0)
         {
             //Javascript
             ScriptManager.RegisterClientScriptInclude(this.Page, this.GetType(), galleryPlugin.Plugins.pJSfileName, string.Format("{0}{1}", Global.Constants.FOLDER_PLUGINS.Substring(1), galleryPlugin.Plugins.pJSfileName));
             ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), galleryPlugin.Plugins.pName, galleryPlugin.Plugins.pJSinit.Replace("#options#", galleryPlugin.pOptions), true);
             //Cascade Style Sheet
             StringBuilder sb = new StringBuilder();
             sb.Append("<style type='text/css' rel='stylesheet'>");
             sb.Append(galleryPlugin.pCSS);
             sb.Append("</style>");
             //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), galleryPlugin.Plugins.pName + "CSS", sb.ToString(), false);
             litCSS.Text = sb.ToString();
         }
     }
 }
Esempio n. 6
0
    private void mBindings()
    {
        Subjects.BannerTypes headerTypes = (Subjects.BannerTypes)Enum.Parse(typeof(Subjects.BannerTypes), rblTypes.SelectedValue);
        switch (headerTypes)
        {
        case Subjects.BannerTypes.inActive:
        {
            trInActive.Visible = true;
            trPicture.Visible  = false;
            trGallery.Visible  = false;
            btnSave.Visible    = true;
            break;
        }

        case Subjects.BannerTypes.picture:
        {
            trInActive.Visible = false;
            trPicture.Visible  = true;
            trGallery.Visible  = false;
            btnSave.Visible    = false;
            mLoadMedias();
            mReloadImagePath();
            break;
        }

        case Subjects.BannerTypes.gallery:
        {
            trInActive.Visible = false;
            trPicture.Visible  = false;
            trGallery.Visible  = true;
            btnSave.Visible    = true;

            BLL.Hardcodes.Tables tables = new BLL.Hardcodes.Tables();
            ddlGalleryType.Items.Clear();
            ddlGalleryType.DataSource     = tables.GalleryTypes;
            ddlGalleryType.DataTextField  = BLL.Hardcodes.Item.FIELD_Title;
            ddlGalleryType.DataValueField = BLL.Hardcodes.Item.FIELD_ID;
            ddlGalleryType.DataBind();
            mDDLGalleryBinding(null);

            Plugins plugins = new Plugins();
            plugins.LoadAll();
            ddlPlugins.DataSource     = plugins.DefaultView;
            ddlPlugins.DataTextField  = Plugins.ColumnNames.Name;
            ddlPlugins.DataValueField = Plugins.ColumnNames.IDPlugin;
            ddlPlugins.DataBind();
            if (plugins.RowCount > 0)
            {
                GalleryPlugins galleryPlugin = new GalleryPlugins();
                galleryPlugin.LoadByIDSubject(pSubjectID);
                if (galleryPlugin.RowCount > 0)
                {
                    ddlPlugins.SelectedValue = galleryPlugin.pIDPlugin.ToString();
                    mFillPluginFields(galleryPlugin.pIDPlugin);
                }
                else
                {
                    mFillPluginFields(plugins.pIDPlugin);
                }
            }
            break;
        }
        }
    }