public ActionResult NewArticle(Softvision.BL.Entities.ArticleBL pArticle) { try { var editorTexareaText = Request.Form["editorTexarea"]; if (editorTexareaText != null || editorTexareaText != string.Empty) { pArticle.InternalRep = editorTexareaText.ToString(); pArticle.HTMLRep = TrueEditor.GenerateHTML(pArticle.InternalRep); pArticle.CreatedDate = DateTime.Now; pArticle.IdSubCategory = Request.Form["drpSubCategory"].ToInt(); pArticle.Language = (LanguageBL)Request.Form["drpLanguages"].ToInt(); if (BaseMVC.getUserId() != 0) { pArticle.IdUser = BaseMVC.getUserId(); } KitBL.Instance.Articles.Insert(pArticle); } return(RedirectToAction("Index", "Article")); } catch { return(RedirectToAction("Index", "Home")); } }
public ActionResult Edit(int id, Softvision.BL.Entities.ArticleBL pArticle) { try { // TODO: If user has access + XSS var editorTexareaText = Request.Form["editorTexarea"]; if (editorTexareaText != null || editorTexareaText != string.Empty) { pArticle.InternalRep = editorTexareaText.ToString(); pArticle.HTMLRep = TrueEditor.GenerateHTML(pArticle.InternalRep); pArticle.CreatedDate = DateTime.Now; pArticle.IdSubCategory = Request.Form["drpSubCategory"].ToInt(); if (BaseMVC.getUserId() != 0) { pArticle.IdUser = BaseMVC.getUserId(); } KitBL.Instance.Articles.Update(pArticle); } return(RedirectToAction("MyArticles", "User")); } catch { return(RedirectToAction("Index", "Home")); } }