Exemplo n.º 1
0
        public static string CompareFa(BMW.Rheingold.CoreFramework.Contracts.Programming.IFa faCurrent, BMW.Rheingold.CoreFramework.Contracts.Programming.IFa faTarget)
        {
            if (faCurrent != null && faTarget != null)
            {
                List <string> faElementAdded   = new List <string>();
                List <string> faElementRemoved = new List <string>();
                faElementAdded.Clear();
                faElementAdded.AddRange(from item in faTarget.EWords
                                        where !faCurrent.EWords.Contains(item)
                                        select item);
                faElementAdded.AddRange(from item in faTarget.HOWords
                                        where !faCurrent.HOWords.Contains(item)
                                        select item);
                faElementAdded.AddRange(from item in faTarget.Salapas
                                        where !faCurrent.Salapas.Contains(item)
                                        select item);
                faElementRemoved.Clear();
                faElementRemoved.AddRange(from item in faCurrent.EWords
                                          where !faTarget.EWords.Contains(item)
                                          select item);
                faElementRemoved.AddRange(from item in faCurrent.HOWords
                                          where !faTarget.HOWords.Contains(item)
                                          select item);
                faElementRemoved.AddRange(from item in faCurrent.Salapas
                                          where !faTarget.Salapas.Contains(item)
                                          select item);

                if (faElementAdded.Any() || faElementRemoved.Any())
                {
                    return(string.Format(CultureInfo.InvariantCulture, "Added: {0}; Removed: {1}", faElementAdded.ToStringItems(), faElementRemoved.ToStringItems()));
                }
            }

            return(string.Empty);
        }
Exemplo n.º 2
0
        public static bool ModifyFa(BMW.Rheingold.CoreFramework.Contracts.Programming.IFa fa, List <string> faModList, bool addEntry)
        {
            if (fa == null)
            {
                return(false);
            }

            foreach (string modEntry in faModList)
            {
                IList <string> faList   = null;
                string         item     = modEntry.Trim();
                char           prefix   = item[0];
                string         itemName = item.Substring(1);
                switch (prefix)
                {
                case '-':
                    faList = fa.EWords;
                    break;

                case '+':
                    faList = fa.HOWords;
                    break;

                case '$':
                    faList = fa.Salapas;
                    break;
                }

                if (faList == null)
                {
                    return(false);
                }

                if (addEntry)
                {
                    if (!faList.Contains(itemName))
                    {
                        faList.Add(itemName);
                    }
                }
                else
                {
                    if (faList.Contains(itemName))
                    {
                        faList.Remove(itemName);
                    }
                }
            }

            return(true);
        }
Exemplo n.º 3
0
        public IPsdzFa BuildFa(BMW.Rheingold.CoreFramework.Contracts.Programming.IFa faInput, string vin17)
        {
            if (faInput == null)
            {
                return(null);
            }
            PsdzFa fa = new PsdzFa
            {
                Vin                  = vin17,
                FaVersion            = faInput.FaVersion,
                Entwicklungsbaureihe = faInput.Entwicklungsbaureihe,
                Lackcode             = faInput.Lackcode,
                Polstercode          = faInput.Polstercode,
                Type                 = faInput.Type,
                Zeitkriterium        = faInput.Zeitkriterium,
                EWords               = faInput.EWords,
                HOWords              = faInput.HOWords,
                Salapas              = faInput.Salapas
            };

            return(this.ValidateBuiltFaObjectViaPsdz(fa));
        }