/// <summary>
        /// 生产状态
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="num"></param>
        /// <param name="state"></param>
        /// <returns></returns>
        //public static ResultModel ProduceProceResult(int num = 0, ProduceProceStateEnum state = ProduceProceStateEnum.Cancel)
        //{
        //    try
        //    {
        //        switch (state)
        //        {
        //            case ProduceProceStateEnum.CompleteTask:
        //                //记录生产转序入库数量
        //                StoreInfoModel.ProducePlanInfo.GetProjectProduceDetial.Quantity = num;

        //                //录入计划实际结束时间
        //                ResultModel actualDateResult = new ProducePlanInfoBLL().ActualProducePlanDate(ProducePlanInfoBLL.ProducePlanStateEnum.End);

        //                //记录生产日志
        //                ResultModel logResult = new ProducePlanInfoBLL().ProduceLog(ProducePlanInfoBLL.ProduceLogTypeEnum.End);

        //                break;
        //            case ProduceProceStateEnum.PauseTask:
        //                new ProducePlanInfoBLL().ProduceLog(ProducePlanInfoBLL.ProduceLogTypeEnum.Pause);
        //                break;
        //            case ProduceProceStateEnum.Cancel:

        //                break;
        //            default: break;
        //        }

        //        return new ResultModel()
        //        {
        //            Result = true,
        //            Msg = @"成功!"
        //        };
        //    }
        //    catch (Exception ex)
        //    {
        //        return new ResultModel()
        //        {
        //            Result = false,
        //            Msg = ex.Message
        //        };
        //    }
        //}

        public static ResultModel ProduceProceResult(int pauseReson = 0, int num = 0, ProduceProceStateEnum state = ProduceProceStateEnum.Cancel)
        {
            try
            {
                switch (state)
                {
                case ProduceProceStateEnum.CompleteTask:
                    //记录生产转序入库数量
                    StoreInfoModel.ProducePlanInfo.GetProjectProduceDetial.WorkQuantity = num;

                    //录入计划实际结束时间
                    ResultModel actualDateResult = new ProducePlanInfoBLL().ActualProducePlanDate(ProducePlanInfoBLL.ProducePlanStateEnum.End);

                    //记录生产日志
                    ResultModel logResult = new ProducePlanInfoBLL().ProduceLog(ProducePlanInfoBLL.ProduceLogTypeEnum.End);

                    break;

                case ProduceProceStateEnum.PauseTask:
                    new ProducePlanInfoBLL().ProduceLog(ProducePlanInfoBLL.ProduceLogTypeEnum.Pause, (PauseResonEnum)pauseReson);
                    break;

                case ProduceProceStateEnum.Cancel:

                    break;

                default: break;
                }

                return(new ResultModel()
                {
                    Result = true,
                    Msg = @"成功!"
                });
            }
            catch (Exception ex)
            {
                return(new ResultModel()
                {
                    Result = false,
                    Msg = ex.Message
                });
            }
        }
        private void PageProduceProce_Loaded(object sender, RoutedEventArgs e)
        {
            #region 加载基本数据

            //lblProjectName.Content = StoreInfoModel.ProducePlanInfo.GetProject.ProjectName;

            #endregion

            #region 加载工步列表

            List <object> WorkStepList = new List <object>();
            workStepCount = StoreInfoModel.ProducePlanInfo.GetProcessWorkSteps.Count;
            for (int i = 0; i < StoreInfoModel.ProducePlanInfo.GetProcessWorkSteps.Count; i++)
            {
                WorkStepList.Add(new
                {
                    WorkStepsTitle = string.Format("工步{0}", ToUpper(i + 1)),
                    WorkStepsName  = StoreInfoModel.ProducePlanInfo.GetProcessWorkSteps[i].WorkStepsName,
                    WorkStepsInfo  = StoreInfoModel.ProducePlanInfo.GetProcessWorkSteps[i].WorkStepsContent
                });

                dataContext.WorkSteps.Add(new WorkStepModel()
                {
                    LineNum       = (i + 1),
                    WorkStepsName = StoreInfoModel.ProducePlanInfo.GetProcessWorkSteps[i].WorkStepsName,
                    WorkStepsInfo = StoreInfoModel.ProducePlanInfo.GetProcessWorkSteps[i].WorkStepsContent
                });
            }

            dataContext.ProjectName = StoreInfoModel.ProducePlanInfo.GetProject.ProjectName;
            dataContext.WorkStep    = dataContext.WorkSteps.Count > 0 ? dataContext.WorkSteps[0] : new WorkStepModel();
            this.DataContext        = dataContext;

            //var aaaaa = WorkStepsList.DataContext;
            //
            //ContentPresenter cp = WorkStepsList.ItemContainerGenerator.ContainerFromIndex(0) as ContentPresenter;
            //List<Border> gds = Helpers.WpfHelper.FindVisualChildren<Border>(WorkStepsList);

            //ContentPresenter cp = PlanCardItems.ItemContainerGenerator.ContainerFromIndex(FocusIndex) as ContentPresenter;
            //List<Border> gds = Helpers.WpfHelper.FindVisualChildren<Border>(cp);
            //List<TextBlock> tbs = Helpers.WpfHelper.FindVisualChildren<TextBlock>(cp);
            //WorkStepBar.ItemsSource = WorkStepList;

            #endregion

            #region 图纸列表

            List <object> DrawList    = new List <object>();
            string[]      fileTypeArr = new string[] { ".jpg", ".JPG", ".png", ".PNG", ".dwg", ".DWG", ".pdf", ".PDF" };

            for (int i = 0; i < StoreInfoModel.ProducePlanInfo.GetQualityReportDocs.Count; i++)
            {
                QMS_QualityReportDoc qrd = StoreInfoModel.ProducePlanInfo.GetQualityReportDocs[i];
                if (fileTypeArr.Contains(System.IO.Path.GetExtension(qrd.FileName)))
                {
                    drawingCount++;
                    drawFilePaths.Add(string.Format(@"{0}\{1}", ConfigInfoModel.DocDirName, qrd.FileName));
                    DrawList.Add(new { DrawName = qrd.FileName });
                }
            }

            for (int i = 0; i < StoreInfoModel.ProducePlanInfo.GetProcessFigures.Count; i++)
            {
                PRS_ProcessFigure pf = StoreInfoModel.ProducePlanInfo.GetProcessFigures[i];
                if (fileTypeArr.Contains(System.IO.Path.GetExtension(pf.FileName)))
                {
                    drawingCount++;
                    drawFilePaths.Add(string.Format(@"{0}\{1}", ConfigInfoModel.DocDirName, pf.FileName));
                    DrawList.Add(new { DrawName = pf.FileName });
                }
            }

            //drawingCount = StoreInfoModel.ProducePlanInfo.GetPartFiles.Count;
            //for (int i = 0; i < drawingCount; i++)
            //{
            //    drawFilePaths.Add(string.Format(@"{0}\{1}", ConfigInfoModel.DocDirName, StoreInfoModel.ProducePlanInfo.GetPartFiles[drawingIndex].FileName));
            //    //DrawList.Add(new { DrawName = string.Format("图{0}", ToUpper(i + 1)) });
            //    DrawList.Add(new { DrawName = StoreInfoModel.ProducePlanInfo.GetPartFiles[i].FileName });
            //}
            //for (int i = 0; i < StoreInfoModel.ProducePlanInfo.GetQualityReportDocs.Count; i++)
            //{
            //    if (new string[] { ".jpg", ".JPG", ".png", ".PNG", ".dwg", ".DWG", ".pdf", ".PDF" }.Contains(System.IO.Path.GetExtension(StoreInfoModel.ProducePlanInfo.GetQualityReportDocs[i].FileName)))
            //    {
            //        drawingCount++;
            //        drawFilePaths.Add(string.Format(@"{0}\{1}", ConfigInfoModel.DocDirName, StoreInfoModel.ProducePlanInfo.GetQualityReportDocs[drawingIndex].FileName));
            //        DrawList.Add(new { DrawName = StoreInfoModel.ProducePlanInfo.GetQualityReportDocs[i].FileName });
            //    }
            //}

            DrawCardItems.ItemsSource = DrawList;

            #endregion

            #region 图纸展示

            ((System.ComponentModel.ISupportInitialize)axMxDrawX).BeginInit();
            System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost()
            {
                Child = axMxDrawX
            };
            ((System.ComponentModel.ISupportInitialize)axMxDrawX).EndInit();

            axMxDrawX.ShowCommandWindow = false;
            axMxDrawX.ShowModelBar      = false;
            axMxDrawX.ShowStatusBar     = false;
            axMxDrawX.ShowToolBars      = false;
            axMxDrawX.Padding           = new System.Windows.Forms.Padding(0);
            axMxDrawX.Margin            = new System.Windows.Forms.Padding(0);
            axMxDrawX.IsFirstRunPan     = true;
            axMxDrawX.IsDrawCoord       = false;

            mxDraw.Children.Add(host);

            //if (StoreInfoModel.ProducePlanInfo.GetPartFiles.Count > 0)
            //{
            //    axMxDrawX.OpenDwgFile(string.Format(@"{0}\{1}", ConfigInfoModel.DocDirName, StoreInfoModel.ProducePlanInfo.GetPartFiles[0].FileName));
            //    axMxDrawX.GetMcDbDatabaseBound(ref pLbx, ref pLby, ref pRtx, ref pRty);
            //    pointX = (pRtx - pLbx) / 2;
            //    pointY = (pRty - pLby) / 2;
            //    axMxDrawX.ZoomCenter(pointX, pointY);
            //    axMxDrawX.ZoomScale(0.08);
            //}

            if (drawingCount > 0)
            {
                axMxDrawX.OpenDwgFile(drawFilePaths[0]);
                axMxDrawX.GetMcDbDatabaseBound(ref pLbx, ref pLby, ref pRtx, ref pRty);
                pointX = (pRtx - pLbx) / 2;
                pointY = (pRty - pLby) / 2;
                axMxDrawX.ZoomCenter(pointX, pointY);
                axMxDrawX.ZoomScale(0.08);
            }

            #endregion

            #region 录入生产日志,录入计划开始时间

            #region 录入生产日志

            //记录生产日志
            ResultModel logResult = new BLL.ExtraBLL.ProducePlanInfoBLL().ProduceLog(BLL.ExtraBLL.ProducePlanInfoBLL.ProduceLogTypeEnum.Start);

            #endregion

            #region 录入计划开始时间

            //录入计划实际开始时间
            ResultModel actualDateResult = new BLL.ExtraBLL.ProducePlanInfoBLL().ActualProducePlanDate(BLL.ExtraBLL.ProducePlanInfoBLL.ProducePlanStateEnum.Start);

            #endregion

            #region 加载物料信息

            materielItems.ItemsSource = GetMaterielItems();

            //List<object> materielData = new List<object>();
            //if (StoreInfoModel.MaterialChildInfos.Count <= 0)
            //{
            //    materielData.Add(new
            //    {
            //        PartCode = StoreInfoModel.MaterialInfo.GetMaterialDetail.PartCode,
            //        PartName = StoreInfoModel.MaterialInfo.GetMaterialDetail.PartName,
            //        PartQuantity = StoreInfoModel.MaterialInfo.GetMaterialDetail.PartQuantity
            //    });
            //}
            //else
            //{
            //    foreach (var item in StoreInfoModel.MaterialChildInfos)
            //    {
            //        materielData.Add(new
            //        {
            //            PartCode = item.GetMaterialDetail.PartCode,
            //            PartName = item.GetMaterialDetail.PartName,
            //            PartQuantity = item.GetMaterialDetail.PartQuantity
            //        });
            //    }
            //}
            //materielItems.ItemsSource = materielData;

            #endregion

            #endregion

            #region 默认焦点区域、选择项

            switch (focusArea)
            {
            case FocusAreaEnum.LeftFocus:
                RemoveTabBorder(tbDrawingList);
                AddTabBorder(tbWorkStepsInfo);
                break;

            case FocusAreaEnum.CenterFocus:
                RemoveTabBorder(tbWorkStepsInfo);
                AddTabBorder(mxDraw);
                break;

            case FocusAreaEnum.RightFocus:
                RemoveTabBorder(mxDraw);
                AddTabBorder(materielList);
                break;

            case FocusAreaEnum.DownFocus:
                RemoveTabBorder(materielList);
                AddTabBorder(tbDrawingList);
                break;

            default: break;
            }

            #endregion

            InputMethod.SetIsInputMethodEnabled(MainPage, false);
            InputMethod.SetPreferredImeState(MainPage, InputMethodState.Off);

            ShowWorkStepsInfo();
            MainPage.Focus();

            var temp = BLL.Helpers.ClientHelper.RecordOperateLog(string.Format(@"用户【{0}】进入了开始生产、查看图纸的页面!", StoreInfoModel.UserName));
        }