Exemple #1
0
        public Model.AjaxResult Like(HttpContext context, Model.AjaxResult ajax)
        {
            int channel_id = ConvertTool.ToInt(DTRequest.GetString("channel_id"), 0);

            if (channel_id <= 0)
            {
                return(ErrorAjaxResult(ajax, @"频道错误"));
            }

            int article_id = ConvertTool.ToInt(DTRequest.GetString("article_id"), 0);

            if (article_id <= 0)
            {
                return(ErrorAjaxResult(ajax, @"文章错误"));
            }

            BLL.article bllarticle = new BLL.article();
            string      fieldname  = ReflexHelp.Name(() => new Model.article().like_count);
            bool        issu       = bllarticle.UpdateField(channel_id, article_id, string.Format("{0} = {0} + 1", fieldname));

            if (!issu)
            {
                return(ErrorAjaxResult(ajax, @"点赞失败!"));
            }

            ajax.Status = Model.AjaxResult.StatusValue.Success;
            ajax.Msg    = @"点赞成功!";
            return(ajax);
        }
 public CaseModel Func_Name()
 {
     return(new CaseModel()
     {
         NameSign = @"获取模型单个属性名称",
         ExeEvent = () => {
             TestModel model = new TestModel();
             string jx_name = ReflexHelp.Name(() => model.Remark);
             return @"Remark" == jx_name;
         },
     });
 }
 public MSSQLServer_StringID()
     : base()
 {
     this.ColName_SID = ReflexHelp.Name(() => this.DefaultModel.SID);
 }
 public MSSQLServer_IntID()
     : base()
 {
     this.ColName_IID = ReflexHelp.Name(() => this.DefaultModel.IID);
 }