public JsonResult Create(UserLoginType obj)
 {
     try
     {
         NSession.SaveOrUpdate(obj);
         NSession.Flush();
     }
     catch (Exception ee)
     {
         return Json(new { errorMsg = "出错了" });
     }
     return Json(new { IsSuccess = "true" });
 }
 private void UserLogin()
 {
     string ip = GetClientIP();
     string mac = GetMACByIP(ip);
     UserLoginType obj = new UserLoginType
     {
         UserCode = CurrentUser.Code,
         UserName = CurrentUser.Realname,
         IP = ip,
         MAC = mac,
         CreateOn = DateTime.Now
     };
     NSession.Save(obj);
     NSession.Flush();
 }