public JsonResult Create(EmailReturnType obj) { try { NSession.SaveOrUpdate(obj); NSession.Flush(); } catch (Exception ee) { return Json(new { IsSuccess = false, ErrorMsg = "出错了" }); } return Json(new { IsSuccess = true }); }
public JsonResult EmailRe(EmailReturnType obj) { try { DateTime ReTime = DateTime.Now; SendMail(obj.REmail, obj.Subject, obj.Content); obj.CreateOn = ReTime; obj.CreateBy = ReTime; NSession.Save(obj); IList<EmailType> mail = NSession.CreateQuery("from EmailType c where c.Id=:id").SetInt32("id", obj.EId).List<EmailType>(); mail[0].IsReply = 1; mail[0].ReplyOn = ReTime; NSession.Update(mail[0]); NSession.Flush(); } catch (Exception ee) { return Json(new { IsSuccess = false, ErrorMsg = "出错了" }); } return Json(new { IsSuccess = true }); }
public ActionResult EmailRe(int id) { EmailType obj = GetById(id); EmailReturnType ob = new EmailReturnType { REmail = obj.BuyerEmail, Subject = "Re:" + obj.Subject }; ViewData["sub"] = obj.Subject; ViewData["con"] = obj.Content; ViewData["eid"] = obj.Id; ViewData["Reply"] = obj.IsReply; return View(ob); }