예제 #1
0
        public JsonBaseEntity UpdateRead()
        {
            long recieverEmailId = CommonHelper.GetPostValue("recieverEmailId").ToLong(-1L);

            if (recieverEmailId <= 0)
            {
                return(new JsonBaseEntity {
                    ErrorCode = "E001", ErrorMessage = "参数缺失!"
                });
            }
            T_BG_EmailReciever emailReciever = _bgEmailRecieverService.Get(recieverEmailId);

            if (emailReciever == null)
            {
                return(new JsonBaseEntity {
                    ErrorCode = "E002", ErrorMessage = "未发现该邮件!"
                });
            }

            emailReciever.State = 1;

            if (_bgEmailRecieverService.Update(emailReciever))
            {
                return(new JsonBaseEntity {
                    ErrorCode = "E000", ErrorMessage = "邮件删除成功!"
                });
            }
            else
            {
                return(new JsonBaseEntity {
                    ErrorCode = "E004", ErrorMessage = "邮件删除失败!"
                });
            }
        }
예제 #2
0
        public JsonResult DelRecieverEmail()
        {
            long recieverEmailId = CommonHelper.GetPostValue("recieverEmailId").ToLong(-1L);

            if (recieverEmailId <= 0)
            {
                return(Json(new { ErrorCode = "E001", ErrorMessage = "参数缺失!" }));
            }
            T_BG_EmailReciever emailReciever = _bgEmailRecieverService.Get(recieverEmailId);

            if (emailReciever == null)
            {
                return(Json(new { ErrorCode = "E002", ErrorMessage = "未发现该邮件!" }));
            }
            if (emailReciever.IsDel == 1)
            {
                return(Json(new { ErrorCode = "E000", ErrorMessage = "该邮件已经被删除!" }));
            }

            emailReciever.IsDel = 1;
            if (_bgEmailRecieverService.Update(emailReciever))
            {
                return(Json(new { ErrorCode = "E000", ErrorMessage = "邮件删除成功!" }));
            }
            else
            {
                return(Json(new { ErrorCode = "E004", ErrorMessage = "邮件删除失败!" }));
            }
        }
 public bool Update(T_BG_EmailReciever emailReciever)
 {
     try
     {
         return(_bgEmailRecieverRepository.Update(emailReciever));
     }
     catch (Exception)
     {
         return(false);
     }
 }