protected void gvEnvironments_RowCommand(object sender, GridViewCommandEventArgs e) { gvEnvironments.SelectedIndex = -1; panelBottom.Controls.Hide(); if (e.CommandName == "Select") { panelBottom.Style["display"] = "block"; var parameters = e.CommandArgument.ToString().Split('|'); if (parameters.Length == 2) { panelBottom.Controls.Hide(); if (parameters[0] == "ViewFarms") { var farmCriteria = new FarmCriteria(); dsFarms.Criteria = farmCriteria.AddSortBy(farmCriteria.Farm_id, false) .And(farmCriteria.Environment_id == int.Parse(parameters[1])); gvFarms.DataBind(); gvFarms.Visible = true; } else if (parameters[0] == "ViewConnectionStrings") { var connStrCriteria = new ConnectionStringCriteria(); dsConnectionStrings.Criteria = connStrCriteria.AddSortBy(connStrCriteria.Name, false) .And(connStrCriteria.Environment_id == int.Parse(parameters[1])); dsConnectionStrings.DataBind(); gvConnectionStrings.Visible = true; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var envCriteria = new EnvironmentCriteria(); dsEnvironments.Criteria = envCriteria.AddSortBy(envCriteria.Environment_id, false); var connStrCriteria = new ConnectionStringCriteria(); dsConnectionStrings.Criteria = connStrCriteria.AddSortBy(connStrCriteria.Name, false).AddSortBy(connStrCriteria.Environment_id, false); } }