private void OnImportCommand()
        {
            OpenFileDialog lOpenFile = new OpenFileDialog();

            lOpenFile.Filter = "Excel (*.xls)|*.xls";

            Dictionary<String, int> lHeaderDictionary = new Dictionary<String, int>();

            if (lOpenFile.ShowDialog() == true)
            {
                ImportantPartRejesterEntityList.Clear();

                try
                {
                    FileStream fs = lOpenFile.File.OpenRead();
                    Workbook book = Workbook.Open(fs);

                    foreach (KeyValuePair<int, Row> rowPair in book.Worksheets[0].Cells.Rows)
                    {
                        if (rowPair.Key == 0)
                        {
                            try
                            {
                                foreach (KeyValuePair<int, Cell> cellPair in rowPair.Value)
                                {
                                    lHeaderDictionary.Add(cellPair.Value.StringValue, cellPair.Key);
                                }
                            }
                            catch (System.Exception ex)
                            {
                                Message.ErrorMessage("表头重复或超出范围!");
                                break;
                            }
                            continue;
                        }

                        ImportantPartRejesterEntity lImportantPartRejesterEntity = new ImportantPartRejesterEntity();
                        lImportantPartRejesterEntity.ImportantPartRejester = new ProductManager.Web.Model.important_part_rejester();
                        lImportantPartRejesterEntity.ManufactureNumber = ProjectEntity.ManufactureNumber;

                        int lManufactureNumberColumn = -1;
                        {
                            Cell cell = Cell.EmptyCell;
                            if (lHeaderDictionary.TryGetValue("生产令号", out lManufactureNumberColumn)
                                && -1 != lManufactureNumberColumn
                                && Cell.EmptyCell != (cell = rowPair.Value.GetCell(lManufactureNumberColumn)))
                            {
                                lImportantPartRejesterEntity.ManufactureNumber = cell.StringValue;

                                ProjectEntity projectEntityTemp;
                                if (!ProjectEntityDictionary.TryGetValue(lImportantPartRejesterEntity.ManufactureNumber, out projectEntityTemp))
                                {
                                    NotifyWindow lNotifyWindow = new NotifyWindow("错误", "第 " + rowPair.Key.ToString() + "行 系统中没有生产令号:" + lImportantPartRejesterEntity.ManufactureNumber);
                                    lNotifyWindow.Show();
                                    return;
                                }
                            }
                            else
                            {
                                NotifyWindow lNotifyWindow = new NotifyWindow("错误", "第 " + rowPair.Key.ToString() + "行 系统中没有生产令号:" + lImportantPartRejesterEntity.ManufactureNumber);
                                lNotifyWindow.Show();
                                return;
                            }
                        }

                        int lImportPartNameColumn = -1;
                        {
                            Cell cell = Cell.EmptyCell;
                            if (lHeaderDictionary.TryGetValue("主要部件名称", out lImportPartNameColumn)
                                && -1 != lManufactureNumberColumn
                                && Cell.EmptyCell != (cell = rowPair.Value.GetCell(lImportPartNameColumn)))
                            {
                                lImportantPartRejesterEntity.ImportantPartName = cell.StringValue;
                            }
                        }

                        int lProjectNameColumn = -1;
                        {
                            Cell cell = Cell.EmptyCell;
                            if (lHeaderDictionary.TryGetValue("厂家", out lProjectNameColumn)
                                && -1 != lProjectNameColumn
                                && Cell.EmptyCell != (cell = rowPair.Value.GetCell(lProjectNameColumn)))
                            {
                                lImportantPartRejesterEntity.ImportantPartManufacturers = cell.StringValue;
                            }
                        }

                        int lImportantPartType = -1;
                        {
                            Cell cell = Cell.EmptyCell;
                            if (lHeaderDictionary.TryGetValue("型号", out lImportantPartType)
                                && -1 != lImportantPartType
                                && Cell.EmptyCell != (cell = rowPair.Value.GetCell(lImportantPartType)))
                            {
                                lImportantPartRejesterEntity.ImportantPartType = cell.StringValue;
                            }
                        }

                        int lModelNumberColumn = -1;
                        {
                            Cell cell = Cell.EmptyCell;
                            if (lHeaderDictionary.TryGetValue("出厂时间", out lModelNumberColumn)
                                && -1 != lModelNumberColumn
                                && Cell.EmptyCell != (cell = rowPair.Value.GetCell(lModelNumberColumn)))
                            {
                                lImportantPartRejesterEntity.OutputTime = cell.DateTimeValue;
                            }
                        }

                        //出厂编号
                        int lRemarkColumn = -1;
                        {
                            Cell cell = Cell.EmptyCell;
                            if (lHeaderDictionary.TryGetValue("出厂编号", out lRemarkColumn)
                                && -1 != lRemarkColumn
                                && Cell.EmptyCell != (cell = rowPair.Value.GetCell(lRemarkColumn)))
                            {
                                lImportantPartRejesterEntity.OutputNumber = cell.StringValue;
                            }
                        }

                        //序列号
                        int lImportantPartManu = -1;
                        {
                            Cell cell = Cell.EmptyCell;
                            if (lHeaderDictionary.TryGetValue("序列号", out lImportantPartManu)
                                && -1 != lImportantPartManu
                                && Cell.EmptyCell != (cell = rowPair.Value.GetCell(lImportantPartManu)))
                            {
                                lImportantPartRejesterEntity.ImportantPartManu = cell.StringValue;
                            }
                        }

                        //备注
                        int lNote = -1;
                        {
                            Cell cell = Cell.EmptyCell;
                            if (lHeaderDictionary.TryGetValue("备注", out lNote)
                                && -1 != lNote
                                && Cell.EmptyCell != (cell = rowPair.Value.GetCell(lNote)))
                            {
                                lImportantPartRejesterEntity.Note = cell.StringValue;
                            }
                        }

                        App app = Application.Current as App;
                        lImportantPartRejesterEntity.InputUserID = app.UserInfo.UserID;
                        lImportantPartRejesterEntity.InputDateTime = DateTime.Now;
                        lImportantPartRejesterEntity.UserEntityDictionary = DictionaryUser;
                        lImportantPartRejesterEntity.DUpdate();

                        ImportantPartRejesterEntityList.Add(lImportantPartRejesterEntity);

                        //ProductContext.projects.Add(lProjectEntity.Project);
                    }

                }
                catch (System.Exception ex)
                {
                    Message.ErrorMessage(ex.Message);
                }
            }
        }