示例#1
0
        public ActionResult GetHallConfig(string hallNo)
        {
            var monHallService = new MON_HALL_DAL();
            var tabDefs        = monHallService.GetHallTabDefs(hallNo);
            var cameraDefs     = monHallService.GetHallCameraDefs(hallNo);

            var list = new List <HallConfig>();

            list.AddRange(tabDefs.Select(m => new HallTabConfig()
            {
                HallNo  = m.HALL_NO,
                IconUrl = m.ICON_URL,
                Id      = m.COUNTER_ID,
                Type    = 1,
                X       = m.HORIZ_SIGN,
                Y       = m.VERTI_SIGN
            }));

            list.AddRange(cameraDefs.Select(m => new HallCameraConfig()
            {
                HallNo         = m.HALL_NO,
                IconUrl        = m.ICON_URL,
                Id             = m.SEQ,
                Type           = 0,
                X              = m.HORIZ_SIGN,
                Y              = m.VERTI_SIGN,
                DirType        = m.DIR_TYP == null ? 0 : (int)m.DIR_TYP.Value,
                CgiProtpcpl    = m.CGI_PROTOCOL,
                ChannelId      = m.CHANNEL_ID,
                HttpProtocol   = m.HTTP_PROTOCOL,
                Ip             = m.IP_ADDRESS,
                Iport          = m.IPORT,
                MonCounter     = m.MON_COUNTER,
                Password       = m.USER_PASSWORD,
                RtspPort       = m.RTSP_PORT,
                StringType     = m.STRING_TYP,
                UserName       = m.USER_NAME,
                ZeroChannelInd = m.ZERO_CHANNEL_IND,
                CameraType     = m.CAMERA_TYP,
                MonShowing     = m.MON_SHOW_IND,
                CameraName     = m.CAMERA_NAM
            }));

            return(Json(list, JsonRequestBehavior.AllowGet));
        }
示例#2
0
        public ActionResult Index(string orgId, string hallNo)
        {
            var hall = new SYS_HALL();

            if (!string.IsNullOrEmpty(orgId))
            {
                hall = DaoHall.GetEntity("ORG_ID", orgId);
            }
            else if (!string.IsNullOrEmpty(hallNo))
            {
                hall = DaoHall.GetEntity("HALL_NO", hallNo);
            }

            //if (hall == null)
            //{
            //    return HttpNotFound("Page Not Found");
            //}
            hallNo = hall.HALL_NO;
            var monHallService = new MON_HALL_DAL();
            var tabDefs        = monHallService.GetHallTabDefs(hallNo);
            var cameraDefs     = monHallService.GetHallCameraDefs(hallNo);

            var tabList = tabDefs.Select(m => new HallTabConfig()
            {
                HallNo       = m.HALL_NO,
                IconUrl      = m.ICON_URL,
                Id           = m.COUNTER_ID,
                Type         = 1,
                X            = m.HORIZ_SIGN,
                Y            = m.VERTI_SIGN,
                CameraConfig = getCameraConfig(cameraDefs, m.COUNTER_ID)
            }).ToList();

            var cameraList = cameraDefs.Where(m => !m.MON_SHOW_IND).Select(m => new HallCameraConfig()
            {
                HallNo         = m.HALL_NO,
                IconUrl        = m.ICON_URL,
                Id             = m.SEQ,
                Type           = 0,
                X              = m.HORIZ_SIGN,
                Y              = m.VERTI_SIGN,
                DirType        = m.DIR_TYP == null ? 0 : (int)m.DIR_TYP.Value,
                CgiProtpcpl    = m.CGI_PROTOCOL,
                ChannelId      = m.CHANNEL_ID,
                HttpProtocol   = m.HTTP_PROTOCOL,
                Ip             = m.IP_ADDRESS,
                Iport          = m.IPORT,
                MonCounter     = m.MON_COUNTER,
                Password       = m.USER_PASSWORD,
                RtspPort       = m.RTSP_PORT,
                StringType     = m.STRING_TYP,
                UserName       = m.USER_PASSWORD,
                ZeroChannelInd = m.ZERO_CHANNEL_IND,
                CameraType     = m.CAMERA_TYP,
                MonShowing     = m.MON_SHOW_IND
            }).ToList();

            var virtualHall = new VirtualHall()
            {
                HallNo            = hall.HALL_NO,
                HallName          = hall.HALL_NAM,
                ImageUrl          = hall.HALL_PICT_URL,
                HallTabConfigs    = tabList,
                HallCameraConfigs = cameraList
            };

            return(View(virtualHall));
        }