CarrotCake.CMS.Plugins.FAQ2.Models.FaqPublic.LoadData C# (CSharp) Method

LoadData() public method

public LoadData ( ) : void
return void
        public override void LoadData()
        {
            base.LoadData();

            if (this.PublicParmValues.Count > 0) {
                try {
                    string sFoundVal = GetParmValue("FaqCategoryID", Guid.Empty.ToString());

                    if (!string.IsNullOrEmpty(sFoundVal)) {
                        this.FaqCategoryID = new Guid(sFoundVal);
                    }
                } catch (Exception ex) { }
            }
        }

Usage Example

        public ActionResult ShowRandomFaq()
        {
            carrot_FaqItem model = new carrot_FaqItem();
            FaqPublic payload = new FaqPublic();

            if (this.WidgetPayload is FaqPublic) {
                payload = (FaqPublic)this.WidgetPayload;
                payload.LoadData();
            }

            ModelState.Clear();

            if (payload.FaqCategoryID != Guid.Empty) {
                model = payload.GetRandomItem();
            }

            if (String.IsNullOrEmpty(payload.AlternateViewFile)) {
                return PartialView("FaqItem", model);
            } else {
                return PartialView(payload.AlternateViewFile, model);
            }
        }
All Usage Examples Of CarrotCake.CMS.Plugins.FAQ2.Models.FaqPublic::LoadData