protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["UnitGroupId"] != null) { if (!IsPostBack) { OrganizationalUnitGroupEntity entity = new OrganizationalUnitGroupMapper().Get(new OrganizationalUnitGroupEntity() { Id = Convert.ToInt32(Request.QueryString["UnitGroupId"]) }); if (entity != null) { TitleTextBox.Text = entity.Title; OtherInfoTextBox.Text = entity.Description; } else { Response.Redirect("List.aspx"); } } } else { Response.Redirect("List.aspx"); } }
public CascadingDropDownNameValue[] GetOrganizationalUnitGroups(string knownCategoryValues, string category, string contextKey) { List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>(); List<OrganizationalUnitGroupEntity> list = new OrganizationalUnitGroupMapper().List(""); foreach (OrganizationalUnitGroupEntity ent in list) { CascadingDropDownNameValue cdnv; if (ent.Title == contextKey) { cdnv = new CascadingDropDownNameValue(ent.Title, ent.Id.ToString(), true); } else { cdnv = new CascadingDropDownNameValue(ent.Title, ent.Id.ToString()); } values.Add(cdnv); } return values.ToArray(); }