Exemple #1
0
        private void ReadData()
        {
            Hashtable columnHeader = new Hashtable();

            Office.Excel.ForwardReadWorksheet sheet = base.Sheet;
            object content;

            if (sheet.ReadNextRow())
            {
                while (sheet.ReadNextCell(false))
                {
                    content = sheet.GetContent();
                    columnHeader.Add(sheet.CurrentCell.ColumnIndex, content == null ? "" : content.ToString());
                }
            }
            bool            isEmptyRow;
            Page9_12_2Value value = null;

            while (sheet.ReadNextRow())
            {
                isEmptyRow = true;
                value      = new Page9_12_2Value();
                while (sheet.ReadNextCell(false))
                {
                    content = sheet.GetContent();
                    string str = content == null ? "" : content.ToString();
                    if (string.IsNullOrEmpty(str) == false)
                    {
                        isEmptyRow = false;
                    }
                    switch (columnHeader[sheet.CurrentCell.ColumnIndex] as string)
                    {
                    case "座椅位置":
                        value.SeatPosition = str;
                        break;

                    case "前气囊":
                        value.FrontAirBags = str;
                        break;

                    case "侧气囊":
                        value.SideAirBags = str;
                        break;

                    case "安全带预加载装置":
                        value.SeatBeltPreloader = str;
                        break;

                    case "第几排座椅":
                        value.RowOfSeat = str;
                        break;
                    }
                }
                if (isEmptyRow)
                {
                    continue;
                }
                data.Add(value);
            }
        }
Exemple #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);
 }