예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         LocalPropertiesContext.Initialize(this.Session);
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.CurrentProfile == null)
            {
                Navigator.RedirectToDefaultPage(this.Response);
            }

            if (!this.IsPostBack)
            {
                // Init Controls
                ITICLabel.Text               = this.CurrentProfile.ITICCode.Code;
                InfrastructureLabel.Text     = this.CurrentProfile.ITICCode.Infrastructure.Name;
                CapabilityLabel.Text         = this.CurrentProfile.ITICCode.Capability.Name;
                LogicalSystemGroupLabel.Text = this.CurrentProfile.ITICCode.LogicalSystemGroup.Name;
                FilenameLabel.Text           = this.CurrentProfile.Context.Name;

                // Check CheckBoxes
                if (this.CurrentProfile.LocalProperties.Count == 0)
                {
                    OptionsRadioButtonList.SelectedIndex = 0;
                    LocalPropertiesContext.Initialize(this.Session);
                }
                else if (this.CurrentProfile.LocalProperties.Count > 0 && this.CurrentProfile.LocalProperties.All((lp) => String.IsNullOrWhiteSpace(lp.DatacentreSuffix)))
                {
                    OptionsRadioButtonList.SelectedIndex = 1;
                    LocalPropertiesContext.Initialize(this.Session);
                }
                else
                {
                    OptionsRadioButtonList.SelectedIndex = 2;
                    if (this.CurrentProfile.LocalProperties.Count == 0)
                    {
                        this.CurrentProfile.LocalProperties = LocalPropertiesContext.Load();
                    }
                    LocalPropertiesContext.Initialize(this.Session, this.CurrentProfile.LocalProperties);
                }
                SetState();

                // Set initial State
                UIHelper.SetMessage(MessageImage, MessageLabel, MessageType.None, null);
            }
        }