Пример #1
0
 internal void ClickSaveButton(IntPtr saveButton, bool selectNextNode)
 {
     if (saveButton != IntPtr.Zero)
     {
         ApiSetter.ClickButton(saveButton, _handle, (state) =>
         {
             SaveDialog_3C fill = FillDialog_3C.GetFillDialog(CCCWindowType.SaveWindow, this, processId) as SaveDialog_3C;
             if (string.IsNullOrEmpty(fill.Message) || fill.Message.Contains("保存成功") == false)
             {
                 _state = FillState.Waiting;
                 if (_asyncHandle != null)
                 {
                     _asyncHandle.Reset();
                 }
             }
             else
             {
                 fill.DoFillWork(null);
                 if (selectNextNode)
                 {
                     this.SelectNextNode(true);
                 }
             }
         }, null);
     }
     else
     {
         _state = FillState.Waiting;
         if (_asyncHandle != null)
         {
             _asyncHandle.Reset();
         }
     }
 }
Пример #2
0
        private void ConfirmInfoTip(object state)
        {
            uint processId;

            NativeApi.GetWindowThreadProcessId(base.HWnd, out processId);
            FillDialog_3C fill = FillDialog_3C.GetFillDialog(CCCWindowType.InfoTipWindow, base.HWnd, processId);

            fill.DoFillWork(null);
        }
Пример #3
0
        /// <summary>
        /// 对指定节点进行追加。
        /// </summary>
        /// <param name="node">要对其进行追加的节点句柄。</param>
        /// <param name="name">追加的节点的后缀名称。</param>
        public void AppendNode(IntPtr node, string name)
        {
            this.ClickAppendMenu(node);
            FillDialog_3C fill = FillDialog_3C.GetFillDialog(CCCWindowType.InputFileNameWindow, this, processId);

            fill.DoFillWork(new FillValue3C()
            {
                Value = name
            });
        }
Пример #4
0
        private void ListenMultiValueAndNoteWindow(object value)
        {
            _asyncHandle.Reset();
            FillDialog_3C fill = FillDialog_3C.GetFillDialog(CCCWindowType.MultiValueAndNote, this, processId);

            fill.DoFillWork(value);
            if (_asyncHandle != null)
            {
                _asyncHandle.Resume();
            }
        }
Пример #5
0
        /// <summary>
        /// 监听Select类型窗口。
        /// </summary>
        /// <param name="value"></param>
        private void ListenListBoxWindow(object value)
        {
            _asyncHandle.Reset();
            FillDialog_3C fill = FillDialog_3C.GetFillDialog(CCCWindowType.ListCheckBoxWindow, this, processId);

            fill.DoFillWork(value);
            if (_asyncHandle != null)
            {
                _asyncHandle.Resume();
            }
        }
Пример #6
0
        /// <summary>
        /// 监听输入文件名窗口。
        /// </summary>
        /// <param name="value"></param>
        private void ListenInputFileNameWindow(object value)
        {
            _asyncHandle.Reset();
            FillDialog_3C fill = FillDialog_3C.GetFillDialog(CCCWindowType.InputFileNameWindow, this, processId);

            fill.DoFillWork(_pageData["文件名"]);
            if (_asyncHandle != null)
            {
                _asyncHandle.Resume();
            }
        }
Пример #7
0
        /// <summary>
        /// 监听附件窗口
        /// </summary>
        /// <param name="value"></param>
        internal void ListenAttachWindow(object value)
        {
            _asyncHandle.Reset();
            FillDialog_3C fill = FillDialog_3C.GetFillDialog(CCCWindowType.AttachWindow, this, processId);

            fill.DoFillWork(value);
            if (_asyncHandle != null)
            {
                _asyncHandle.Resume();
            }
        }
Пример #8
0
        private void StartFillSelectFirm(object state)
        {
            FillValue3C value = state as FillValue3C;

            if (value != null)
            {
                uint processId;
                NativeApi.GetWindowThreadProcessId(base.HWnd, out processId);
                FillDialog_3C fill = FillDialog_3C.GetFillDialog(CCCWindowType.FirmWindow, processId);
                fill.DoFillWork(value.Value);
            }
        }
Пример #9
0
        private void FillOpenFileDialog(object fileName)
        {
            uint processId;

            NativeApi.GetWindowThreadProcessId(addButton, out processId);
            FillDialog_3C fill = FillDialog_3C.GetFillDialog(CCCWindowType.OpenFileWindow, processId);

            if (fill != null)
            {
                fill.DoFillWork(fileName);
            }
        }
Пример #10
0
 public override bool DoFillWork(object val)
 {
     if (_yesBtn == IntPtr.Zero)
     {
         return(false);
     }
     ApiSetter.ClickButton(_yesBtn, base.HWnd, (state) =>
     {
         SaveDialog_3C fill = FillDialog_3C.GetFillDialog(CCCWindowType.SaveWindow, base.Owner, base.Owner.ProcessId) as SaveDialog_3C;
         if (string.IsNullOrEmpty(fill.Message) || fill.Message.Contains("保存成功") == false)
         {
             base.Owner.Reset();
         }
         else
         {
             fill.DoFillWork(null);
             base.Owner.SelectNextNode(true);
         }
     }, null);
     base.Owner.ClickSaveButton(_yesBtn, true);
     return(true);
 }
Пример #11
0
        private void GetTreeView()
        {
            treeView = main.TreeView;
            FillDialog_3C dialog = null;

            dialog = FillDialog_3C.GetFillDialog(CCCWindowType.PropertyWindow, main, this.processId);
            string category = _data["车辆类别"] == null ? "" : (_data["车辆类别"] as FillValue3C).Value;
            string property = _data["车辆属性"] == null ? "" : (_data["车辆属性"] as FillValue3C).Value;

            dialog.DoFillWork(new string[] { category, property });
            dialog = FillDialog_3C.GetFillDialog(CCCWindowType.InputFileNameWindow, main, this.processId);
            dialog.DoFillWork(new FillValue3C()
            {
                Value = Guid.NewGuid().ToString()
            });
            uint count = 0;

            while (count == 0)
            {
                count = treeView.GetCount();
                System.Threading.Thread.Sleep(500);
            }
        }
Пример #12
0
        private void FillWorker(object state)
        {
            string        windowType = null;
            FillDialog_3C fill       = FillDialog_3C.GetFillDialog(out windowType, processId);

            try
            {
                // 存储数据文件所在目录下的所有文件(不包括子文件夹中的文件)
                _fillParameters = this.ReadFillParameter(state as string);
                TreeValue root = ReadAndConvertData();
                windowType = null;
                FillDialog_3C.BeginListen();
                fill = FillDialog_3C.GetFillDialog(out windowType, processId);
                if (fill != null)
                {
                    if (windowType == CCCWindowType.LoginWindow)
                    {
                        fill.FillValue = _data["厂商关系"] as FillValue3C;
                        fill.DoFillWork(_data["登录证书"]);
                    }
                    else if (windowType == CCCWindowType.FirmWindow)
                    {
                        FillValue3C value = _data["厂商关系"] as FillValue3C;
                        fill.DoFillWork(value == null ? "" : value.Value);
                    }
                }

                main = Main_3C.GetMainWindow(base.DataProvider.DataSourceFile, processId);
                //this.SetWindowPos();
                //main.FileTable = this.files;
                main.FillParameters = this._fillParameters;
                main.Records        = this._records;
                if (main.TreeView.GetCount() == 0)
                {
                    this.GetTreeView();
                }
                else
                {
                    main.UpdateSelectedNode();
                }
                main.TreeValue = root;
                FillDialog_3C.BeginListenSaveRequire(main);
                do
                {
                    System.Threading.Thread.Sleep(200);
                    main.FillPage();
                } while (main.SelectNextNode(true));
                this.EndFill();
                OnFinished(EventArgs.Empty);
                WebFillManager.ShowMessageBox("填报完成!", "消息", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                if (main != null)
                {
                    LogHelper.Write(ex);
                    MessageBox.Show(ex.StackTrace + ex.Message);
                    this.EndFill();
                }
            }
        }