Exemplo n.º 1
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);
 }
Exemplo n.º 2
0
        public override bool FillPage()
        {
            List <IntPtr> containerList;

            this.ReadData();
            Hashtable controlGroup = new Hashtable();
            IntPtr    ok = IntPtr.Zero, rowNumber = IntPtr.Zero, cancel = IntPtr.Zero;

            foreach (var item in data)
            {
                ApiSetter.ClickButton(base.Add, base.HWnd, null, null);
                Page9_12_2_Relation relation = null;
                // 初始化填报控件
                if (ok == IntPtr.Zero || cancel == IntPtr.Zero || rowNumber == IntPtr.Zero || controlGroup.Count == 0)
                {
                    controlGroup.Clear();
                    ok = GetFillControlList(out containerList, out cancel);
                    if (containerList == null)
                    {
                        return(false);
                    }
                    rowNumber = containerList[6];
                    int startIndex = 7;
                    int count      = 3;
                    while (count > 0)
                    {
                        relation = new Page9_12_2_Relation(containerList, startIndex);
                        if (relation.SeatPosDesc != null)
                        {
                            controlGroup.Add(relation.SeatPosDesc, relation);
                        }
                        count--;
                        startIndex += 5;
                    }
                }
                // 填写内容
                if (item.SeatPosition != null)
                {
                    relation = controlGroup[item.SeatPosition] as Page9_12_2_Relation;
                    if (relation != null)
                    {
                        FillValue(item.RowOfSeat, rowNumber, relation, item);
                        relation.IsUsed = true;
                    }
                }
                // 将未填写项标为不适用
                foreach (DictionaryEntry c in controlGroup)
                {
                    relation = c.Value as Page9_12_2_Relation;
                    if (relation != null && relation.IsUsed == false)
                    {
                        ApiSetter.ClickButton(relation.SeatPosition, base.HWnd, null, null);
                    }
                }
                ApiSetter.ClickButton(ok, base.HWnd, null, null);
                // 还原CheckBox状态
                ApiSetter.ClickButton(base.Add, base.HWnd, null, null);
                foreach (DictionaryEntry c in controlGroup)
                {
                    relation = c.Value as Page9_12_2_Relation;
                    if (relation != null && relation.IsUsed == false)
                    {
                        ApiSetter.ClickButton(relation.SeatPosition, base.HWnd, null, null);
                    }
                    relation.IsUsed = false;
                }
                ApiSetter.ClickButton(cancel, base.HWnd, null, null);
            }
            this.Main.ClickSaveButton(base.Save);
            return(true);
        }