public JsonResult GetSigleDataByUserID([FromBody] JObject param_user) { t_userinfo temp = null; try { string password = param_user["password"].ToString(); string username = param_user["username"].ToString(); temp = myPostRepo.GetSingle_T_UserLogin(username, password); if (temp != null) { t_userinfo_trans t = new t_userinfo_trans(); t.userid = temp.userid; t.role = temp.role; t.realname = temp.realname; t.other = temp.other; t.guestid = temp.guestid; t.func = temp.func; t.duty = temp.duty; return(Json(new { success = "200", data = t })); } else { return(Json(new { success = "200", data = temp })); } } catch (Exception ex) { return(Json(new { success = "404", error = ex.ToString() })); } }
public JsonResult UpdateUserInfo([FromBody] JObject param_user) { bool updatestatus = false; try { t_userinfo userinfo = new t_userinfo(); userinfo.userid = param_user["userid"].ToString(); userinfo.username = param_user["username"].ToString(); userinfo.password = param_user["password"].ToString(); userinfo.duty = param_user["duty"].ToString(); userinfo.role = param_user["role"].ToString(); userinfo.realname = param_user["realname"].ToString(); userinfo.other = param_user["other"].ToString(); userinfo.guestid = param_user["guestid"].ToString(); userinfo.func = param_user["func"].ToString(); //验证用户是否可以修改密码 //var tempuser= myPostRepo.GetSingle_T_UserLogin(userinfo.username, userinfo.password); //if (tempuser != null&&tempuser.password!=null) //{ updatestatus = myPostRepo.Update_T_UserInfo(userinfo); //} //updatestatus = myPostRepo.Update_T_UserInfo(userinfo); return(Json(new { success = "200", data = updatestatus })); } catch (Exception ex) { return(Json(new { success = "404", error = ex.ToString() })); } }
public JsonResult GetSigleDataByUserID(string userid) { t_userinfo temp = null; try { temp = myPostRepo.GetSingle_T_UserInfo(userid); if (temp != null) { t_userinfo_trans t = new t_userinfo_trans(); t.userid = temp.userid; t.role = temp.role; t.realname = temp.realname; t.other = temp.other; t.guestid = temp.guestid; t.func = temp.func; t.duty = temp.duty; return(Json(new { success = "200", data = t })); } else { return(Json(new { success = "200", data = temp })); } } catch (Exception ex) { return(Json(new { success = "404", error = ex.ToString() })); } }