protected void Page_Init(object sender, EventArgs e) { IList <SubscriptionPlan> plans = SubscriptionPlanDataSource.LoadAll("Name"); SubscriptionGrid.Columns[6].Visible = this.ShowGroup(plans); SubscriptionPlan.DataSource = plans; SubscriptionPlan.DataBind(); if (!Page.IsPostBack) { int planId = AlwaysConvert.ToInt(Request.QueryString["PlanId"]); if (planId > 0) { ListItem item = SubscriptionPlan.Items.FindByValue(planId.ToString()); if (item != null) { SubscriptionPlan.SelectedIndex = SubscriptionPlan.Items.IndexOf(item); } } string expDays = Request.QueryString["Exp"]; if (!string.IsNullOrEmpty(expDays)) { ExpirationEnd.SelectedDate = LocaleHelper.LocalNow.AddDays(Math.Abs(AlwaysConvert.ToInt(expDays))); } string activeState = Request.QueryString["ActiveState"]; if (!string.IsNullOrEmpty(activeState)) { int active = AlwaysConvert.ToInt(activeState); if (active == -1) { ActiveOnly.SelectedIndex = 2; } else if (active == 0) { ActiveOnly.SelectedIndex = 1; } } } }
protected void Page_Init(object sender, EventArgs e) { IList <SubscriptionPlan> plans = SubscriptionPlanDataSource.LoadAll("Name"); SubscriptionPlanGrid.Columns[4].Visible = this.ShowGroup(plans); }