private void cbServerGroup_SelectedIndexChanged(object sender, EventArgs e) { if (cbServerGroup.Text != "") { gbDev.Enabled = true; gbUAT.Enabled = true; gbPreProd.Enabled = true; gbProd.Enabled = true; tServerAliasDev.Text = ""; tServerNameDev.Text = ""; cbServerRoleDev.Text = "Development"; tReleaseOrderDev.Text = "1"; tServerAliasUAT.Text = ""; tServerNameUAT.Text = ""; cbServerRoleUAT.Text = "User Acceptance Testing"; tReleaseOrderUAT.Text = "2"; tServerAliasPreProd.Text = ""; tServerNamePreProd.Text = ""; cbServerRolePreProd.Text = "Pre-Production"; tReleaseOrderPreProd.Text = "3"; tServerAliasProd.Text = ""; tServerNameProd.Text = ""; cbServerRoleProd.Text = "Production"; tReleaseOrderProd.Text = "4"; try { using (DataStuff sn = new DataStuff()) { DataTable dt = sn.GetServersInGroupDetail(cbServerGroup.Text); if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { if (row["ServerRoleDesc"].ToString() == "Development") { tServerAliasDev.Text = row["ServerAliasDesc"].ToString(); tServerNameDev.Text = row["ServerName"].ToString(); cbServerRoleDev.Text = row["ServerRoleDesc"].ToString(); tReleaseOrderDev.Text = row["ReleaseOrder"].ToString(); } if (row["ServerRoleDesc"].ToString() == "User Acceptance Testing") { tServerAliasUAT.Text = row["ServerAliasDesc"].ToString(); tServerNameUAT.Text = row["ServerName"].ToString(); cbServerRoleUAT.Text = row["ServerRoleDesc"].ToString(); tReleaseOrderUAT.Text = row["ReleaseOrder"].ToString(); } if (row["ServerRoleDesc"].ToString() == "Pre-Production") { tServerAliasPreProd.Text = row["ServerAliasDesc"].ToString(); tServerNamePreProd.Text = row["ServerName"].ToString(); cbServerRolePreProd.Text = row["ServerRoleDesc"].ToString(); tReleaseOrderPreProd.Text = row["ReleaseOrder"].ToString(); } if (row["ServerRoleDesc"].ToString() == "Production") { tServerAliasProd.Text = row["ServerAliasDesc"].ToString(); tServerNameProd.Text = row["ServerName"].ToString(); cbServerRoleProd.Text = row["ServerRoleDesc"].ToString(); tReleaseOrderProd.Text = row["ReleaseOrder"].ToString(); } } tsbSave.Enabled = true; } } } catch { throw; } } }