Esempio n. 1
0
        public JsonResult Addmyappfromsys(Guid appid)
        {
            UCHome_App_System sysapp = appbll.getsysappbyid(appid);

            string        statuscode = "200";
            string        msg        = "";
            UCHome_App_My myapp      = appbll.sysappTomyapp(sysapp);

            myapp.UserID = loginId;
            try
            {
                appbll.Addmyapp(myapp);
                appbll.addappdownloads(sysapp);
            }
            catch (Exception ex)
            {
                statuscode = "500";
                msg        = ex.ToString();
            }
            JsonResult jr = new JsonResult {
                Data = new { statuscode, msg }
            };

            return(Json(jr, JsonRequestBehavior.AllowGet));
        }
Esempio n. 2
0
        public JsonResult AddApp(UCHome_AppType_Relation relation, UCHome_App_System sysapp)
        {
            UCHome_AppBLL appbll     = new UCHome_AppBLL();
            string        statuscode = "200";
            string        msg        = "";

            try {
                sysapp.Downloads  = 0;
                sysapp.Hits       = 0;
                sysapp.STATUS     = "1";
                sysapp.AppColor   = "1";
                sysapp.CreateTime = DateTime.Now;
                appbll.Addsystemapp(sysapp);
                relation.AppID = sysapp.PKID;
                relation.PKID  = Guid.NewGuid();
                appbll.AddRelation_App_Type(relation);
            }
            catch (Exception) {
                statuscode = "500";
                msg        = "操作失败,请重试!";
                throw;
            }
            JsonResult jr = new JsonResult {
                Data = new { statuscode, msg }
            };

            return(Json(jr, JsonRequestBehavior.AllowGet));
        }
Esempio n. 3
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));
        }