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 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() })); } }