Exemple #1
0
        public ActionResult Create(FormCollection collection)
        {
            var faq = new Radyn.FAQ.DataStructure.FAQ();

            try
            {
                var faqContent = new FAQContent();
                this.RadynTryUpdateModel(faq, collection);
                this.RadynTryUpdateModel(faqContent, collection);
                HttpPostedFileBase image = null;
                if (Session["Image"] != null)
                {
                    image = (HttpPostedFileBase)Session["Image"];
                    Session.Remove("Image");
                }

                if (CongressComponent.Instance.BaseInfoComponents.CongressFaqFacade.Insert(this.Homa.Id, faq, faqContent, image))
                {
                    ShowMessage(Resources.Common.InsertSuccessMessage, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Succeed);
                    return(this.SubmitRedirect(collection, new { Id = faq.Id }));
                }
                ShowMessage(Resources.Common.ErrorInInsert, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Error);
                return(Redirect("~/Congress/CongressFAQ/Index"));
            }
            catch (Exception exception)
            {
                ShowExceptionMessage(exception);
                return(View(faq));
            }
        }
Exemple #2
0
        public ActionResult Create(FormCollection collection)
        {
            var faq = new Radyn.FAQ.DataStructure.FAQ();

            try
            {
                var faqContent = new FAQContent();
                this.RadynTryUpdateModel(faq, collection);
                this.RadynTryUpdateModel(faqContent, collection);
                faqContent.LanguageId = SessionParameters.Culture;
                HttpPostedFileBase image = null;
                if (Session["Image"] != null)
                {
                    image = (HttpPostedFileBase)Session["Image"];
                    Session.Remove("Image");
                }

                if (WebDesignComponent.Instance.FaqFacade.Insert(this.WebSite.Id, faq, faqContent, image))
                {
                    ShowMessage(Resources.Common.InsertSuccessMessage, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Succeed);
                    return(RedirectToAction("Index"));
                }
                ShowMessage(Resources.Common.ErrorInInsert, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Error);
                return(RedirectToAction("Index"));
            }
            catch (Exception exception)
            {
                ShowMessage(Resources.Common.ErrorInInsert + exception.Message, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Error);
                return(View(faq));
            }
        }