Esempio n. 1
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);
 }
Esempio n. 2
0
        //第几排座椅	座椅位置	是否已获证	CCC证书编号	变型,如适用	安全带高度调节装置	生产厂名称	安全带型式*
        //型号	卷收器型式**	卷收器安装角度     安全带的安装位置	安全带安装位置附件	搭扣锁型式***	安全带固定点数量
        //CCC认证标志的位置	CCC认证标志位置附件	CCC认证标志的固定方法
        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_1Value value = null;

            while (sheet.ReadNextRow())
            {
                value = new Page9_12_1Value();
                string key = "";
                isEmptyRow = true;
                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.Position = str;
                        break;

                    case "是否已获证":
                        value.Cert = str;
                        break;

                    case "CCC证书编号":
                        value.CertNo = str;
                        break;

                    case "变型,如适用":
                        value.Transform = str;
                        break;

                    case "安全带高度调节装置":
                        value.HeightAdj = str;
                        break;

                    case "生产厂名称":
                        value.Productor = str;
                        break;

                    case "安全带型式*":
                        value.SeatBeltType = str;
                        break;

                    case "型号":
                        value.Model = str;
                        break;

                    case "卷收器型式**":
                        value.RetractorType = str;
                        break;

                    case "卷收器安装角度":
                        value.RetractorAngle = str;
                        break;

                    case "安全带的安装位置":
                        value.SeatBeltPosition = str;
                        break;

                    case "安全带安装位置附件":
                        value.SeatBeltPosAttach = str;
                        break;

                    case "搭扣锁型式***":
                        value.LockType = str;
                        break;

                    case "安全带固定点数量":
                        value.FixedPosNum = str;
                        break;

                    case "CCC认证标志的位置":
                        value.CCCSignPos = str;
                        break;

                    case "CCC认证标志位置附件":
                        value.CCCSignPosAttach = str;
                        break;

                    case "CCC认证标志的固定方法":
                        value.CCCSignFixation = str;
                        break;

                    case "第几排座椅":
                        key = str;
                        break;
                    }
                }
                if (key == null || isEmptyRow)
                {
                    continue;
                }
                List <Page9_12_1Value> values = null;
                if (data.ContainsKey(key))
                {
                    values = data[key] as List <Page9_12_1Value>;
                    if (values == null)
                    {
                        values    = new List <Page9_12_1Value>();
                        data[key] = values;
                    }
                }
                else
                {
                    values = new List <Page9_12_1Value>();
                    data.Add(key, values);
                }
                values.Add(value);
            }
        }