Esempio n. 1
0
        /// <summary>
        /// 更新设备信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static AdvertManage.Model.Enum.HandleResult UpdateDeviceModel(AdvertManage.Model.AMS_DeviceModel model)
        {
            IWCFService.IAdvertManageService advertService = WcfAccessProxy.AMS_ServiceProxy.CreateChannelAdvertManageService();
            bool error = false;

            try
            {
                return(advertService.UpdateDeviceModel(model));
            }
            catch (Exception ex)
            {
                error = true;
                SeatManage.SeatManageComm.WriteLog.Write(string.Format("根据学校编号获取设备列表遇到错误,异常来自:{0};信息:{1}", ex.Source, ex.Message));
                throw ex;
            }
            finally
            {
                ICommunicationObject ICommObjectService = advertService as ICommunicationObject;
                try
                {
                    if (ICommObjectService.State == CommunicationState.Faulted)
                    {
                        ICommObjectService.Abort();
                    }
                    else
                    {
                        ICommObjectService.Close();
                    }
                }
                catch
                {
                    ICommObjectService.Abort();
                }
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 更新设备状态
 /// </summary>
 /// <param name="DeviceNo"></param>
 /// <param name="stateUpdateTime"></param>
 /// <returns></returns>
 public AdvertManage.Model.Enum.HandleResult UpdateDeviceStatus(string DeviceNo, DateTime stateUpdateTime)
 {
     AdvertManage.Model.AMS_DeviceModel model = GetDevicebyNo(DeviceNo);
     if (model == null)
     {
         return(HandleResult.Failed);
     }
     model.CaputreTime = stateUpdateTime;
     return(UpdateDeviceModel(model));
 }
Esempio n. 3
0
 /// <summary>
 /// 更新设备处理结果
 /// </summary>
 /// <param name="schoolNum"></param>
 /// <param name="model"></param>
 /// <returns></returns>
 public HandleResult UpdateDeviceModel(AdvertManage.Model.AMS_DeviceModel model)
 {
     try
     {
         if (deviceModel.Update(model))
         {
             return(HandleResult.Successed);
         }
         else
         {
             return(HandleResult.Failed);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 4
0
        /// <summary>
        /// 上传设备截图
        /// </summary>
        /// <returns></returns>
        public static bool UpdateCaputre()
        {
            try
            {
                List <SeatManage.ClassModel.TerminalInfo> terminalList = SeatManage.Bll.ClientConfigOperate.GetTerminalsInfo();
                SeatManage.Bll.FileOperate seatfileTransport           = new SeatManage.Bll.FileOperate();
                BLL.FileOperate            advertTransport             = new BLL.FileOperate();
                foreach (SeatManage.ClassModel.TerminalInfo terminal in terminalList)
                {
                    if (!string.IsNullOrEmpty(terminal.ScreenshotPath))
                    {
                        AdvertManage.Model.AMS_DeviceModel model = AdvertManage.BLL.AMS_DeviceBLL.GetDevicebyNo(terminal.ClientNo);
                        if (model == null)
                        {
                            return(true);//如果媒体服务器上获取不到信息,直接返回true,以便结束命令。
                        }

                        string fileFullName = string.Format("{0}{1}", ServiceSet.TempFilePath, terminal.ScreenshotPath);
                        if (seatfileTransport.FileDownLoad(fileFullName, terminal.ScreenshotPath, SeatManage.EnumType.SeatManageSubsystem.Caputre))
                        {
                            if (advertTransport.UpdateFile(fileFullName, terminal.ScreenshotPath, SeatManage.EnumType.SeatManageSubsystem.Caputre))
                            {
                                File.Delete(fileFullName);
                                //上传完成,更新一下截图路径。
                                model.CaputrePath = terminal.ScreenshotPath;
                                AdvertManage.BLL.AMS_DeviceBLL.UpdateDeviceModel(model);
                            }
                        }
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }