Exemple #1
0
        public JsonResult Add(DianZanLogVModel model)
        {
            var result = new JsonResultModel();

            if (ModelState.IsValid)
            {
                //add
                result.ResultState = DianZanLogs.AddDianZanLog(DianZanLogs.DianZanLogVModelToInfo(model)) > 0;
            }
            else
            {
                result.ResultState = false;
                result.Message     = ModelStateHelper.GetAllErrorMessage(ModelState);
            }

            return(Json(result));
        }
Exemple #2
0
 /// <summary>
 /// ViewModel 转 DataModel
 /// </summary>
 /// <param name="dianzanlog"></param>
 /// <returns></returns>
 public static DianZanLogInfo DianZanLogVModelToInfo(DianZanLogVModel dianzanlog)
 {
     if (dianzanlog == null)
     {
         return(new DianZanLogInfo());
     }
     return(new DianZanLogInfo
     {
         Id = dianzanlog.Id,
         MId = dianzanlog.MId,
         CId = dianzanlog.CId,
         UserId = dianzanlog.UserId,
         Ip = dianzanlog.Ip,
         IsCancel = dianzanlog.IsCancel,
         CancelTime = dianzanlog.CancelTime,
         Type = dianzanlog.Type,
         CreateTime = dianzanlog.CreateTime
     });
 }
Exemple #3
0
        public ActionResult Add()
        {
            var vm = new DianZanLogVModel();

            return(View(vm));
        }
 /// <summary>
 /// 添加点赞记录
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public long Add(DianZanLogVModel model)
 {
     return(HGShare.Business.DianZanLogs.AddDianZanLog(HGShare.Business.DianZanLogs.DianZanLogVModelToInfo(model)));
 }