예제 #1
0
        /// <summary>
        /// 上级单位 首页
        /// </summary>
        /// <returns></returns>
        public ActionResult ParentIndex()
        {
            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(new MasterContext().Master.Cid);
                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());
                }
                //查询广告列表
                BllEDynamic        bllDynamic = new BllEDynamic();
                List <ModEDynamic> list       = bllDynamic.getListAll(9);
                //查询待办任务
                List <ModSysFlow> Flowlist = new BllSysFlow().getListAll(7, " and CompanyId='" + new MasterContext().Master.Cid + "'");

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

                ViewData["Flowlist"] = Flowlist;

                return(View());
            }
        }
예제 #2
0
        /// <summary>
        /// 广告浏览
        /// </summary>
        /// <returns></returns>
        public ActionResult AdvertiseView()
        {
            BllAdActive Bll = new BllAdActive();

            string key = "";

            if (!String.IsNullOrEmpty(Request["Id"]))
            {
                key = Request["Id"].ToString();
            }
            var model = Bll.GetModelByWhere(" and Id='" + key + "'");

            ViewData["Name"]           = model.ActiveName;
            ViewData["ActionTypeName"] = model.ActionFormName;
            ViewData["CreateTime"]     = Convert.ToDateTime(model.CreateTime).ToString("yyyy-MM-dd hh:mm");
            ViewData["Img"]            = model.Img;
            ViewData["ReadNum"]        = 0;
            switch (model.ActionType)
            {
            case 1:
            case 2:
                ViewData["Info"] = model.Info;
                break;

            case 3:
                var Dymaic = new BllEDynamic().LoadData(model.ActionFormId);
                ViewData["Info"] = Dymaic.Content;
                break;
            }
            LogInsert(OperationTypeEnum.访问, "广告预览模块", "访问页面成功.");
            return(View());
        }
예제 #3
0
        //法律、新闻、消费知识 文档类型(2:消防知识 3:新闻管理 4:法律法规)
        //[HttpGet]
        public JsonResult GetDynamic(string GroupId)
        {
            try
            {
                LogErrorRecord.InfoFormat("参数请求url:{0}", Request.Url);
                LogErrorRecord.InfoFormat("参数参数:GroupId={0}", GroupId);
                CheckParams(GroupId, "文档类型不能为空!");
                BllEDynamic bllEDynamic = new BllEDynamic();
                if (jsonResult.success)
                {
                    Search search = GetSearch();
                    search.AddCondition("GroupId='" + GroupId + "'");

                    Page <ModEDynamic> r = bllEDynamic.GetDynamic(search);
                    jsonResult.data = r.Items;


                    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));
        }
예제 #4
0
        //页面(法律、新闻、消费知识)
        public ActionResult PageDynamic(string id)
        {
            BllEDynamic bllEDynamic = new BllEDynamic();
            var         mod         = bllEDynamic.LoadData(id);

            if (mod != null)
            {//修改阅读数
                mod.ReadNum++;
                bllEDynamic.Update(mod);
            }
            return(View(mod));
        }
예제 #5
0
파일: Expired.cs 프로젝트: chrgu000/bellali
 /// <summary>
 /// 开始作业调度
 /// </summary>
 public void StartJobScheduling()
 {
     try
     {
         DateTime now = DateTime.Now;
         //查询设备
         BllEDynamic bll = new BllEDynamic();
         var         ds  = bll.GetList("E_Dynamic", " and ShowType=2 and Status=1 and ActiveEndTime<getdate()", "", 10);
         if (ds.Tables[0].Rows.Count > 0)
         {
             for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
             {
                 string sql = "update E_Dynamic set Status=2 where Id='" + ds.Tables[0].Rows[i]["Id"].ToString() + "'";
                 bll.ExecuteNonQueryByText(sql);
                 Console.WriteLine("新闻ID:" + ds.Tables[0].Rows[i]["Id"] + "自动过期.已下架");
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("异常了,异常信息:" + ex);
     }
 }