Ejemplo n.º 1
0
        private void Page_Load(object sender, EventArgs e)
        {
            try
            {
                // check VI for null then set information
                if (!this.Page.IsPostBack)
                {
                    // localize the itemrelationship controls
                    this.LocalizeControl();

                    // get the relationshipId and populate relationships
                    ArrayList alItemRelationships = ItemRelationship.GetItemRelationships(
                        this.VersionInfoObject.ItemId, this.VersionInfoObject.ItemVersionId, this.CreateRelationshipTypeId, false);
                    foreach (ItemRelationship ir in alItemRelationships)
                    {
                        string parentName = ItemType.GetItemName(ir.ParentItemId);
                        if (this._enableDates)
                        {
                            // add dates to the viewstate
                            this.SetAdditionalSetting(
                                "startDate", Utility.GetInvariantDateTime(ir.StartDate), ir.ParentItemId.ToString(CultureInfo.InvariantCulture));
                            this.SetAdditionalSetting(
                                "endDate", Utility.GetInvariantDateTime(ir.EndDate), ir.ParentItemId.ToString(CultureInfo.InvariantCulture));
                        }

                        var li = new ListItem(ir.ParentItemId + "-" + parentName, ir.ParentItemId.ToString(CultureInfo.InvariantCulture));
                        this.lstSelectedItems.Items.Add(li);
                    }

                    if (this._enableSortOrder)
                    {
                        this.trUpImage.Visible   = true;
                        this.trDownImage.Visible = true;
                    }

                    if (this._allowSearch)
                    {
                        this.pnlItemSearch.Visible = true;
                    }

                    if (this.AvailableSelectionMode == ListSelectionMode.Single)
                    {
                        this.lstSelectedItems.Rows      = 1;
                        this.lstSelectedItems.CssClass += " Publish_ParentCategory";
                    }
                }
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }