Ejemplo n.º 1
0
        //JDK this was added to help with highlight colors with multiple versions on the same day
        internal static String MaxVersionWithDateColumn(string version, Table table, int column)
        {
            String maxVersion          = version;
            String tempVersionStampFix = "";

            //double decimalValue = 0;
            for (int r = 0; r < table.GetNumRows(); r++)
            {
                String lastVersionStamp = table.GetData(r, column);

                //NEW CODE STARTS HERE
                //if (lastVersionStamp.Trim().IndexOf("/")>=0 || lastVersionStamp.Trim().Equals(""))
                String tempCleanedVerLabel = CleanupVersionLabel(lastVersionStamp);
                if (!tempCleanedVerLabel.Equals(lastVersionStamp))
                {
                    DateTime tempDTStamp;
                    if (DateTime.TryParse(lastVersionStamp, out tempDTStamp))
                    {
                        tempVersionStampFix = PathMaker.LookupChangeLogShadow().GetVersionStringForChange(tempDTStamp);
                        lastVersionStamp    = tempVersionStampFix;
                        //lastVersionStamp = PathMaker.LookupChangeLogShadow().GetValidVersionString(PathMaker.LookupChangeLogShadow().GetChangeLog(), tempVersionStampFix);
                        table.SetData(r, column, lastVersionStamp);//JDK temporarily removed for testing
                    }
                }
                if (Common.ForcedStringVersionToDouble(lastVersionStamp) > Common.ForcedStringVersionToDouble(maxVersion))
                {
                    maxVersion = lastVersionStamp;
                }

                //NEW CODE ENDS HERE
            }
            return(maxVersion);
        }
Ejemplo n.º 2
0
        /**
         * Utility method to return the highlight color given a change version label
         */
        internal string GetColorStringForChange(string versionLabel)
        {
            Table  table = GetChangeLog();
            string color = Strings.HighlightColorNone;
            string tempVersionStampFix;
            //string pattern = "[a-zA-Z-]+";
            //string replacement = "";
            //Regex rgx = new Regex(pattern);

            //DateTime revisionDate;//from old style highlight fomratting
            DateTime date;

            if (versionLabel == null || versionLabel == "")
            {
                return(color);
            }

            versionLabel = Common.CleanupVersionLabel(versionLabel);//JDK ORIG
            //versionLabel = GetValidVersionString(table, Common.CleanupVersionLabel(versionLabel));//JDK added some extra validation;

            if (Common.ForcedStringVersionToDouble(versionLabel) > Common.ForcedStringVersionToDouble(GetLastChangeVersion()))
            {
                return(color);
            }

            //JDK This check will catch any fields with dates still in the hidden stamp fields
            if (versionLabel.Contains("/") && DateTime.TryParse(versionLabel, out date))
            {
                tempVersionStampFix = PathMaker.LookupChangeLogShadow().GetVersionStringForChange(date);
                //versionLabel = tempVersionStampFix;
                versionLabel = GetValidVersionString(table, tempVersionStampFix);//JDK added some extra validation
                //versionLabel = rgx.Replace(tempVersionStampFix, replacement);
                //return GetColorStringForChange(date);//will only do this for backward compatibility support
            }

            for (int r = 0; r < table.GetNumRows(); r++)
            {
                double decimalVal      = 0;
                String revisionVersion = table.GetData(r, (int)TableColumns.ChangeLog.Version);
                decimalVal = Common.ForcedStringVersionToDouble(revisionVersion);

                if (decimalVal != 0)
                {
                    if (decimalVal > Common.ForcedStringVersionToDouble(versionLabel))
                    {
                        return(color);
                    }
                    else
                    {
                        color = table.GetData(r, (int)TableColumns.ChangeLog.Highlight);
                    }
                }
            }
            return(color);
        }
Ejemplo n.º 3
0
        internal override void AddPromptsToRecordingListVer(PromptRecordingList recordingList, String onOrAfterVersion)
        {
            Table table = GetPrompts();

            //double number;
            for (int r = 0; r < table.GetNumRows(); r++)
            {
                string wording           = table.GetData(r, (int)TableColumns.Prompts.Wording);
                string id                = table.GetData(r, (int)TableColumns.Prompts.Id);
                string wordingDateString = table.GetData(r, (int)TableColumns.Prompts.WordingDateStamp);
                string idDateString      = table.GetData(r, (int)TableColumns.Prompts.IdDateStamp);
                if (wordingDateString.Contains("/"))
                {
                    DateTime tempDTStamp;
                    if (DateTime.TryParse(onOrAfterVersion, out tempDTStamp))
                    {
                        string tempVersionStampFix = PathMaker.LookupChangeLogShadow().GetVersionStringForChange(tempDTStamp);
                        wordingDateString = tempVersionStampFix;
                    }
                }

                if (idDateString.Contains("/"))
                {
                    DateTime tempDTStamp;
                    if (DateTime.TryParse(onOrAfterVersion, out tempDTStamp))
                    {
                        string tempVersionStampFix = PathMaker.LookupChangeLogShadow().GetVersionStringForChange(tempDTStamp);
                        idDateString = tempVersionStampFix;
                    }
                }

                if (onOrAfterVersion != null)
                {
                    if (!wordingDateString.Contains("/") && !idDateString.Contains("/"))
                    {
                        if (Common.ForcedStringVersionToDouble(wordingDateString) >= Common.ForcedStringVersionToDouble(onOrAfterVersion) ||
                            Common.ForcedStringVersionToDouble(idDateString) >= Common.ForcedStringVersionToDouble(onOrAfterVersion))
                        {
                            if (id != null && id.Length > 0)
                            {
                                recordingList.AddPromptRecording(id, wording);
                            }
                        }
                    }
                }
                else
                if (id != null && id.Length > 0)
                {
                    recordingList.AddPromptRecording(id, wording);
                }
            }
        }