// GET: F8YLProject //public ActionResult ProjectList() //{ // var token = Session["token"] == null ? "XXXXXXX" : Session["token"].ToString(); // var currentUserId = Session["CurrentUserID"] == null ? "-1" : Session["CurrentUserID"].ToString(); // UserRequest user = new UserRequest(); // UserProfileResponse userFile = user.profile(token, currentUserId); // ProjectListResponse entData = new ProjectListResponse(); // if (userFile.data != null) // { // entData = projectRequest.list(token, userFile.data.hospitalid, 0, currentUserId); // } // ViewBag.UserFile = userFile.data; // ViewBag.ProjectList = entData.data.data; // return View(); //} #endregion public ActionResult ProjectList() { var token = Session["token"] == null ? "XXXXXXX" : Session["token"].ToString(); ViewBag.Token = token; var currentUserId = Session["CurrentUserID"] == null ? "-1" : Session["CurrentUserID"].ToString(); ViewBag.UserID = currentUserId; ViewBag.HospitalID = Session["hospitalid"] == null ? "-1" : Session["hospitalid"].ToString(); UserRequest user = new UserRequest(); UserProfileResponse userFile = user.profile(token, currentUserId); if (userFile.data.role == "90") { return RedirectToAction("ManageIndex", "F8YLManage"); } ProjectJoined entData = new ProjectJoined(); if (userFile.data != null) { entData = projectRequest.Joined(token,"0"); } ViewBag.UserFile = userFile.data; ViewBag.ProjectList = entData.data; return View(); }
/// <summary> /// 56、 56、 获取当前用户所参与的项目 /// </summary> /// <param name="token">token</param> /// <returns></returns> public ProjectJoined Joined(string token, string status) { string apiResponse = string.Empty; ProjectJoined projectJoined = new ProjectJoined(); try { Dictionary<string, string> sPara = new Dictionary<string, string>(); sPara.Add("status", status); apiResponse = F8YLSubmit.BuildGetRequest(sPara, "project/joined?token=" + token); projectJoined = JsonHelper.DeserializeJsonToObject<ProjectJoined>(apiResponse); } catch (Exception ex) { AppLog.Instance.Write("Joined", AppLog.LogMessageType.Error, ex); } return projectJoined; }