/// <summary>
 /// 根据Id获取
 /// </summary>
 /// <param name="Id"></param>
 /// <returns></returns>
 public EmailType GetById(int Id)
 {
     EmailType obj = NSession.Get<EmailType>(Id);
     if (obj == null)
     {
         obj = new EmailType { Id = 0 };
         return obj;
     }
     else
     {
         return obj;
     }
 }
 public JsonResult Create(EmailType obj)
 {
     try
     {
         NSession.SaveOrUpdate(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return Json(new { IsSuccess = false, ErrorMsg = "出错了" });
     }
     return Json(new { IsSuccess = true  });
 }