Example #1
0
        public ActionResult BookList()
        {
            string    accessToken = GetaccessToken();
            UserModel temp        = new UserModel();
            string    code        = System.Web.HttpContext.Current.Request["Code"];

            code = code.Replace('#', ' ').Trim();
            if (!string.IsNullOrEmpty(code))
            {
                temp = GetUserMode(accessToken, code);
            }
            UserInfo   userInfo   = EnterpriseBusiness.GetUserInfo(accessToken, temp.userid);
            DataTable  dt         = ProjectService.GetList("", "ProjectId desc").Tables[0];
            DataColumn dataColumn = new DataColumn("Last");

            dt.Columns.Add(dataColumn);
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (Session[dt.Rows[i]["ProjectId"].ToString()] != null)
                {
                    dt.Rows[i]["Last"] = Session[dt.Rows[i]["ProjectId"].ToString()];
                }
                else
                {
                    dt.Rows[i]["Last"] = dt.Rows[i]["ProjectCount"];
                }
            }
            ViewBag.UserInfo = userInfo;
            ViewBag.UserDId  = userInfo.userid;
            ViewBag.UserName = userInfo.name;
            ViewBag.dt       = dt;
            return(View());
        }
Example #2
0
        public ActionResult ReturnBook()
        {
            string    accessToken = GetaccessToken();
            UserModel temp        = new UserModel();
            string    ProjectId   = string.IsNullOrEmpty(System.Web.HttpContext.Current.Request["ProjectId"]) ? string.Empty : System.Web.HttpContext.Current.Request["ProjectId"].ToString();
            string    code        = string.IsNullOrEmpty(System.Web.HttpContext.Current.Request["code"]) ? string.Empty : System.Web.HttpContext.Current.Request["code"].ToString();

            if (!string.IsNullOrEmpty(code))
            {
                temp = GetUserMode(accessToken, code);
            }
            UserInfo userInfo = EnterpriseBusiness.GetUserInfo(accessToken, temp.userid);

            ViewBag.UserName  = userInfo.name;
            ViewBag.UserId    = userInfo.userid;
            ViewBag.ProjectId = ProjectId;
            return(View());
        }