private void Save(Models.Event record, bool isNew)
 {
     // add any code to update other fields/tables here
     record.Save();
     // save subform or related checkboxes here eg record.Lines.Save();
     //ifsubform: record.example.Save();
     //CheckLock(record);
     //lockobj.UnLockTable(record.GetTableName(),record.ID);
     ActiveRecordLoader.ClearCache("Event");
 }
Exemple #2
0
 private void Save(Models.FAQSection record, bool isNew)
 {
     // add any code to update other fields/tables here
     record.Save();
     // save subform or related checkboxes here eg record.Lines.Save();
     record.FAQItems.Save();
     CheckLock(record);
     lockobj.UnLockTable(record.GetTableName(), record.ID);
     ActiveRecordLoader.ClearCache("FAQSection");
 }
Exemple #3
0
 private void Save(Models.ArticleDocument record, bool isNew)
 {
     // add any code to update other fields/tables here
     record.Save();
     // save subform or related checkboxes here eg record.Lines.Save();
     //ifsubform: record.example.Save();
     //BewebCore.ThirdParty.SearchTextExtractor.CheckAttachmentsForDocOrPDFText(record);
     //CheckLock(record);
     //lockobj.UnLockTable(record.GetTableName(),record.ID);
     ActiveRecordLoader.ClearCache("ArticleDocument");
 }
        public ActionResult SaveSortOrder(string sortOrder)
        {
            int        pos = 1;
            List <int> ids = sortOrder.Split(",").ToList(s => s.ToInt(0));

            foreach (var id in ids)
            {
                Sql sql = new Sql("update Product set SortPosition=", pos * 10, "where ProductID=", id);
                sql.Execute();
                pos++;
            }
            ActiveRecordLoader.ClearCache("Product");
            return(Content("Sort order saved."));
        }
Exemple #5
0
 private void Save(Models.DocumentCategory record, bool isNew)
 {
     // add any code to update other fields/tables here
     record.Save();
     if (record.ParentDocumentCategoryID.HasValue && record.PageID.HasValue)
     {
         record.PageID = null;
         record.Save();
     }
     // save subform or related checkboxes here eg record.Lines.Save();
     //ifsubform: record.example.Save();
     //CheckLock(record);
     //lockobj.UnLockTable(record.GetTableName(),record.ID);
     ActiveRecordLoader.ClearCache("DocumentCategory");
 }
Exemple #6
0
        public ActionResult SaveSortOrder(string sortOrder)
        {
            int        pos = 1;
            List <int> ids = sortOrder.Split(",").ToList(s => s.ToInt(0));

            if (Crypto.Decrypt(Web.Request["t"]) == "RelatedPage")
            {
                return(Content("skip"));
            }
            foreach (var id in ids)
            {
                Sql sql = new Sql("update " + Crypto.Decrypt(Web.Request["t"]) + " set SortPosition=", pos * 10, "where " + Crypto.Decrypt(Web.Request["p"]) + "=", id);
                sql.Execute();
                pos++;
            }
            ActiveRecordLoader.ClearCache("Page");
            return(Content("reload"));
        }
Exemple #7
0
        /// <summary>
        /// Deletes the given record or displays validation errors if cannot delete
        /// GET: /Admin/Competition/Delete/5
        /// </summary>
        public ActionResult Delete(int id, string returnPage)
        {
            var record = Models.Competition.LoadID(id);
            // first delete any child records that are OK to delete
            //ifsubform: record.example.DeleteAll();
            // then prevent deletion if any other related records exist
            string issues = record.CheckForDependentRecords();

            if (issues.IsNotBlank())
            {
                Web.ErrorMessage = "Cannot delete this record. " + issues;
                return(RedirectToEdit(record.ID));
            }
            //ifsubform: record.example.Save();  // is this needed?
            record.Delete();
            ActiveRecordLoader.ClearCache("Competition");
            Web.InfoMessage = "Record deleted.";
            return(Redirect(returnPage));
        }
Exemple #8
0
        /// <summary>
        /// Deletes the given record or displays validation errors if cannot delete
        /// GET: /Admin/FAQSection/Delete/5
        /// </summary>
        public ActionResult Delete(int id, string returnPage)
        {
            var record = Models.FAQSection.LoadID(id);

            // first delete any child records that are OK to delete
            record.FAQItems.DeleteAll();
            // then prevent deletion if any other related records exist
            string issues = record.CheckForDependentRecords();

            if (issues.IsNotBlank())
            {
                Web.ErrorMessage = "Cannot delete this record. " + issues;
                return(RedirectToEdit(record.ID));
            }
            CheckLock(record);
            lockobj.UnLockTable(record.GetTableName(), record.ID);
            record.FAQItems.Save();              // is this needed?
            record.Delete();
            ActiveRecordLoader.ClearCache("FAQSection");
            Web.InfoMessage = "FAQ Section Record deleted.";
            return(Redirect(returnPage));
        }
Exemple #9
0
 public static void Rebuild()
 {
     ActiveRecordLoader.ClearCache("Article");
     Web.Cache ["ArticleCache"] = ArticleList.LoadAll();
 }
Exemple #10
0
 public static void Rebuild()
 {
     ActiveRecordLoader.ClearCache("TextBlock");
     Web.Cache["TextBlockCache"] = TextBlockList.LoadAll();
 }
Exemple #11
0
 public static void Rebuild()
 {
     Web.ClearOutputCache();
     ActiveRecordLoader.ClearCache("Page");
     Web.Cache["PageCache"] = PageList.LoadAll();
 }
Exemple #12
0
 public static void Rebuild()
 {
     ActiveRecordLoader.ClearCache("Staff");
     Web.Cache ["PersonCache"] = PersonList.LoadAll();
 }