private void mSaveSubjectPlugin() { int pluginID = Convert.ToInt32(ddlPlugins.SelectedValue); GalleryPlugins galleryPlugin = new GalleryPlugins(pSubjectID, pluginID); if (galleryPlugin.RowCount > 0) { // in Edit Mode, so do nothing. } else { mDeleteSubjectPlugin(); galleryPlugin.AddNew(); galleryPlugin.pIDSubject = pSubjectID; galleryPlugin.pIDPlugin = pluginID; } galleryPlugin.pGenerateTitle = cbxGenerateTitle.Checked; galleryPlugin.pGenerateDesc = cbxGenerateDescription.Checked; galleryPlugin.pGenerateAnchor = cbxGenerateAnchor.Checked; galleryPlugin.pGenerateDate = cbxGenerateDate.Checked; galleryPlugin.pDateFormat = txtDateFormat.Text; galleryPlugin.pOptions = txtOptions.Text; galleryPlugin.pCSS = txtCSS.Text; galleryPlugin.Save(); }
private void mDeleteSubjectPlugin() { GalleryPlugins galleryPlugin = new GalleryPlugins(); galleryPlugin.LoadByIDSubject(pSubjectID); galleryPlugin.MarkAsDeleted(false); galleryPlugin.Save(); }
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); }
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); } }