Пример #1
0
        public JsonResult Add(SendMailLogVModel model)
        {
            var result = new JsonResultModel();

            if (ModelState.IsValid)
            {
                //add
                result.ResultState = SendMailLogs.AddSendMailLog(SendMailLogs.SendMailLogVModelToInfo(model)) > 0;
            }
            else
            {
                result.ResultState = false;
                result.Message     = ModelStateHelper.GetAllErrorMessage(ModelState);
            }

            return(Json(result));
        }
Пример #2
0
 /// <summary>
 /// ViewModel 转 DataModel
 /// </summary>
 /// <param name="sendmaillog"></param>
 /// <returns></returns>
 public static SendMailLogInfo SendMailLogVModelToInfo(SendMailLogVModel sendmaillog)
 {
     if (sendmaillog == null)
     {
         return(new SendMailLogInfo());
     }
     return(new SendMailLogInfo
     {
         Id = sendmaillog.Id,
         UserId = sendmaillog.UserId,
         SendUserId = sendmaillog.SendUserId,
         TemplateId = sendmaillog.TemplateId,
         ToEmail = sendmaillog.ToEmail,
         FromEmail = sendmaillog.FromEmail,
         Status = sendmaillog.Status,
         Title = sendmaillog.Title,
         Body = sendmaillog.Body,
         Ip = sendmaillog.Ip,
         IsSystem = sendmaillog.IsSystem,
         CreateTime = sendmaillog.CreateTime
     });
 }
Пример #3
0
        public ActionResult Add()
        {
            var vm = new SendMailLogVModel();

            return(View(vm));
        }
Пример #4
0
 /// <summary>
 /// 写入邮件发送日志
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public long Add(SendMailLogVModel model)
 {
     return(SendMailLogs.AddSendMailLog(SendMailLogs.SendMailLogVModelToInfo(model)));
 }