Пример #1
0
        public string GetMaxLng(string hostGUID)
        {
            object ob = DbHelperSQL.GetSingle("select max(fLng) from tLightInfoes where iEnable=1 and sHostInfoGUID='" + hostGUID + "'");

            LumluxSSYDB.BLL.tHostInfo   host_bll = new LumluxSSYDB.BLL.tHostInfo();
            LumluxSSYDB.Model.tHostInfo host_mod = host_bll.GetModel(hostGUID);
            if (ob != null)
            {
                return(comMax(Convert.ToSingle(ob.ToString()), Convert.ToSingle(host_mod.fLng)));
            }

            return("");
        }
Пример #2
0
        public ControllerBaseHelper()
            : base()
        {
            List <HostInfoVM> list = new List <HostInfoVM>();

            LumluxSSYDB.BLL.tHostInfo bllhost = new LumluxSSYDB.BLL.tHostInfo();
            #region 加载顶部所有单灯报警
            DataTable allhostalarmdt = bllhost.GetHostInfo("dbo.tHostInfo.sProjectInfoGUID='" + PrjGUID + "' and dbo.tHostInfo.iState_Online=1 and dbo.tHostInfo.iState_Alarm=1");

            if (allhostalarmdt != null)
            {
                allhostalarmdt.Columns.Add("hostByLightCount");
                allhostalarmdt.Columns.Add("hostByAlarmLightCount");
                HostInfoVM hvms;
                foreach (DataRow dr in allhostalarmdt.Rows)
                {
                    hvms = addInfo(dr);
                    list.Add(hvms);
                }
                ViewBag.allAlarmhostlist = list;
            }
            else
            {
                ViewBag.allAlarmhostlist = new List <HostInfoVM>();
            }
            #endregion
            #region 加载该项目的logo图片
            LumluxSSYDB.BLL.tPrjectSet   set_bll = new LumluxSSYDB.BLL.tPrjectSet();
            LumluxSSYDB.Model.tPrjectSet set_mod = set_bll.GetModelByWhere(PrjGUID, "logoMain_0001");
            if (set_mod != null)
            {
                ViewBag.logoMain = set_mod.sValue;
            }
            else
            {
                ViewBag.logoMain = imageurl;
            }
            #endregion
            #region 用户相关
            ViewBag.UserName      = this.UserName;
            ViewBag.UserAuthority = this.UserAuthority;
            #endregion
        }
Пример #3
0
        //
        // GET: /Lamp/FailureRate/

        public ActionResult Index()
        {
            LumluxSSYDB.BLL.tHostInfo lbt = new LumluxSSYDB.BLL.tHostInfo();
            //and iState_Alarm=1
            List <LumluxSSYDB.Model.tHostInfo> listhost = lbt.GetModelList("sProjectInfoGUID='" + PrjGUID + "' and iState_Enable= '" + (int)StateEnable.Enable + "'");;

            if (listhost.Count > 0)
            {
                ViewBag.vHost = listhost;
            }
            else
            {
                ViewBag.vHost = new List <LumluxSSYDB.Model.tHostInfo>();
            }

            List <PrjectSetInfoVM> pslist = new List <PrjectSetInfoVM>();

            LumluxSSYDB.BLL.tPrjectSet light_bll = new LumluxSSYDB.BLL.tPrjectSet();

            LightsViewModel lightVM = new LightsViewModel();
            DataTable       dt      = light_bll.GetTableByWhere("sPrjectGUID='" + PrjGUID + "' and sKey like  '%Light_Image_%'");

            if (dt != null)
            {
                PrjectSetInfoVM psm;
                foreach (DataRow dr in dt.Rows)
                {
                    psm = addprjectsetInfo(dr);
                    pslist.Add(psm);
                }
                ViewBag.AlarmDemos = pslist;
            }
            else
            {
                ViewBag.AlarmDemos = new List <PrjectSetInfoVM>();
            }
            return(View());
        }
Пример #4
0
        //
        // GET: /Lamp/AlarmPage/

        public ActionResult Index()
        {
            string   strLightName = " 1=1 and ";
            string   curTime      = DateTime.Now.ToString("yyyy-MM-dd");
            DateTime dtStart      = DateTime.Now.AddDays(-7);//DateTime.Parse("1999-01-01");
            DateTime dtEnd        = DateTime.Parse(curTime).Add(new TimeSpan(23, 59, 59));

            if (Request.QueryString["sGUID"] != null)
            {
                ViewBag.sHostGUID = Request.QueryString["sGUID"].ToString();
                AlarmSelectedGUID = Request.QueryString["sGUID"].ToString();

                LumluxSSYDB.BLL.tHostInfo   thostbll  = new LumluxSSYDB.BLL.tHostInfo();
                LumluxSSYDB.Model.tHostInfo thostmode = thostbll.GetModel(AlarmSelectedGUID);
                if (thostmode != null)
                {
                    ViewBag.HostNames = thostmode.sName;
                }

                //getdataresource gd = new getdataresource();
                //PagingHelper<AlarmInfo> DataPaging = new PagingHelper<AlarmInfo>(10, GetDataSouceByTime(AlarmSelectedGUID, dtStart, dtEnd, 10));
                List <AlarmInfo> DataPaging = GetDataSouceByTime(PrjGUID, AlarmSelectedGUID, dtStart, dtEnd, 0, strLightName);
                ViewBag.CurPageIndex = 1;//当前页
                ViewBag.CurPageIndex = 1;
                if (DataPaging.Count > 0)
                {
                    ViewBag.iCount = DataPaging[0].iCount;//总记录
                    ViewBag.iPage  = (int)Math.Ceiling(Convert.ToInt32(DataPaging[0].iCount) / (double)10);
                    ViewBag.Alarms = DataPaging;
                }
                else
                {
                    ViewBag.iCount = 0;//总记录
                    ViewBag.iPage  = 0;
                    ViewBag.Alarms = new List <AlarmInfo>();
                }
                ViewBag.vHost = new List <LumluxSSYDB.Model.tHostInfo>();
            }
            else
            {
                #region MyRegion
                LumluxSSYDB.BLL.tHostInfo lbt = new LumluxSSYDB.BLL.tHostInfo();
                //and iState_Alarm=1
                List <LumluxSSYDB.Model.tHostInfo> listhost = lbt.GetModelList("sProjectInfoGUID='" + PrjGUID + "' and iState_Enable='" + (int)StateEnable.Enable + "' ");;
                if (listhost.Count > 0)
                {
                    ViewBag.vHost = listhost;
                }
                else
                {
                    ViewBag.vHost = new List <LumluxSSYDB.Model.tHostInfo>();
                }
                #endregion
                // ViewBag.Alarms = new List<AlarmInfo>();
                List <AlarmInfo> DataPagingall = GetDataSouceByTime(PrjGUID, dtStart, dtEnd, 0, strLightName);
                ViewBag.CurPageIndex = 1;;     //当前页
                ViewBag.HostNames    = "单灯信息"; //"全部主机";
                if (DataPagingall.Count > 0)
                {
                    ViewBag.iCount = DataPagingall[0].iCount;                                                  //总记录
                    ViewBag.iPage  = (int)Math.Ceiling(Convert.ToInt32(DataPagingall[0].iCount) / (double)10); //总页数
                    ViewBag.Alarms = DataPagingall;
                }
                else
                {
                    ViewBag.iCount = 0;//总记录
                    ViewBag.iPage  = 0;
                    ViewBag.Alarms = new List <AlarmInfo>();
                }
            }
            #region MyRegion
            List <PrjectSetInfoVM>     pslist    = new List <PrjectSetInfoVM>();
            LumluxSSYDB.BLL.tPrjectSet light_bll = new LumluxSSYDB.BLL.tPrjectSet();
            LightsViewModel            lightVM   = new LightsViewModel();
            DataTable dt = light_bll.GetTableByWhere("sPrjectGUID='" + PrjGUID + "' and sKey like  '%Light_Image_%'");
            if (dt != null)
            {
                PrjectSetInfoVM psm;
                foreach (DataRow dr in dt.Rows)
                {
                    psm = addprjectsetInfo(dr);
                    pslist.Add(psm);
                }
                ViewBag.AlarmDemos = pslist;
            }
            else
            {
                ViewBag.AlarmDemos = new List <PrjectSetInfoVM>();
            }
            #endregion
            return(View());
        }
Пример #5
0
        //
        // GET: /Lamp/TimeControl/

        public ActionResult Index()
        {
            #region 加载左侧所有主机信息

            ViewBag.PrjectGUID = PrjGUID;
            LumluxSSYDB.BLL.tHostInfo         bllhost       = new LumluxSSYDB.BLL.tHostInfo();
            List <HostInfoVM>                 list          = new List <HostInfoVM>();
            List <TimeInterval>               TableOTList   = new List <TimeInterval>();
            List <TimeInterval>               TableTTList   = new List <TimeInterval>();
            LumluxSSYDB.BLL.tLightGroupInfoes blllightgroup = new LumluxSSYDB.BLL.tLightGroupInfoes();
            LumluxSSYDB.BLL.tRelayInfoes      lbt           = new LumluxSSYDB.BLL.tRelayInfoes();
            //mainVM.MapCenterLat = GetLat("Prject_CenterPoint_Lat");
            //mainVM.MapCenterLng = GetLng("Prject_CenterPoint_Lng");
            DataTable allhostdt = bllhost.GetHostInfo("dbo.tHostInfo.sProjectInfoGUID='" + PrjGUID + "'");

            if (allhostdt != null)
            {
                allhostdt.Columns.Add("hostByLightCount");
                allhostdt.Columns.Add("hostByAlarmLightCount");
                HostInfoVM hvm;
                foreach (DataRow dr in allhostdt.Rows)
                {
                    hvm = addInfo(dr);

                    list.Add(hvm);
                }
            }
            #endregion

            if (list.Count > 0)
            {
                ViewBag.hostlist = list;

                // 初始化主机下的24个时段
                InitTimeControl(list[0].GUID);
                if (!lbt.ExistLoop(list[0].GUID))
                {
                    AddLoop(lbt, list[0].GUID);
                }
                ViewBag.LightGroup = blllightgroup.GetModelListByHostGUID(list[0].GUID) == null ? (new List <LumluxSSYDB.Model.tLightGroupInfoes>()) : (blllightgroup.GetModelListByHostGUID(list[0].GUID));
                if (Convert.ToInt32(list[0].iHardware_Type) == Convert.ToInt32(EnumClass.SYType.eSixLoop))
                {
                    ViewBag.LoopInfo = lbt.GetModelList(" sHostInfoGUID='" + list[0].GUID + "' and iID between 0 and 6 order by iID") == null ? (new List <LumluxSSYDB.Model.tRelayInfoes>()) : lbt.GetModelList(" sHostInfoGUID='" + list[0].GUID + "' and iID between 0 and 6 order by iID");
                }
                else
                {
                    ViewBag.LoopInfo = lbt.GetModelList(" sHostInfoGUID='" + list[0].GUID + "' and iID  between 0 and 3 order by iID") == null ? (new List <LumluxSSYDB.Model.tRelayInfoes>()) : lbt.GetModelList(" sHostInfoGUID='" + list[0].GUID + "' and iID  between 0 and 3 order by iID");
                }
                //查询单灯分组
                //List<LumluxSSYDB.Model.tLightGroupInfoes> dt2 =
            }
            else
            {
                ViewBag.hostlist   = new List <HostInfoVM>();
                ViewBag.TableOT    = new List <TimeInterval>();
                ViewBag.TableTT    = new List <TimeInterval>();
                ViewBag.LightGroup = new List <LumluxSSYDB.Model.tLightGroupInfoes>();
                ViewBag.LoopInfo   = new List <LumluxSSYDB.Model.tRelayInfoes>();
            }
            return(View());
        }