Пример #1
0
        public bool NextPage(NavBase navBase_0, NavigationService navigationService_0)
        {
            int    surveySequence = SurveyHelper.SurveySequence;
            string roadMapVersion = SurveyHelper.RoadMapVersion;
            string surveyID       = SurveyHelper.SurveyID;
            string navCurPage     = SurveyHelper.NavCurPage;

            navBase_0.PageStartTime   = SurveyHelper.PageStartTime;
            navBase_0.RecordFileName  = SurveyHelper.RecordFileName;
            navBase_0.RecordStartTime = SurveyHelper.RecordStartTime;
            SurveyRoadMap byPageId = oSurveyRoadMapDal.GetByPageId(navCurPage, roadMapVersion);
            string        text     = "#CircleGuide#CircleStart#EmptyJump#Recode#";
            string        value    = "#" + byPageId.FORM_NAME.ToUpper() + "#";
            bool          flag     = text.ToUpper().Contains(value);

            if (SurveyHelper.AutoCapture && !flag)
            {
                string str = SurveyHelper.SurveyID + "_" + SurveyHelper.NavCurPage + ((SurveyHelper.CircleACode == "") ? "" : ("_A" + SurveyHelper.CircleACode)) + ((SurveyHelper.CircleBCode == "") ? "" : ("_B" + SurveyHelper.CircleBCode)) + ".jpg";
                str = Directory.GetCurrentDirectory() + "\\Photo\\" + str;
                if (File.Exists(str))
                {
                    str = SurveyHelper.SurveyID + "_" + SurveyHelper.NavCurPage + ((SurveyHelper.CircleACode == "") ? "" : ("_A" + SurveyHelper.CircleACode)) + ((SurveyHelper.CircleBCode == "") ? "" : ("_B" + SurveyHelper.CircleBCode)) + "_" + DateTime.Now.Hour + DateTime.Now.Minute + DateTime.Now.Second + ".jpg";
                    str = Directory.GetCurrentDirectory() + "\\Photo\\" + str;
                }
                method_0(str, (int)SurveyHelper.Screen_LeftTop);
            }
            try
            {
                if (navBase_0.GroupLevel == "")
                {
                    navBase_0.NextPage(surveyID, surveySequence, navCurPage, roadMapVersion);
                }
                else
                {
                    navBase_0.NextCirclePage(surveyID, surveySequence, navCurPage, roadMapVersion);
                    SurveyHelper.CircleACount   = navBase_0.CircleACount;
                    SurveyHelper.CircleACurrent = navBase_0.CircleACurrent;
                    if (navBase_0.IsLastA && (navBase_0.GroupPageType == 0 || navBase_0.GroupPageType == 2))
                    {
                        SurveyHelper.CircleACode     = "";
                        SurveyHelper.CircleACodeText = "";
                    }
                    if (navBase_0.GroupLevel == "B")
                    {
                        SurveyHelper.CircleBCount   = navBase_0.CircleBCount;
                        SurveyHelper.CircleBCurrent = navBase_0.CircleBCurrent;
                        if (navBase_0.IsLastB && (navBase_0.GroupPageType == 10 || navBase_0.GroupPageType == 12 || navBase_0.GroupPageType == 30 || navBase_0.GroupPageType == 32))
                        {
                            SurveyHelper.CircleBCode     = "";
                            SurveyHelper.CircleBCodeText = "";
                        }
                    }
                }
                string text2 = oLogicEngine.Route(navBase_0.RoadMap.FORM_NAME);
                SurveyHelper.RoadMapVersion = navBase_0.RoadMap.VERSION_ID.ToString();
                string uriString = string.Format("pack://application:,,,/View/{0}.xaml", text2);
                if (text2.Substring(0, 1) == "A")
                {
                    uriString = string.Format("pack://application:,,,/ViewProject/{0}.xaml", text2);
                }
                if (text2 == SurveyHelper.CurPageName)
                {
                    navigationService_0.Refresh();
                }
                else
                {
                    if (!FormIsOK(text2))
                    {
                        string text3 = string.Format(SurveyMsg.MsgErrorJump, surveyID, navCurPage, navBase_0.RoadMap.VERSION_ID, navBase_0.RoadMap.PAGE_ID, navBase_0.RoadMap.FORM_NAME);
                        MessageBox.Show(SurveyMsg.MsgErrorRoadmap + Environment.NewLine + Environment.NewLine + text3 + SurveyMsg.MsgErrorEnd, SurveyMsg.MsgCaption, MessageBoxButton.OK, MessageBoxImage.Hand);
                        oLogicEngine.OutputResult(text3, "CapiDebug.Log");
                        return(false);
                    }
                    navigationService_0.RemoveBackEntry();
                    navigationService_0.Navigate(new Uri(uriString));
                }
                SurveyHelper.SurveySequence = surveySequence + 1;
                SurveyHelper.NavCurPage     = navBase_0.RoadMap.PAGE_ID;
                SurveyHelper.CurPageName    = text2;
                SurveyHelper.NavGoBackTimes = 0;
                SurveyHelper.NavOperation   = "Normal";
                SurveyHelper.NavLoad        = 0;
            }
            catch (Exception)
            {
                string text4 = string.Format(SurveyMsg.MsgErrorJump, surveyID, navCurPage, navBase_0.RoadMap.VERSION_ID, navBase_0.RoadMap.PAGE_ID, navBase_0.RoadMap.FORM_NAME);
                MessageBox.Show(SurveyMsg.MsgErrorRoadmap + Environment.NewLine + Environment.NewLine + text4 + SurveyMsg.MsgErrorEnd, SurveyMsg.MsgCaption, MessageBoxButton.OK, MessageBoxImage.Hand);
                oLogicEngine.OutputResult(text4, "CapiDebug.Log");
                return(false);
            }
            return(true);
        }