Example #1
0
        protected override void Importing(CalendarPart part, global::Orchard.ContentManagement.Handlers.ImportContentContext context)
        {
            var root          = context.Data.Element(part.PartDefinition.Name);
            var CalendarShape = root.Attribute("CalendarShape");

            if (CalendarShape != null)
            {
                part.CalendarShape = CalendarShape.Value;
            }
            var DisplayPager = root.Attribute("DisplayPager");

            if (DisplayPager != null)
            {
                part.DisplayPager = Convert.ToBoolean(DisplayPager.Value);
            }
            var ItemsPerPage = root.Attribute("ItemsPerPage");

            if (ItemsPerPage != null)
            {
                part.ItemsPerPage = Convert.ToInt32(ItemsPerPage.Value);
            }
            var NumDays = root.Attribute("NumDays");

            if (NumDays != null)
            {
                part.NumDays = NumDays.Value;
            }
            var PagerSuffix = root.Attribute("PagerSuffix");

            if (PagerSuffix != null)
            {
                part.PagerSuffix = PagerSuffix.Value;
            }
            var StartDate = root.Attribute("StartDate");

            if (StartDate != null)
            {
                part.StartDate = StartDate.Value;
            }
            context.ImportAttribute(part.PartDefinition.Name, "Query", x => {
                // cerca la campagna con l'identity indicato
                var query = context.GetItemFromSession(x);
                // verifica che si tratti effettivamente di una query
                if (query != null && query.Has <QueryPart>())
                {
                    part.QueryPartRecord = query.As <QueryPart>().Record;
                    // layout
                    var layoutIndex      = context.Attribute(part.PartDefinition.Name, "LayoutIndex");
                    int layoutIndexValue = 0;
                    if (layoutIndex != null &&
                        Int32.TryParse(layoutIndex, out layoutIndexValue) &&
                        layoutIndexValue >= 0 &&
                        part.Record.QueryPartRecord.Layouts.Count > layoutIndexValue)
                    {
                        part.Record.LayoutRecord = part.Record.QueryPartRecord.Layouts[Int32.Parse(layoutIndex)];
                    }
                }
            });
        }
        protected override void Importing(ActivityPart part, global::Orchard.ContentManagement.Handlers.ImportContentContext context)
        {
            var root   = context.Data.Element(part.PartDefinition.Name);
            var AllDay = root.Attribute("AllDay");

            if (AllDay != null)
            {
                part.AllDay = Convert.ToBoolean(AllDay.Value);
            }
            var DateTimeEnd = root.Attribute("DateTimeEnd");

            if (DateTimeEnd != null)
            {
                part.DateTimeEnd = Convert.ToDateTime(DateTimeEnd.Value, CultureInfo.InvariantCulture);
            }
            var DateTimeStart = root.Attribute("DateTimeStart");

            if (DateTimeStart != null)
            {
                part.DateTimeStart = Convert.ToDateTime(DateTimeStart.Value, CultureInfo.InvariantCulture);
            }
            var Repeat = root.Attribute("Repeat");

            if (Repeat != null)
            {
                part.Repeat = Convert.ToBoolean(Repeat.Value);
            }
            var RepeatDetails = root.Attribute("RepeatDetails");

            if (RepeatDetails != null)
            {
                part.RepeatDetails = RepeatDetails.Value;
            }
            var RepeatEnd = root.Attribute("RepeatEnd");

            if (RepeatEnd != null)
            {
                part.RepeatEnd = Convert.ToBoolean(RepeatEnd.Value);
            }
            var RepeatEndDate = root.Attribute("RepeatEndDate");

            if (RepeatEndDate != null)
            {
                part.RepeatEndDate = Convert.ToDateTime(RepeatEndDate.Value, CultureInfo.InvariantCulture);
            }
            var RepeatType = root.Attribute("RepeatType");

            if (RepeatType != null)
            {
                part.RepeatType = RepeatType.Value;
            }
            var RepeatValue = root.Attribute("RepeatValue");

            if (RepeatValue != null)
            {
                part.RepeatValue = Convert.ToInt32(RepeatValue.Value);
            }
        }
        protected override void Importing(FidelityUserPart part, global::Orchard.ContentManagement.Handlers.ImportContentContext context)
        {
            var root             = context.Data.Element(part.PartDefinition.Name);
            var FidelityUsername = root.Attribute("FidelityUsername");

            if (FidelityUsername != null)
            {
                part.FidelityUsername = FidelityUsername.Value;
            }
            var FidelityPassword = root.Attribute("FidelityPassword");

            if (FidelityPassword != null)
            {
                part.FidelityPassword = FidelityPassword.Value;
            }
            var CustomerId = root.Attribute("CustomerId");

            if (CustomerId != null)
            {
                part.CustomerId = CustomerId.Value;
            }
        }
Example #4
0
 protected override void Importing(FaqTypePart part, global::Orchard.ContentManagement.Handlers.ImportContentContext context)
 {
     part.Title = context.Attribute(part.PartDefinition.Name, "FaqTypeTitle") ?? string.Empty;
 }
Example #5
0
 protected override void Importing(FaqPart part, global::Orchard.ContentManagement.Handlers.ImportContentContext context)
 {
     part.Question  = context.Attribute(part.PartDefinition.Name, "Question") ?? string.Empty;
     part.FaqTypeId = context.Attribute(part.PartDefinition.Name, "FaqTypeId") == string.Empty ? 0 : int.Parse(context.Attribute(part.PartDefinition.Name, "FaqTypeId"));
 }