public ActionResult HomePage(Guid id)
        {
            UCHomeBasePage     ucHomeBasePage = new UCHomeBasePage();
            Guid               xxid           = ucHomeBasePage.GetUserInfoByRequestId(id).xxid;
            StudentInfoService stuService     = new StudentInfoService();
            //德育信息
            IList <StudentInformation.DYInformation> stuDyList = stuService.GetStudentDY(id, null, "", 0).Take(5).ToList();

            ViewBag.DYInfo = stuDyList;

            //奖惩信息
            IList <StudentInformation.JCinformation> stuJcList = stuService.GetStudentJC(id, xxid, null, "").Take(5).ToList();

            ViewBag.JCInfo = stuJcList;

            //体检信息
            IList <StudentInformation.StudentHealth> stuHealthList = stuService.GetStudentHealth(id, null).Take(5).ToList();

            ViewBag.StudentHealth = stuHealthList;


            //成绩信息
            IList <StudentInformation.StudentScores> stuScoreList = stuService.GetStudentScore(id, xxid, null, null, "", "").Take(5).ToList();

            ViewBag.ScoreInfo = stuScoreList;
            return(PartialView("HomePage", id));
        }
        public JsonResult RemoveMyBook(string removeUserId)
        {
            var reUserId = new Guid(removeUserId);

            UCHomeBasePage   ucbBasePage = new UCHomeBasePage();
            Guid             adduser     = user.userid;
            UCHomeEntities   uc          = new UCHomeEntities();
            View_Simple_User vsu         = uc.View_Simple_User.SingleOrDefault(u => u.userid == reUserId);

            if (vsu != null)
            {
                UCHome_Attention attent =
                    uc.UCHome_Attention.FirstOrDefault(u => u.AddUser == adduser && u.AttenUser == vsu.userid);
                if (attent != null)
                {
                    uc.UCHome_Attention.DeleteObject(attent);
                    uc.SaveChanges();

                    var            client1 = new JsonServiceClient(http + "/SNSApi/");
                    DeleteAddrBook book    = new DeleteAddrBook
                    {
                        GroupID = user.userid.ToString(),
                        UID     = vsu.userid.ToString()
                    };

                    client1.Delete(book);
                }
                return(Json(true, JsonRequestBehavior.AllowGet));
            }
            return(Json(false, JsonRequestBehavior.AllowGet));
        }
        public ActionResult AddMyBook(string addUserId)
        {
            var aUserId = new Guid(addUserId);

            UCHomeBasePage   ucbBasePage = new UCHomeBasePage();
            Guid             adduser     = user.userid;
            UCHomeEntities   uc          = new UCHomeEntities();
            View_Simple_User vsu         = uc.View_Simple_User.SingleOrDefault(u => u.userid == aUserId);

            if (vsu != null)
            {
                UCHome_Attention attent = new UCHome_Attention();
                attent.PKID          = Guid.NewGuid();
                attent.AddUser       = adduser;
                attent.AttenUser     = vsu.userid;
                attent.AttenName     = vsu.username; attent.AttenTime = DateTime.Now;
                attent.AttenIdentity = vsu.usertype.ToUpper();
                uc.UCHome_Attention.AddObject(attent);
                uc.SaveChanges();

                AddAddrBookEntry book = new AddAddrBookEntry
                {
                    GroupID   = user.userid.ToString(),
                    GroupName = "我的关注",
                    UID       = vsu.userid.ToString(),
                    UName     = vsu.username
                };

                client.Send <AddAddrBookEntry>(book);

                return(Json(true, JsonRequestBehavior.AllowGet));
            }
            return(Json(false, JsonRequestBehavior.AllowGet));
        }
示例#4
0
        //
        // GET: /Energy/
        public ActionResult IndexAsync()
        {
            UCHomeBasePage ubp  = new UCHomeBasePage();
            string         xxid = ubp.CurrentSch.ToString().ToUpper();
            int            year = DateTime.Now.Year;

            AsyncManager.OutstandingOperations.Increment(1);
            Task.Factory.StartNew(() =>
            {
                //var url = "http://111.17.215.232:8096/Statistics/EnergyConsumption/GetBuildDayJson?year=2015&month=8&buildId=64F0BF0D-7D4C-4EF1-B6B6-96D1576FA7A6&type=01";//逐日用 电/水 状况
                //var url = "http://111.17.215.232:8096/Statistics/EnergyConsumption/GetBuildMonthJson?year=2015&buildId=64F0BF0D-7D4C-4EF1-B6B6-96D1576FA7A6&type=01";//逐月用 电/水 状况
                //var url = "http://111.17.215.232:8096/Statistics/EnergyConsumption/GetBuildCompareJson?year=2015&month=8&buildId=64F0BF0D-7D4C-4EF1-B6B6-96D1576FA7A6&type=01"; //按节点比较
                string url =
                    string.Format(
                        "http://172.25.0.108/Statistics/EnergyConsumption/GetBuildMonthJson?year={0}&buildId={1}&type=01",
                        year, xxid);
                ViewBag.xxid = xxid;
                using (HttpClient httpClient = new HttpClient())
                {
                    var response = httpClient.GetStringAsync(url).Result;
                    AsyncManager.Parameters["data"] = response;
                    AsyncManager.OutstandingOperations.Decrement();
                }
            });

            return(View());
        }
示例#5
0
        public ViewResult ChildRedirect(Guid childid)
        {
            //设置ChildGuid
            UCHomeEntities      uc        = new UCHomeEntities();
            View_Simple_StuInfo childinfo = uc.View_Simple_StuInfo.SingleOrDefault(s => s.xsid == childid);

            UCHomeBasePage.SetChildCookies(childinfo);
            return(View("HomePage", user));
        }
        public List <ChildrenScores> GetStuScoreses()
        {
            UCHomeBasePage ucHomeBasePage = new UCHomeBasePage();

            if (Session["stuscore"] == null)
            {
                StudentInfoService    stuService     = new StudentInfoService();
                List <ChildrenScores> childrenscores = new List <ChildrenScores>();
                if (usertype.ToLower() == "s")
                {
                    IList <StudentInformation.StudentScores> stuScoreList = GetStudentScore(loginId, xxid, null, null, "", "").OrderBy(s => s.SchYear).ThenBy(s => s.SchTerm).ThenBy(s => s.ExamTypeCode).ToList();
                    List <StuScores> stuscoress = new List <StuScores>();
                    foreach (StudentInformation.StudentScores items in stuScoreList)
                    {
                        StuScores stuscores = OrderByScores(items);
                        stuscoress.Add(stuscores);
                    }
                    childrenscores.Add(new ChildrenScores
                    {
                        xsid      = loginId,
                        XM        = username,
                        stuscores = stuscoress
                    });
                }
                else if (usertype.ToLower() == "p")
                {
                    StudentEntities         stu    = new StudentEntities();
                    List <Stu_FamilyStuRel> family = stu.Stu_FamilyStuRel.Where(f => f.JZID == loginId).ToList();
                    foreach (Stu_FamilyStuRel item in family)
                    {
                        Guid     xsid     = item.XSID;
                        UserInfo userInfo = ucHomeBasePage.GetUserInfoByRequestId(xsid);
                        Guid     schid    = userInfo.xxid;
                        IList <StudentInformation.StudentScores> stuScoreList = GetStudentScore(xsid, schid, null, null, "", "").OrderBy(s => s.SchYear).ThenBy(s => s.SchTerm).ThenBy(s => s.ExamTypeCode).ToList();
                        List <StuScores> stuscoress = new List <StuScores>();
                        foreach (StudentInformation.StudentScores items in stuScoreList)
                        {
                            StuScores stuscores = OrderByScores(items);
                            stuscoress.Add(stuscores);
                        }
                        childrenscores.Add(new ChildrenScores
                        {
                            xsid      = xsid,
                            XM        = userInfo.username,
                            stuscores = stuscoress
                        });
                    }
                }
                Session["stuscore"] = childrenscores;
                return(childrenscores);
            }
            return(Session["stuscore"] as List <ChildrenScores>);
        }
示例#7
0
        public ActionResult SSOtransfer(string returnurl)
        {
            string transferurl = string.Format("{0}Login/loginTransfer?uchomereturnurl={1}", UCHomeBasePage.iiswebsitedirectory, returnurl);

            if (UCHomeBasePage.loginmethod == "other")
            {
                return(Redirect(UCHomeBasePage.GetConfig("SSO.SignIn") + "&returnurl=" + Url.Encode(transferurl)));
            }
            else
            {
                return(Redirect(Url.Action("Login") + "?returnurl=" + Url.Encode(transferurl)));
            }
        }
        public ActionResult JCInfo(Guid?id)
        {
            Guid               userid         = id != null ? id.Value : loginId;
            UCHomeBasePage     ucHomeBasePage = new UCHomeBasePage();
            Guid               xxid           = ucHomeBasePage.GetUserInfoByRequestId(userid).xxid;
            StudentInfoService stuService     = new StudentInfoService();

            //奖惩信息
            IList <StudentInformation.JCinformation> stuJcList = stuService.GetStudentJC(userid, xxid, null, "").ToList();

            ViewBag.JCInfo = stuJcList;

            return(PartialView("JCInfo", userid));
        }
示例#9
0
        public ActionResult HomePage()
        {
            if (user != null)
            {
                UCHomeEntities  uc    = new UCHomeEntities();
                UCHome_BaseInfo space = uc.UCHome_BaseInfo.SingleOrDefault(u => u.UserID == user.userid);
                if (space == null)
                {
                    ViewBag.usertype = user.usertype;
                    return(View("Index", true));
                }
                if (space.UserType == null)
                {
                    space.UserType = user.usertype;
                    uc.SaveChanges();
                }
                ViewBag.XXID    = user.xxid;
                ViewBag.UserID  = loginId;
                ViewBag.OrgID   = user.orgid;
                ViewBag.OrgName = user.orgname;
                //获取用户皮肤主题
                //if (userType.ToLower() == "s")
                //{
                //    return RedirectToAction("Index", "StudentCenter");
                //}
                if (userType.ToLower() == "p" && Request.Cookies["ChildInfo"] == null)
                {
                    StudentEntities stu = new StudentEntities();
                    List <Guid>     rel =
                        stu.Stu_FamilyStuRel.Where(f => f.JZID == user.userid).Select(f => f.XSID).ToList();
                    if (rel.Count == 1)
                    {
                        //设置ChildGuid
                        Guid xsid = rel.First();
                        View_Simple_StuInfo childinfo = uc.View_Simple_StuInfo.SingleOrDefault(s => s.xsid == xsid);
                        UCHomeBasePage.SetChildCookies(childinfo);
                    }
                    else
                    {
                        List <View_Simple_StuInfo> stulist =
                            uc.View_Simple_StuInfo.Where(s => rel.Contains(s.xsid)).ToList();
                        ViewBag.childs = stulist;
                        return(View("ChildRedirect", stulist));
                    }
                }
                return(View("HomePage", user));
            }

            return(View("Index", false));
        }
示例#10
0
 public void Logout(string returnurl)
 {
     ucbase.LoginOut();
     if (UCHomeBasePage.loginmethod == "other")
     {
         string loginouturl = UCHomeBasePage.GetConfig("SSO.SignOut");
         Response.Redirect(loginouturl + "&ReturnUrl=" + returnurl);
     }
     else
     {
         string transferurl = string.Format("{0}Login/loginTransfer?uchomereturnurl={1}", UCHomeBasePage.iiswebsitedirectory, returnurl);
         Response.Redirect(Url.Action("Login", "Login") + "?ReturnUrl=" + Url.Encode(transferurl));
     }
 }
示例#11
0
        public JsonResult AddUser(UCHome_User user)
        {
            user.UserPwd = EncryptUtils.MD5Encrypt(user.UserPwd);
            UCHome_UserBLL userbll  = new UCHome_UserBLL();
            int            result   = userbll.AddUser(user);
            string         errormsg = "提交的数据异常或者网络异常";

            if (result == 1)
            {
                int result2 = userbll.AddRelationOrgAndUser(user.PKID, new Guid(UCHomeBasePage.GetConfig("MainSchoolID")));
                if (result2 == 1)
                {
                    var jrs = new {
                        StatusCode = 200,
                        data       = user
                    };
                    return(Json(jrs, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    userbll.RemoveUser(user);
                    errormsg = "添加组织关系失败";
                }
            }
            else if (result == 2)
            {
                errormsg = "账号已经存在";
            }
            else
            {
                errormsg = "提交的数据异常或者网络异常";
            }
            var jr = new {
                StatusCode = 500,
                data       = new UCHome_User {
                    PKID = Guid.NewGuid()
                },
                msg = errormsg
            };

            return(Json(jr, JsonRequestBehavior.AllowGet));
        }
示例#12
0
        public ActionResult SystemAppRedirectPage(Guid id, string typename, Guid?MenuID)
        {
            if (user == null)
            {
                return(Redirect(Url.Action("Logout")));
            }
            UCHomeEntities uc = new UCHomeEntities();

            if (userType.ToLower() == "p" && Request.Cookies["ChildInfo"] == null)
            {
                StudentEntities stu = new StudentEntities();
                List <Guid>     rel =
                    stu.Stu_FamilyStuRel.Where(f => f.JZID == user.userid).Select(f => f.XSID).ToList();
                if (rel.Count == 1)
                {
                    //设置ChildGuid
                    Guid xsid = rel.First();
                    View_Simple_StuInfo childinfo = uc.View_Simple_StuInfo.SingleOrDefault(s => s.xsid == xsid);
                    UCHomeBasePage.SetChildCookies(childinfo);
                }
                else
                {
                    return(RedirectToAction("HomePage", "Home"));
                }
            }
            UCHome_App_System app = uc.UCHome_App_System.SingleOrDefault(u => u.PKID == id);

            if (app != null && app.AppTarget == "_blank")
            {
                return(Redirect(app.AppUrl));
            }
            AppCollection sysapp = new AppCollection();

            sysapp.app        = app;
            ViewBag.SelMenuID = MenuID;
            ViewBag.TypeName  = typename;
            return(PartialView("AppRedirectPage", sysapp));
        }
示例#13
0
        public ActionResult Index()
        {
            UCHomeEntities uc = new UCHomeEntities();

            if (userType.ToLower() == "p" && Request.Cookies["ChildInfo"] == null)
            {
                StudentEntities stu = new StudentEntities();
                List <Guid>     rel =
                    stu.Stu_FamilyStuRel.Where(f => f.JZID == user.userid).Select(f => f.XSID).ToList();
                if (rel.Count == 1)
                {
                    //设置ChildGuid
                    Guid xsid = rel.First();
                    View_Simple_StuInfo childinfo = uc.View_Simple_StuInfo.SingleOrDefault(s => s.xsid == xsid);
                    UCHomeBasePage.SetChildCookies(childinfo);
                }
                else
                {
                    return(RedirectToAction("HomePage", "Home"));
                }
            }
            return(View(user));
        }
示例#14
0
 //不指定返回路径
 public ActionResult loginTransfer(string uchomereturnurl)
 {
     UCHomeBasePage.SetSSOUser();
     return(Redirect(uchomereturnurl));
 }
示例#15
0
 /// <summary>
 /// 指定返回路径
 /// </summary>
 /// <param name="returnurl"></param>
 /// <returns></returns>
 public ActionResult SSOlogin(string returnurl)
 {
     UCHomeBasePage.SetSSOUser();
     return(Redirect(returnurl));
 }
示例#16
0
        public ActionResult AliveSpace(FormCollection form)
        {
            JsonResult jsonResult;

            if (user != null)
            {
                UCHomeEntities  uc    = new UCHomeEntities();
                UCHome_BaseInfo space = uc.UCHome_BaseInfo.SingleOrDefault(u => u.UserID == user.userid);
                if (space == null)
                {
                    UCHome_BaseInfo ucbBaseInfo = new UCHome_BaseInfo
                    {
                        PKID           = Guid.NewGuid(),
                        NickName       = form["NickName"],
                        Section        = form["Section"],
                        Subject        = form["Subject"],
                        UserID         = user.userid,
                        UserType       = user.usertype,
                        Visits         = 0,
                        ExcellentSpace = "other",
                        IsStatus       = "1",
                        CreateTime     = DateTime.Now
                    };
                    uc.UCHome_BaseInfo.AddObject(ucbBaseInfo);
                    try
                    {
                        uc.SaveChanges();
                        jsonResult = new JsonResult
                        {
                            Data = new
                            {
                                result  = "success",
                                uctype  = user.usertype,
                                subject = form["Subject"]
                            }
                        };
                        UCHomeBasePage.SetSpaceCookies(ucbBaseInfo);
                        return(Json(jsonResult, JsonRequestBehavior.AllowGet));
                    }
                    catch (Exception)
                    {
                        jsonResult = new JsonResult
                        {
                            Data = new
                            {
                                result = "fail",
                                uctype = "X"
                            }
                        };
                        return(Json(jsonResult, JsonRequestBehavior.AllowGet));
                    }
                }
                jsonResult = new JsonResult
                {
                    Data = new
                    {
                        result = "exist",
                        uctype = space.UserType
                    }
                };
            }
            else
            {
                jsonResult = new JsonResult
                {
                    Data = new
                    {
                        result = "fail",
                        uctype = "X"
                    }
                };
            }
            return(Json(jsonResult, JsonRequestBehavior.AllowGet));
        }