コード例 #1
0
 /// <summary>
 /// 成功返回1  失败返回0
 /// </summary>
 /// <param name="userInfo"></param>
 /// <returns></returns>
 public JsonResult AddInfo(UserInfo userInfo)
 {
     userInfo.RegTime = DateTime.Now;
     UserInfo user = userInfoService.AddEntity(userInfo);
     JsonResult json = new JsonResult();
     if (user != null)
     {
         //Response.Write("1");
         //return RedirectToAction("Index");
         ////return Content("1");
         json.Data = new { result = "1" };
     }
     else
     {
         //return Content("0");
         json.Data = new { result = "0"};
     }
     return json;
 }
コード例 #2
0
 public ActionResult EditInfo(UserInfo user)
 {
     if (userInfoService.UpdateEntity(user))
     {
         Response.Write("1");
         return RedirectToAction("Index");
     }
     return Content("0");
 }