Exemple #1
0
        public JsonResult Add(Expose178.Com.Model.Article article)
        {
            bool result = false;

            try
            {
                article.ArticleTile = Server.UrlDecode(article.ArticleTile);
                article.ArticleBody = Server.UrlDecode(article.ArticleBody);
                article.UID         = strUID;
                result = Proxys.ProxyArticle.AddUpdateArticle(article);
            }
            catch (Exception ex)
            {
                Hashtable hshParam = new Hashtable();
                hshParam.Add("UID", strUID);
                hshParam.Add("Error", ex.Message);
                UtilityFactory.Log.WriteLog(hshParam, "ArticleController.Add", UtilityFactory.LogType.LogToDB);
            }

            if (result)
            {
                return(Json("SUCC"));
            }
            else
            {
                return(Json("FAILE"));
            }
        }
Exemple #2
0
        public bool AddUpdateArticle(Expose178.Com.Model.Article article)
        {
            DataSet   dsArticle = null;
            Hashtable hshParam  = new Hashtable();

            Gadget.Addparamater(ref hshParam, "ArticleID", article.ArticleID);
            Gadget.Addparamater(ref hshParam, "ArticleTile", article.ArticleTile);
            Gadget.Addparamater(ref hshParam, "ArticleBody", article.ArticleBody);
            Gadget.Addparamater(ref hshParam, "BackgroundImgUrl", article.BackgroundImgUrl);
            Gadget.Addparamater(ref hshParam, "IsDraft", article.IsDraft == true ? "1" : "0");
            Gadget.Addparamater(ref hshParam, "IsValidated", article.IsValidated == true ? "1" : "0");
            Gadget.Addparamater(ref hshParam, "UpdatedByUserID", article.UID);
            Gadget.Addparamater(ref hshParam, "ReadRoleTypeCode", article.ReadRoleTypeCode);
            Gadget.Addparamater(ref hshParam, "AritcleTypeCode", article.AritcleTypeCode);
            dsArticle = dbOperator.ProcessData("usp_AddUpdateArticleByArticleID", hshParam, strDSN);
            if (Gadget.DatatSetIsNotNullOrEmpty(dsArticle))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #3
0
 public ActionResult Index(string id)
 {
     Expose178.Com.Model.Article article = Proxys.ProxyArticle.GetArticle(id);
     ViewBag.Title = GadgetScripts.Gadget.SalRemoveXSS(article.ArticleTile);
     return(View(article));
 }