예제 #1
0
        //广告、幻灯片
        //[HttpGet]
        public JsonResult GetAdActive(int top = 8)
        {
            try
            {
                LogErrorRecord.InfoFormat("参数请求url:{0}", Request.Url);
                LogErrorRecord.InfoFormat("参数参数:top={0}", top);
                BllAdActive bllAdActive = new BllAdActive();

                if (jsonResult.success)
                {
                    List <ModAdActive> list = bllAdActive.QueryAll(top);

                    jsonResult.data = list;
                    jsonResult.msg  = "获取成功!";
                }
            }
            catch (Exception ex)
            {
                LogErrorRecord.ErrorFormat("错误日志:{0},请求url:{1}", ex.Message, Request.Url);
                jsonResult.success   = false;
                jsonResult.errorCode = -1;
                jsonResult.msg       = "常异:" + ex.Message;
            }
            return(Json(jsonResult, "application/json", JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        /// <summary>
        /// 单位管理员 首页
        /// </summary>
        /// <returns></returns>
        public ActionResult AdminIndex()
        {
            var master = new MasterContext().Master;

            if (master == null)
            {
                return(Redirect("/Temple/LoginError"));
            }
            else
            {
                //获取通知公告
                XMLHealper XmlColl = new XMLHealper(Server.MapPath("~") + "Project\\Template\\notice.xml");
                string     notice  = "";
                foreach (XmlNode Nodes in XmlColl.GetXmlRoot().SelectNodes("tice"))
                {
                    notice = Nodes.Attributes["value"].InnerText;
                }
                ViewData["Notice"]      = notice;
                ViewData["WebSiteName"] = ConfigurationManager.AppSettings["WebSiteName"];//系统站点名称
                ViewData["Version"]     = ConfigurationManager.AppSettings["Version"];
                ViewData["copyright"]   = "";
                var model = new BllSysCompany().LoadData(key);
                if (model != null)
                {
                    ViewData["copyright"] = model.Name;
                }

                int UserCount    = 0; //系统用户
                int CompanyCount = 0; //使用单位
                int EventCount   = 0; //设备总量
                int LostEvent    = 0; //过期设备
                int LostTime     = 0; //超期未检

                DataSet ds = new BllSysAppointed().Total("");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    UserCount    = int.Parse(ds.Tables[0].Rows[0]["UserCount"].ToString());
                    CompanyCount = int.Parse(ds.Tables[0].Rows[0]["CompanyCount"].ToString());
                    EventCount   = int.Parse(ds.Tables[0].Rows[0]["EventCount"].ToString());
                    LostEvent    = int.Parse(ds.Tables[0].Rows[0]["LostEvent"].ToString());
                    LostTime     = int.Parse(ds.Tables[0].Rows[0]["LostTime"].ToString());
                }
                //查询公告列表
                BllAdActive        AdActive = new BllAdActive();
                List <ModAdActive> list     = AdActive.QueryAll(7);
                //查询待办任务
                List <ModSysFlow> Flowlist = new BllSysFlow().getListAll(7, "");

                ViewData["UserCount"]    = UserCount;
                ViewData["CompanyCount"] = CompanyCount;
                ViewData["EventCount"]   = EventCount;
                ViewData["LostEvent"]    = LostEvent;
                ViewData["LostTime"]     = LostTime;
                ViewData["list"]         = list;
                ViewData["Flowlist"]     = Flowlist;

                return(View());
            }
        }