Example #1
0
 private void FillValue(string key, IntPtr rowNumber, Page9_13_3_Relation relation, Page9_13_3Value value)
 {
     if (ApiSetter.SetComboBoxSelected(base.HWnd, rowNumber, key) == false)
     {
         return;
     }
     ApiSetter.SetText(relation.CarStructOuterSide_DFP, value.CarStructOuterSide_DFP);
     ApiSetter.SetText(relation.SeatStructOuterSide_DFP, value.SeatStructOuterSide_DFP);
     ApiSetter.SetText(relation.CarStructInnerSide_DFP, value.CarStructInnerSide_DFP);
     ApiSetter.SetText(relation.SeatStructInnerSide_DFP, value.SeatStructInnerSide_DFP);
     if (string.IsNullOrEmpty(value.CarStruct_UFP) && string.IsNullOrEmpty(value.SeatStruct_UFP))
     {
         ApiSetter.ClickButton(relation.UpperFixedPoint, base.HWnd, null, null);  // 上固定点不适用
     }
     else
     {
         long style = NativeApi.GetWindowLong(relation.CarStruct_UFP, -16);
         if ((style & WindowStyles.WS_DISABLED) == WindowStyles.WS_DISABLED)
         {
             ApiSetter.ClickButton(relation.UpperFixedPoint, base.HWnd, null, null);
         }
         ApiSetter.SetText(relation.CarStruct_UFP, value.CarStruct_UFP);
         ApiSetter.SetText(relation.SeatStruct_UFP, value.SeatStruct_UFP);
     }
 }
Example #2
0
 private void FillValue(string key, IntPtr rowNumber, Page9_12_2_Relation relation, Page9_12_2Value value)
 {
     if (ApiSetter.SetComboBoxSelected(base.HWnd, rowNumber, key) == false)
     {
         return;
     }
     ApiSetter.SetText(relation.FrontAirBags, value.FrontAirBags);
     ApiSetter.SetText(relation.SideAirBags, value.SideAirBags);
     ApiSetter.SetText(relation.SeatBeltPreloader, value.SeatBeltPreloader);
 }
Example #3
0
 private void FillValue(string key, IntPtr rowNumber, Page9_12_1_Relation relation, Page9_12_1Value value)
 {
     if (ApiSetter.SetComboBoxSelected(base.HWnd, rowNumber, key) == false)
     {
         return;
     }
     ApiSetter.SetComboBoxSelected(base.HWnd, relation.Cert, value.Cert);
     ApiSetter.SetText(relation.CertNo, value.CertNo);
     if (string.IsNullOrEmpty(value.Transform))
     {
         ApiSetter.ClickButton(relation.Transform, base.HWnd, null, null);
     }
     else
     {
         ApiSetter.SetText(relation.TransformText, value.Transform);
     }
     ApiSetter.SetComboBoxSelected(base.HWnd, relation.HeightAdj, value.HeightAdj);
     ApiSetter.SetText(relation.Productor, value.Productor);
     ApiSetter.SetText(relation.SeatBeltType, value.SeatBeltType);
     ApiSetter.SetText(relation.Model, value.Model);
     ApiSetter.SetText(relation.RetractorType, value.RetractorType);
     ApiSetter.SetText(relation.RetractorAngle, value.RetractorAngle);
     ApiSetter.SetText(relation.SeatBeltPosition, value.SeatBeltPosition);
     if (string.IsNullOrEmpty(value.SeatBeltPosAttach) == false)
     {
         ApiSetter.ClickButton(relation.SeatBeltPosAttach, base.HWnd, ListenAttachWindow,
                               new FillValue3C()
         {
             PublicAttachFile = value.SeatBeltPosAttach, Separators = FillParameter3C.DefaultSeparators
         });
     }
     ApiSetter.SetText(relation.LockType, value.LockType);
     ApiSetter.SetText(relation.FixedPosNum, value.FixedPosNum);
     ApiSetter.SetText(relation.CCCSignPos, value.CCCSignPos);
     if (string.IsNullOrEmpty(value.SeatBeltPosAttach) == false)
     {
         ApiSetter.ClickButton(relation.CCCSignPosAttach, base.HWnd, ListenAttachWindow,
                               new FillValue3C()
         {
             PublicAttachFile = value.CCCSignPosAttach, Separators = FillParameter3C.DefaultSeparators
         });
     }
     ApiSetter.SetText(relation.CCCSignFixation, value.CCCSignFixation);
 }
Example #4
0
 public virtual bool FillPage()
 {
     if (editRange == IntPtr.Zero)
     {
         return(false);
     }
     if (sheet.ReadFollowingRow(2))
     {
         bool isEmptyRow;
         Dictionary <int, string> values = new Dictionary <int, string>();
         IntPtr ok;
         do
         {
             values.Clear();
             object content;
             isEmptyRow = true;
             string str = "";
             while (sheet.ReadNextCell(false))
             {
                 content = sheet.GetContent();
                 str     = content == null ? "" : content.ToString();
                 if (string.IsNullOrEmpty(str) == false)
                 {
                     isEmptyRow = false;
                 }
                 values.Add(sheet.CurrentCell.ColumnIndex - 1, content == null ? null : content.ToString());
             }
             if (isEmptyRow)
             {
                 continue;
             }
             ApiSetter.ClickButton(add, hwnd, null, null);
             ok = IntPtr.Zero;
             List <IntPtr> list      = ControlSorter.SortContainer(editRange);
             StringBuilder className = new StringBuilder(256);
             int           index     = 0;
             foreach (var handle in list)
             {
                 className.Clear();
                 NativeApi.GetClassName(handle, className, 255);
                 string classNameStr = className.ToString();
                 if (classNameStr.StartsWith(CCCFillManager.ComboBoxClassName))
                 {
                     if (values.ContainsKey(index) && ApiSetter.IsEditable(handle))
                     {
                         ApiSetter.SetComboBoxSelected(hwnd, handle, values[index]);
                         index++;
                     }
                 }
                 else if (classNameStr.StartsWith(CCCFillManager.EditClassName))
                 {
                     if (values.ContainsKey(index) && ApiSetter.IsEditable(handle))
                     {
                         ApiSetter.SetText(handle, values[index]);
                         index++;
                     }
                 }
                 else if (classNameStr.StartsWith(CCCFillManager.ButtonClassName))
                 {
                     StringBuilder text = className.Clear();
                     NativeApi.GetWindowText(handle, text, 255);
                     if (text.ToString() == "确定")
                     {
                         ok = handle;
                     }
                     else if (text.ToString() == "附件" && values.ContainsKey(index) && string.IsNullOrEmpty(values[index]) == false)
                     {
                         ApiSetter.ClickButton(handle, hwnd, ListenAttachWindow,
                                               new FillValue3C()
                         {
                             PublicAttachFile = values[index], Separators = FillParameter3C.DefaultSeparators
                         });
                     }
                 }
             }
             if (ok != IntPtr.Zero)
             {
                 ApiSetter.ClickButton(ok, hwnd, null, null);
             }
         } while (sheet.ReadNextRow());
         this.Main.ClickSaveButton(this.Save);
         return(true);
     }
     return(false);
 }
Example #5
0
        public bool FillPage()
        {
            Hashtable columnHeader = new Hashtable();
            object    content;

            if (sheet.ReadNextRow())
            {
                while (sheet.ReadNextCell(false))
                {
                    content = sheet.GetContent();
                    columnHeader.Add(sheet.CurrentCell.ColumnIndex, content == null ? "" : content.ToString());
                }
            }
            FillData      data      = new FillData();
            List <IntPtr> controls  = GetFillControls();
            int           index     = 0;
            StringBuilder className = new StringBuilder(256);

            while (sheet.ReadNextRow())
            {
                int fillCount = 0;
                while (sheet.ReadNextCell(false))
                {
                    content = sheet.GetContent();
                    switch (columnHeader[sheet.CurrentCell.ColumnIndex] as string)
                    {
                    case "用符号识别(选择(是、否、不适用))":
                        data.SymbolIdentity = content == null ? "不适用" : string.IsNullOrEmpty(content.ToString()) ? "不适用" : content.ToString();
                        break;

                    case "位置":
                        data.Position = content == null ? null : content.ToString();
                        break;
                    }
                }
                for (; index < controls.Count && fillCount < 2; index++)
                {
                    NativeApi.GetClassName(controls[index], className, 255);
                    if (className.ToString().StartsWith(CCCFillManager.ComboBoxClassName))
                    {
                        ApiSetter.SetComboBoxSelected(hwnd, controls[index], data.SymbolIdentity);
                        fillCount++;
                    }
                    else if (className.ToString().StartsWith(CCCFillManager.EditClassName))
                    {
                        ApiSetter.SetText(controls[index], data.Position);
                        fillCount++;
                    }
                    else if (saveButton != IntPtr.Zero && className.ToString().StartsWith(CCCFillManager.ButtonClassName))
                    {
                        className.Clear();
                        NativeApi.GetWindowText(controls[index], className, 255);
                        if (className.ToString() == "保存")
                        {
                            saveButton = controls[index];
                        }
                    }
                }
            }
            if (saveButton == IntPtr.Zero)
            {
                for (; index < controls.Count; index++)
                {
                    className.Clear();
                    NativeApi.GetWindowText(controls[index], className, 255);
                    if (className.ToString() == "保存")
                    {
                        saveButton = controls[index];
                    }
                }
            }
            this.Main.ClickSaveButton(saveButton);
            return(true);
        }