Пример #1
0
 /// <summary>
 /// 用戶感言 清單頁
 /// </summary>
 /// <param name="param"></param>
 /// <returns></returns>
 public ActionResult UserComments(UserCommentParameter param)
 {
     param.KeyWord = HttpUtility.UrlDecode(param.KeyWord);
     return(View(
                new InternalDataTransferToView {
         List = UserCommentTableProvider.List(param),
         Data = param
     }));
 }
Пример #2
0
 public ActionResult UserCommentEdit(UserCommentParameter param)
 {
     if (0L < param.Entity.UserCommentId)
     {
         param.Entity = UserCommentTableProvider.Detail(param);
     }
     return(View(new InternalDataTransferToView {
         Data = param
     }));
 }
Пример #3
0
        public ActionResult AjaxUserCommentEdit(UserCommentParameter param)
        {
            var result = new JsonNetResult();
            var r      = new GeneralResponse();

            try {
                r.Code = (0L < param.Entity.UserCommentId
                    ? UserCommentTableProvider.Update(param)
                    : UserCommentTableProvider.Create(param)).ToString(Section.Get.Common.Culture);
            }
            catch (Exception ex) {
                Log.Error(ex.Message, ex);
                r.Code = "-11" + ex.Message;
            }
            result.Data = r;
            return(result);
        }
Пример #4
0
        public ActionResult AjaxUserCommentDelete(UserCommentParameter param)
        {
            var result = new JsonNetResult();
            var r      = new GeneralResponse();

            try {
                var detail = UserCommentTableProvider.Detail(param);
                r.Code = UserCommentTableProvider.Delete(param).ToString(Section.Get.Common.Culture);

                if (!string.IsNullOrEmpty(detail.ImgPath))
                {
                    Io.DeleteFile(System.Web.HttpContext.Current.Server.MapPath($"~{detail.ImgPath}"));
                }
            }
            catch (Exception ex) {
                Log.Error(ex.Message, ex);
                r.Code = "-11";
            }
            result.Data = r;
            return(result);
        }