//添加评分人员1对1信息 public ActionResult AddScoreUserInfo() { WXXScoreUser wxxsu = new WXXScoreUser(); wxxsu.UID = Convert.ToInt32(Request["uid"]); wxxsu.CanGiveScoreUserID = Convert.ToInt32(Request["downUid"]); WXXScoreUserService.AddEntity(wxxsu); return(Json(new { ret = "ok", msg = "添加成功" }, JsonRequestBehavior.AllowGet)); }
//删除评分人员1对1信息 public ActionResult DelScoreUserInfo() { int id = Convert.ToInt32(Request["id"]); var temp = WXXScoreUserService.LoadEntities(x => x.ID == id).FirstOrDefault(); if (temp != null) { if (WXXScoreUserService.DeleteEntity(temp)) { return(Json(new { ret = "ok", msg = "删除成功" }, JsonRequestBehavior.AllowGet)); } return(Json(new { ret = "no", msg = "操作失败" }, JsonRequestBehavior.AllowGet)); } return(Json(new { ret = "no", msg = "数据库中无此数据,请仔细核对" }, JsonRequestBehavior.AllowGet)); }
//获取可评分人员数据 public ActionResult GetCanPFInfo() { var temp = WXXScoreUserService.LoadEntities(x => x.UID == LoginUser.ID).DefaultIfEmpty().ToList(); if (temp != null && temp[0] != null) { var rtmp = from a in temp select new { ID = a.CanGiveScoreUserID, Name = a.UserInfo1.PerSonName }; return(Json(new { ret = "ok", rows = rtmp }, JsonRequestBehavior.AllowGet)); } return(Json(new { ret = "no", msg = "数据库无数据!" }, JsonRequestBehavior.AllowGet)); }
//获取评分人员1对1信息 public ActionResult GetScoreUserInfo() { //判断是否为搜索 var serchText = Request["serchText"] == "" || Request["serchText"] == null || Request["serchText"] == "null" ? "0" : Request["serchText"]; if (serchText != "0") { var data = WXXScoreUserService.LoadEntities(x => x.UserInfo.PerSonName.Contains(serchText)).DefaultIfEmpty().ToList(); if (data != null && data[0] != null) { var remp = from a in data select new { ID = a.ID, Name = a.UserInfo.PerSonName, Username = a.UserInfo1.PerSonName }; return(Json(new { ret = "ok", rows = remp }, JsonRequestBehavior.AllowGet)); } return(Json(new { ret = "no" }, JsonRequestBehavior.AllowGet)); } var temp = WXXScoreUserService.LoadEntities(x => x.ID > 0).DefaultIfEmpty().ToList(); if (temp != null && temp[0] != null) { var rtmp = from a in temp select new { ID = a.ID, Name = a.UserInfo.PerSonName, Username = a.UserInfo1.PerSonName }; return(Json(new { ret = "ok", rows = rtmp }, JsonRequestBehavior.AllowGet)); } return(Json(new { ret = "no", msg = "数据库表中无数据" }, JsonRequestBehavior.AllowGet)); }