Exemplo n.º 1
0
        private void OpenVideo(Camera getCamera)
        {
            List <IntPtr> handelList = new List <IntPtr>();
            PictureBox    pb         = new PictureBox()
            {
                BackColor = System.Drawing.Color.Black, Margin = new Padding(3, 0, 3, 0), Dock = DockStyle.Fill
            };                                                                                                                                   //Pink 改为 black 2016-3-3 11:25:18……

            handelList.Add(pb.Handle);
            formHostBig.Child = pb;
            if (gCfg == null)
            {
                gCfg = InfoExchange.Clone(cfg);//InitReadVideoConfig();
            }
            gCfg.CameraList.Clear();
            getCamera.Position = "1";
            gCfg.CameraList.Add(getCamera);
            if (_curVideoController != null)
            {
                _curVideoController.Stop();
                _curVideoController.Close();
            }
            _curVideoController = null;
            System.GC.Collect();
            _curVideoController = new VideoController(new FtpConfig(), gCfg, handelList);
            _curVideoController.OnShowErrMsg += _curVideoController_OnShowErrMsg;
            _curVideoController.Open();
            _curVideoController.Start();
        }
Exemplo n.º 2
0
 /// <summary>
 /// 获取图片信息回调方法
 /// </summary>
 /// <param name="asyc"></param>
 private void GetMeasurePhotoCallback(IAsyncResult asyc)
 {
     try
     {
         string strResult = ComHelpClass.ResponseStr(asyc);
         List <PictureModel> pictureInfos = InfoExchange.DeConvert(typeof(List <PictureModel>), strResult) as List <PictureModel>;
         System.Windows.Application.Current.Dispatcher.BeginInvoke(new System.Threading.ThreadStart(() =>
         {
             this.Pictures.ItemsSource = null;
             DownloadImags(pictureInfos);
             this.Pictures.ItemsSource = pictureInfos;
         }
                                                                                                    ));
     }
     catch (Exception ex)
     {
         #region 日志
         LogModel log = new LogModel()
         {
             CreateTime      = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
             Direction       = LogConstParam.Directions_Out,
             FunctionName    = "坐席_历史相似重量信息_获取图片信息回调方法",
             Level           = LogConstParam.LogLevel_Error,
             Msg             = "通过服务读取图片信息失败!原因:" + ex.Message,
             Origin          = LoginUser.Role.Name,
             OperateUserName = LoginUser.Name
         };
         Talent.ClinetLog.SysLog.Log(JsonConvert.SerializeObject(log));
         #endregion
     }
 }
        public async void GetMaterialsBySelectType()
        {
            string typeId = SelectedType.Id.ToString();

            HqlQuerySetting qsMaterial = new HqlQuerySetting();

            qsMaterial.QueryString = string.Format("select r from SMES.FrameworkAdpt.MaterialChooseControl.MaterialModelAdpt r where r.MaterialType.Id = {0} and r.IsUsed = true", typeId);

            SynInvokeWcfService wcf = new SynInvokeWcfService();
            var resultMaterial      = await wcf.Invoke <MDF.Framework.Db.IDatabaseService>(c => c.Query(qsMaterial));

            if (resultMaterial.IsSuccess)
            {
                var list = InfoExchange.DeConvert <List <MaterialModelAdpt> >(resultMaterial.InfoMessage, InfoExchange.SetingsKonwnTypesBinder);

                SetVisbleDatas(list);

                MaterialsTemp = list;

                list.Insert(0, new MaterialModelAdpt()
                {
                    Id = -1, Name = "请选择", Cd = ""
                });
                this.ItemSource = list;

                QueryBySerachText();
            }
        }
        public async void LoadDatas()
        {
            SynInvokeWcfService wcf = new SynInvokeWcfService();
            var result = await wcf.Invoke <IComMaterialTypeService>(c => c.GetMaterialTypes(GetMaterialTypeIds()));

            if (result.IsSuccess)
            {
                var list = InfoExchange.DeConvert <List <MaterialTypeModelAdpt> >(result.InfoMessage, InfoExchange.SetingsKonwnTypesBinder);
                MaterialTypes = list;
            }
        }
        public async void GetEquipmentTypes()
        {
            var typeIds = QueryEquipmentTypeIds;

            SynInvokeWcfService wcf = new SynInvokeWcfService();
            var result = await wcf.Invoke <IEquipmentService>(c => c.GetTypes(typeIds));

            if (result.IsSuccess)
            {
                var list = InfoExchange.DeConvert <List <EquipmentTypeModelFAdpt> >(result.InfoMessage, InfoExchange.SetingsKonwnTypesBinder);
                EquipmentTypes = list;
            }
        }
Exemplo n.º 6
0
 /// <summary>
 /// 保存之后回调
 /// </summary>
 private void saveInfoCallback(IAsyncResult asyc)
 {
     try
     {
         string strResult       = ComHelpClass.ResponseStr(asyc);
         var    getServiceModel = InfoExchange.DeConvert(typeof(MeasureServiceModel), strResult) as MeasureServiceModel;
         System.Windows.Application.Current.Dispatcher.Invoke(new Action(() =>
         {
             if (getServiceModel.success)
             {
                 #region 日志
                 LogModel log = new LogModel()
                 {
                     CreateTime      = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                     Direction       = LogConstParam.Directions_OutIn,
                     FunctionName    = "坐席_历史相似重量信息_保存信息",
                     Level           = LogConstParam.LogLevel_Info,
                     Msg             = "相似重量保存信息成功:用户备注:" + this.msgTxt.Text.Trim() + "  物流号集合:" + GetMatchidList(),
                     Origin          = LoginUser.Role.Name,
                     OperateUserName = LoginUser.Name,
                 };
                 Talent.ClinetLog.SysLog.Log(JsonConvert.SerializeObject(log));
                 #endregion
                 this.Close();
             }
             else
             {
                 #region 日志
                 LogModel log = new LogModel()
                 {
                     CreateTime      = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                     Direction       = LogConstParam.Directions_OutIn,
                     FunctionName    = "坐席_历史相似重量信息_保存信息",
                     Level           = LogConstParam.LogLevel_Warning,
                     Msg             = "相似重量保存信息失败,原因:" + getServiceModel.msg,
                     Origin          = LoginUser.Role.Name,
                     OperateUserName = LoginUser.Name,
                     Data            = getServiceModel
                 };
                 Talent.ClinetLog.SysLog.Log(JsonConvert.SerializeObject(log));
                 #endregion
                 MessageBox.Show(getServiceModel.msg);
             }
         }));
     }
     catch
     {
     }
 }