Example #1
0
        private static List <OutputMap> SetBlogMap(MapItem mapItem, ID templateID)
        {
            var outputMaps = new List <OutputMap>();
            var outputMap  = new OutputMap();

            foreach (string field in mapItem.OutputFields)
            {
                var outputField = new OutputField();
                if (field == BlogOutputField.Category.GetDescription())
                {
                    outputField.SourceColumn    = BlogInputField.Category.GetDescription();
                    outputField.TargetFieldName = field;
                }
                else if (field == BlogOutputField.Title.GetDescription())
                {
                    outputField.SourceColumn    = BlogInputField.Title.GetDescription();
                    outputField.TargetFieldName = field;
                }
                else if (field == BlogOutputField.Thumbnail.GetDescription())
                {
                    outputField.SourceColumn    = BlogInputField.Thumbnail.GetDescription();
                    outputField.TargetFieldName = field;
                }
                else if (field == BlogOutputField.Banner.GetDescription())
                {
                    outputField.SourceColumn    = BlogInputField.Banner.GetDescription();
                    outputField.TargetFieldName = field;
                }
                else if (field == BlogOutputField.Author.GetDescription())
                {
                    outputField.SourceColumn    = BlogInputField.AuthorName.GetDescription();
                    outputField.TargetFieldName = field;
                }
                else if (field == BlogOutputField.PostDate.GetDescription())
                {
                    outputField.SourceColumn    = BlogInputField.PostDate.GetDescription();
                    outputField.TargetFieldName = field;
                }
                else if (field == BlogOutputField.ExpiryDate.GetDescription())
                {
                    outputField.SourceColumn    = BlogInputField.ExpiryDate.GetDescription();
                    outputField.TargetFieldName = field;
                }
                else if (field == BlogOutputField.Summary.GetDescription())
                {
                    outputField.SourceColumn    = BlogInputField.Summary.GetDescription();
                    outputField.TargetFieldName = field;
                }
                else if (field == BlogOutputField.Body.GetDescription())
                {
                    outputField.SourceColumn    = BlogInputField.Body.ToString();
                    outputField.TargetFieldName = field;
                }
                outputMap.Fields.Add(outputField);
            }

            outputMap.TemplateId = templateID;
            outputMaps.Add(outputMap);
            return(outputMaps);
        }
Example #2
0
        private static List <OutputMap> SetBannerMap(MapItem mapItem, ID templateID)
        {
            var outputMaps = new List <OutputMap>();
            var outputMap  = new OutputMap();

            foreach (string field in mapItem.OutputFields)
            {
                var outputField = new OutputField();
                if (field == BannerOutputField.Title.GetDescription())
                {
                    outputField.SourceColumn    = BannerInputField.Title.ToString();
                    outputField.TargetFieldName = field;
                }
                else if (field == BannerOutputField.Image.GetDescription())
                {
                    outputField.SourceColumn    = BannerInputField.Image.ToString();
                    outputField.TargetFieldName = field;
                }
                else if (field == BannerOutputField.Summary.GetDescription())
                {
                    outputField.SourceColumn    = BannerInputField.Summary.ToString();
                    outputField.TargetFieldName = field;
                }
                else if (field == BannerOutputField.Category.GetDescription())
                {
                    outputField.SourceColumn    = BannerInputField.Category.ToString();
                    outputField.TargetFieldName = field;
                }
                else if (field == BannerOutputField.Link.GetDescription())
                {
                    outputField.SourceColumn    = BannerInputField.Link.ToString();
                    outputField.TargetFieldName = field;
                }
                else if (field == BannerOutputField.PostDate.GetDescription())
                {
                    outputField.SourceColumn    = BannerInputField.PostDate.ToString();
                    outputField.TargetFieldName = field;
                }
                else if (field == BannerOutputField.ExpiryDate.GetDescription())
                {
                    outputField.SourceColumn    = BannerInputField.ExpiryDate.ToString();
                    outputField.TargetFieldName = field;
                }
                else if (field == BannerOutputField.ShowInMain.GetDescription())
                {
                    outputField.SourceColumn    = BannerInputField.ShowInMain.ToString();
                    outputField.TargetFieldName = field;
                }
                else if (field == BannerOutputField.ShowInMalls.GetDescription())
                {
                    outputField.SourceColumn    = BannerInputField.ShowInMalls.ToString();
                    outputField.TargetFieldName = field;
                }
                outputMap.Fields.Add(outputField);
            }

            outputMap.TemplateId = templateID;
            outputMaps.Add(outputMap);
            return(outputMaps);
        }
Example #3
0
        private static List <OutputMap> SetSpecialEventMap(MapItem mapItem, ID templateID)
        {
            var outputMaps = new List <OutputMap>();
            var outputMap  = new OutputMap();

            foreach (string field in mapItem.OutputFields)
            {
                OutputField outputField = null;
                if (field == SpecialOutputField.Title.GetDescription())
                {
                    outputField = new OutputField()
                    {
                        SourceColumn = ArticleInputField.Title.ToString(), TargetFieldName = field
                    };
                }
                else if (field == SpecialOutputField.Thumbnail.GetDescription())
                {
                    outputField = new OutputField()
                    {
                        SourceColumn = ArticleInputField.Thumbnail.ToString(), TargetFieldName = field
                    };
                }
                else if (field == SpecialOutputField.Image.GetDescription())
                {
                    outputField = new OutputField()
                    {
                        SourceColumn = ArticleInputField.Banner.ToString(), TargetFieldName = field
                    };
                }
                else if (field == SpecialOutputField.PostDate.GetDescription())
                {
                    outputField = new OutputField()
                    {
                        SourceColumn = ArticleInputField.PostDate.ToString(), TargetFieldName = field
                    };
                }
                else if (field == SpecialOutputField.ExpiryDate.GetDescription())
                {
                    outputField = new OutputField()
                    {
                        SourceColumn = ArticleInputField.ExpiryDate.ToString(), TargetFieldName = field
                    };
                }
                else if (field == SpecialOutputField.Summary.GetDescription())
                {
                    outputField = new OutputField()
                    {
                        SourceColumn = ArticleInputField.Summary.ToString(), TargetFieldName = field
                    };
                }
                else if (field == SpecialOutputField.Description.GetDescription())
                {
                    outputField = new OutputField()
                    {
                        SourceColumn = ArticleInputField.Description.ToString(), TargetFieldName = field
                    };
                }
                else if (field == SpecialOutputField.Store.GetDescription())
                {
                    outputField = new OutputField()
                    {
                        SourceColumn = ArticleInputField.Store.ToString(), TargetFieldName = field
                    };
                }
                else if (field == SpecialOutputField.StartDate.GetDescription())
                {
                    outputField = new OutputField()
                    {
                        SourceColumn = ArticleInputField.StartDate.ToString(), TargetFieldName = field
                    };
                }
                else if (field == SpecialOutputField.EndDate.GetDescription())
                {
                    outputField = new OutputField()
                    {
                        SourceColumn = ArticleInputField.EndDate.ToString(), TargetFieldName = field
                    };
                }
                else if (field == SpecialOutputField.ShowInMalls.GetDescription())
                {
                    outputField = new OutputField()
                    {
                        SourceColumn    = ArticleInputField.ShowInMalls.ToString(),
                        TargetFieldName = field
                    };
                }
                if (outputField != null)
                {
                    outputMap.Fields.Add(outputField);
                }
            }

            outputMap.TemplateId = templateID;
            outputMaps.Add(outputMap);
            return(outputMaps);
        }
Example #4
0
        private static List <OutputMap> SetEventMap(MapItem mapItem, ID templateID)
        {
            var outputMaps = new List <OutputMap>();
            var outputMap  = new OutputMap();

            foreach (string field in mapItem.OutputFields)
            {
                var outputField = new OutputField();
                if (field == EventOutputField.Title.GetDescription())
                {
                    outputField.SourceColumn    = BannerInputField.Title.ToString();
                    outputField.TargetFieldName = field;
                }
                else if (field == EventOutputField.PostDate.GetDescription())
                {
                    outputField.SourceColumn    = EventInputField.PostDate.ToString();
                    outputField.TargetFieldName = field;
                }
                else if (field == EventOutputField.Store.GetDescription() ||
                         field == EventOutputField.AllStore.GetDescription())
                {
                    outputField.SourceColumn    = EventInputField.Store.ToString();
                    outputField.TargetFieldName = field;
                }
                else if (field == EventOutputField.Keywords.GetDescription())
                {
                    outputField.SourceColumn    = EventInputField.Keywords.ToString();
                    outputField.TargetFieldName = field;
                }
                else if (field == EventOutputField.StartDate.GetDescription())
                {
                    outputField.SourceColumn    = EventInputField.Start_Date.ToString();
                    outputField.TargetFieldName = field;
                }
                else if (field == EventOutputField.EndDate.GetDescription())
                {
                    outputField.SourceColumn    = EventInputField.End_Date.ToString();
                    outputField.TargetFieldName = field;
                }
                else if (field == EventOutputField.Image.GetDescription())
                {
                    outputField.SourceColumn    = EventInputField.Image.ToString();
                    outputField.TargetFieldName = field;
                }
                else if (field == EventOutputField.Summary.GetDescription())
                {
                    outputField.SourceColumn    = EventInputField.Summary.ToString();
                    outputField.TargetFieldName = field;
                }
                else if (field == EventOutputField.EventType.GetDescription())
                {
                    outputField.SourceColumn    = EventInputField.EventType.ToString();
                    outputField.TargetFieldName = field;
                }
                else if (field == EventOutputField.Thumbnail.GetDescription())
                {
                    outputField.SourceColumn    = EventInputField.Thumbnail.ToString();
                    outputField.TargetFieldName = field;
                }
                else if (field == EventOutputField.Description.GetDescription())
                {
                    outputField.SourceColumn    = EventInputField.Description.ToString();
                    outputField.TargetFieldName = field;
                }
                else if (field == EventOutputField.ShowInMalls.GetDescription())
                {
                    outputField.SourceColumn    = EventInputField.ShowInMalls.ToString();
                    outputField.TargetFieldName = field;
                }
                outputMap.Fields.Add(outputField);
            }

            outputMap.TemplateId = templateID;
            outputMaps.Add(outputMap);
            return(outputMaps);
        }
Example #5
0
        private static OutputField MapStoreField(string field)
        {
            var outputField = new OutputField();

            if (field == StoreOutputField.Store.GetDescription() ||
                field == StoreOutputField.StoreOffers.GetDescription())
            {
                outputField.SourceColumn    = StoreInputField.Store.ToString();
                outputField.TargetFieldName = field;
            }
            else if (field == StoreOutputField.Logo.GetDescription())
            {
                outputField.SourceColumn    = StoreInputField.Logo.ToString();
                outputField.TargetFieldName = field;
            }
            else if (field == StoreOutputField.NewDate.GetDescription())
            {
                outputField.SourceColumn    = StoreInputField.NewDate.ToString();
                outputField.TargetFieldName = field;
            }
            else if (field == StoreOutputField.Category.GetDescription())
            {
                outputField.SourceColumn    = StoreInputField.Category.ToString();
                outputField.TargetFieldName = field;
            }
            else if (field == StoreOutputField.Description.GetDescription())
            {
                outputField.SourceColumn    = StoreInputField.Description.ToString();
                outputField.TargetFieldName = field;
            }
            else if (field == StoreOutputField.UnitNo.GetDescription())
            {
                outputField.SourceColumn    = StoreInputField.UnitNo.ToString();
                outputField.TargetFieldName = field;
            }
            else if (field == StoreOutputField.Contact.GetDescription() ||
                     field == StoreOutputField.PhoneNumber.GetDescription())
            {
                outputField.SourceColumn    = StoreInputField.Contact.ToString();
                outputField.TargetFieldName = field;
            }
            else if (field == StoreOutputField.OpeningHrs.GetDescription())
            {
                outputField.SourceColumn    = StoreInputField.OpeningHrs.ToString();
                outputField.TargetFieldName = field;
            }
            else if (field == StoreOutputField.Brands.GetDescription())
            {
                outputField.SourceColumn    = StoreInputField.Brands.ToString();
                outputField.TargetFieldName = field;
            }
            else if (field == StoreOutputField.Keywords.GetDescription())
            {
                outputField.SourceColumn    = StoreInputField.Keywords.ToString();
                outputField.TargetFieldName = field;
            }
            else if (field == StoreOutputField.UpcomingDate.GetDescription())
            {
                outputField.SourceColumn    = StoreInputField.UpcomingDate.ToString();
                outputField.TargetFieldName = field;
            }
            else if (field == StoreOutputField.ExpiryDate.GetDescription())
            {
                outputField.SourceColumn    = StoreInputField.ExpiryDate.ToString();
                outputField.TargetFieldName = field;
            }

            return(outputField);
        }