示例#1
0
 /// <summary>
 /// 获取用户配置的报警图片路径
 /// </summary>
 /// <param name="datas"></param>
 /// <returns></returns>
 public string GetSetImageUrl(string setName)
 {
     LumluxSSYDB.BLL.tPrjectSet   set_bll = new LumluxSSYDB.BLL.tPrjectSet();
     LumluxSSYDB.Model.tPrjectSet set_mod = set_bll.GetModelByWhere(PrjGUID, setName);
     if (set_mod != null)
     {
         return(set_mod.sValue);
     }
     return("2.png");
 }
示例#2
0
 public string GetLat(string setkey)
 {
     LumluxSSYDB.BLL.tPrjectSet   set_bll = new LumluxSSYDB.BLL.tPrjectSet();
     LumluxSSYDB.Model.tPrjectSet set_mod = set_bll.GetModelByWhere(PrjGUID, setkey);
     if (set_mod != null)
     {
         return(set_mod.sValue);
     }
     return("31.064698120353743");
 }
示例#3
0
 public string GetLng(string setkey)
 {
     LumluxSSYDB.BLL.tPrjectSet   set_bll = new LumluxSSYDB.BLL.tPrjectSet();
     LumluxSSYDB.Model.tPrjectSet set_mod = set_bll.GetModelByWhere(PrjGUID, setkey);
     if (set_mod != null)
     {
         return(set_mod.sValue);
     }
     return("120.6298828125");
 }
示例#4
0
 public string GetSetValue(string setName, string sFeild)
 {
     LumluxSSYDB.BLL.tPrjectSet   set_bll = new LumluxSSYDB.BLL.tPrjectSet();
     LumluxSSYDB.Model.tPrjectSet set_mod = set_bll.GetModelByWhere(PrjGUID, setName);
     if (set_mod != null)
     {
         if (sFeild == "sValue")
         {
             return(set_mod.sValue);
         }
         if (sFeild == "sDesc")
         {
             return(set_mod.sDesc);
         }
     }
     return("");
 }
示例#5
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
        }
示例#6
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());
        }
示例#7
0
        /// <summary>
        /// 获取主机报了警的单灯总个数
        /// </summary>
        /// <param name="hostGUID"></param>
        /// <returns></returns>
        public int GetLightCountByHostGUID(string hostGUID, string IsAlarm)
        {
            int alarmCount = 0;

            LumluxSSYDB.BLL.tLightInfoes light_bll = new LumluxSSYDB.BLL.tLightInfoes();
            DataTable dt = light_bll.GetLightByWhereInfo(" li.iEnable=1 and sHostInfoGUID='" + hostGUID + "'");

            if (dt != null)
            {
                LumluxSSYDB.BLL.tPrjectSet   set_bll = new LumluxSSYDB.BLL.tPrjectSet();
                LumluxSSYDB.Model.tPrjectSet set_mod = new LumluxSSYDB.Model.tPrjectSet();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    int RealTimeAlarm_Fault = Convert.ToInt32(ToString(dt.Rows[i]["iRealTimeAlarm_Fault"]) == "" ? "-1" : ToString(dt.Rows[i]["iRealTimeAlarm_Fault"]));
                    set_mod = set_bll.GetModelByWhere(PrjGUID, "Light_IsAlarm_" + RealTimeAlarm_Fault.ToString("D4"));
                    if (set_mod != null && set_mod.sValue == "Alarm")
                    {
                        alarmCount = alarmCount + 1;
                    }
                }
            }
            return(alarmCount);
        }
示例#8
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());
        }
示例#9
0
        public ActionResult Index(string startDate, string endDate, string hostWhere, string alarmWhere, string LightName)
        {
            string   strLightName;
            DateTime dtStart;
            DateTime dtEnd;

            VStartAndEndTime(startDate, endDate, out dtStart, out dtEnd);
            if (!string.IsNullOrWhiteSpace(LightName))
            {
                strLightName = " li.sName like '%" + LightName + "%' and ";
            }
            else
            {
                strLightName = " 1=1 and ";
            }
            LumluxSSYDB.BLL.tPrjectSet light_bll = new LumluxSSYDB.BLL.tPrjectSet();
            DataTable          dt   = null;
            List <FailureInfo> list = new List <FailureInfo>();

            if (!string.IsNullOrWhiteSpace(hostWhere) && !string.IsNullOrWhiteSpace(alarmWhere))
            {
                //int iWherebyhost;
                string strWherebyalarm = "";

                strWherebyalarm += "(";

                string[] s = alarmWhere.Split(new char[] { ',' });

                for (int i = 0; i < s.Length; i++)
                {
                    if (s[i] != "")
                    {
                        strWherebyalarm += "'" + s[i] + "',";
                    }
                }
                if (strWherebyalarm != "")
                {
                    strWherebyalarm = strWherebyalarm.Remove(strWherebyalarm.LastIndexOf(","), 1);
                }
                strWherebyalarm += ")";
                dt = light_bll.GetTableByWhere("sPrjectGUID='" + PrjGUID + "' and sKey in " + strWherebyalarm);

                if (dt != null)
                {
                    list = GetListData(dt, PrjGUID, hostWhere, alarmWhere, dtStart, dtEnd, strLightName);
                }
                LumluxSSYDB.BLL.tLightInfoes blllight = new LumluxSSYDB.BLL.tLightInfoes();
                if (list.Count > 0)
                {
                    int x = 0;
                    for (int i = 0; i < list.Count; i++)
                    {
                        if (list[i].sValue == "0")
                        {
                            x = x + 1;
                        }
                    }
                    if (x == list.Count)
                    {
                        FailureInfo fInfos = new FailureInfo();
                        fInfos.sKey   = "当前无数据";
                        fInfos.sValue = "100";
                        list.Add(fInfos);
                        return(this.Json(list));
                    }
                    else
                    {
                        return(this.Json(list));
                    }
                }
            }
            FailureInfo fInfo = new FailureInfo();

            fInfo.sKey   = "请选择条件统计";
            fInfo.sValue = "100";
            list.Add(fInfo);
            return(this.Json(list));
        }