Exemplo n.º 1
0
    protected void Page_Load (object sender, EventArgs e)
    {
        int viewerPersonId = Int32.Parse(HttpContext.Current.User.Identity.Name);
        Person viewerPerson = Person.FromIdentity(viewerPersonId);
        Authority authority = viewerPerson.GetAuthority();


        if (!Page.IsPostBack)
        {
            PersonList.PersonList = new People();

            // Populate list of organizations (initial population)

            Organizations organizationList = authority.GetOrganizations(RoleTypes.AllLocalRoleTypes);
            organizationList = organizationList.RemoveRedundant();

            foreach (Organization organization in organizationList)
            {
                Organizations organizationTree = organization.GetTree();

                foreach (Organization organizationOption in organizationTree)
                {
                    string orgLabel = organizationOption.NameShort;

                    /*
					for (int loop = 0; loop < organizationOption.Generation; loop++)
					{
						orgLabel = "|-- " + orgLabel;
					}*/

                    DropOrganizations.Items.Add(new ListItem(orgLabel, organizationOption.OrganizationId.ToString()));
                }
            }

            // Populate geographies


            if (Request.Cookies["mListParams"] != null)
            {
                CheckBoxRemember.Checked = true;

                RememberListParams r = new RememberListParams(Request.Cookies["mListParams"].Value);
                try { DropOrganizations.SelectedValue = r.Org; }
                catch (Exception) { }

                PopulateGeographies();

                try { DropGeographies.SelectedValue = r.Geo; }
                catch (Exception) { }

                RecalculatePersonCount();
            }
            else
            {
                PopulateGeographies();
            }

        }
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int       viewerPersonId = Int32.Parse(HttpContext.Current.User.Identity.Name);
        Person    viewerPerson   = Person.FromIdentity(viewerPersonId);
        Authority authority      = viewerPerson.GetAuthority();


        if (!Page.IsPostBack)
        {
            PersonList.PersonList = new People();

            // Populate list of organizations (initial population)

            Organizations organizationList = authority.GetOrganizations(RoleTypes.AllLocalRoleTypes);
            organizationList = organizationList.RemoveRedundant();

            foreach (Organization organization in organizationList)
            {
                Organizations organizationTree = organization.GetTree();

                foreach (Organization organizationOption in organizationTree)
                {
                    string orgLabel = organizationOption.NameShort;

                    /*
                     *                  for (int loop = 0; loop < organizationOption.Generation; loop++)
                     *                  {
                     *                          orgLabel = "|-- " + orgLabel;
                     *                  }*/

                    DropOrganizations.Items.Add(new ListItem(orgLabel, organizationOption.OrganizationId.ToString()));
                }
            }

            // Populate geographies


            if (Request.Cookies["mListParams"] != null)
            {
                CheckBoxRemember.Checked = true;

                RememberListParams r = new RememberListParams(Request.Cookies["mListParams"].Value);
                try { DropOrganizations.SelectedValue = r.Org; }
                catch (Exception) { }

                PopulateGeographies();

                try { DropGeographies.SelectedValue = r.Geo; }
                catch (Exception) { }

                RecalculatePersonCount();
            }
            else
            {
                PopulateGeographies();
            }
        }
    }
Exemplo n.º 3
0
    protected void ButtonList_Click(object sender, EventArgs e)
    {
        try
        {
            Response.Cookies.Clear();
            if (CheckBoxRemember.Checked)
            {
                RememberListParams r = new RememberListParams();
                r.Org = DropOrganizations.SelectedValue;
                r.Geo = DropGeographies.SelectedValue;
                Response.Cookies["mListParams"].Value   = r.ToString();
                Response.Cookies["mListParams"].Expires = DateTime.Now.AddMonths(1);
                Response.Cookies["mListParams"].Path    = "/m";
            }

            ExecuteSearch();
        }
        catch (Exception)
        {
        }
    }
Exemplo n.º 4
0
    protected void ButtonList_Click (object sender, EventArgs e)
    {
        try
        {
            Response.Cookies.Clear();
            if (CheckBoxRemember.Checked)
            {
                RememberListParams r = new RememberListParams();
                r.Org = DropOrganizations.SelectedValue;
                r.Geo = DropGeographies.SelectedValue;
                Response.Cookies["mListParams"].Value = r.ToString();
                Response.Cookies["mListParams"].Expires = DateTime.Now.AddMonths(1);
                Response.Cookies["mListParams"].Path = "/m";
            }

            ExecuteSearch();
        }
        catch (Exception)
        {
        }
    }