Beispiel #1
0
        private void LoadInitialData()
        {
            //DrpOraganizations
            DrpOraganizations.DataSource     = RHP.Utility.Generic.GetAll <Oraganization>();
            DrpOraganizations.DataTextField  = "OraganizationName";
            DrpOraganizations.DataValueField = "OraganizationId";
            DrpOraganizations.DataBind();
            DrpOraganizations.Items.Insert(0, new ListItem(Constants.DROPDOWN_EMPTY_ITEM_TEXT, Constants.DROPDOWN_EMPTY_ITEM_VALUE));

            //DrpFraternity
            DrpFraternity.DataSource     = RHP.Utility.Generic.GetAll <Fraternity>();
            DrpFraternity.DataTextField  = "FraternityName";
            DrpFraternity.DataValueField = "FraternityId";
            DrpFraternity.DataBind();
            DrpFraternity.Items.Insert(0, new ListItem(Constants.DROPDOWN_EMPTY_ITEM_TEXT, Constants.DROPDOWN_EMPTY_ITEM_VALUE));

            //DrpSoroity
            DrpSoroity.DataSource     = RHP.Utility.Generic.GetAll <Soroity>();
            DrpSoroity.DataTextField  = "SoroityName";
            DrpSoroity.DataValueField = "SoroityId";
            DrpSoroity.DataBind();
            DrpSoroity.Items.Insert(0, new ListItem(Constants.DROPDOWN_EMPTY_ITEM_TEXT, Constants.DROPDOWN_EMPTY_ITEM_VALUE));

            //DrpGreekOrganizations
            DrpGreekOrganizations.DataSource     = RHP.Utility.Generic.GetAll <GreakOrganization>();
            DrpGreekOrganizations.DataTextField  = "GreakOrganizationName";
            DrpGreekOrganizations.DataValueField = "GreakOrganizationId";
            DrpGreekOrganizations.DataBind();
            DrpGreekOrganizations.Items.Insert(0, new ListItem(Constants.DROPDOWN_EMPTY_ITEM_TEXT, Constants.DROPDOWN_EMPTY_ITEM_VALUE));


            // DrpGreekHonorSocities
            DrpGreekHonorSocities.DataSource     = RHP.Utility.Generic.GetAll <GreekHonorSocities>();
            DrpGreekHonorSocities.DataTextField  = "GreekHonorSocitiesName";
            DrpGreekHonorSocities.DataValueField = "GreekHonorSocitiesId";
            DrpGreekHonorSocities.DataBind();
            DrpGreekHonorSocities.Items.Insert(0, new ListItem(Constants.DROPDOWN_EMPTY_ITEM_TEXT, Constants.DROPDOWN_EMPTY_ITEM_VALUE));
        }
Beispiel #2
0
        public void loaddata()
        {
            // school data

            spotlight = Spotlight.Select(Guid.Parse(Membership.GetUser().ProviderUserKey.ToString()));

            if (spotlight != null)
            {
                Awards.Text       = string.IsNullOrEmpty(spotlight.Awards) ? string.Empty : spotlight.Awards;
                Achievements.Text = string.IsNullOrEmpty(spotlight.Achievements) ? string.Empty : spotlight.Achievements;
                CurentGPA.Text    = string.IsNullOrEmpty(spotlight.CurentGPA) ? string.Empty : spotlight.CurentGPA;
                Involvments.Text  = string.IsNullOrEmpty(spotlight.Involvments) ? string.Empty : spotlight.Involvments;

                if (spotlight.OraganizationId.HasValue)
                {
                    for (int i = 0; i < DrpOraganizations.Items.Count; i++)
                    {
                        if (DrpOraganizations.Items[i].Value.ToString().ToLower() == spotlight.OraganizationId.ToString().ToLower())
                        {
                            DrpOraganizations.ClearSelection();
                            DrpOraganizations.Items[i].Selected = true;
                        }
                    }
                }

                if (spotlight.FraternityId.HasValue)
                {
                    for (int i = 0; i < DrpFraternity.Items.Count; i++)
                    {
                        if (DrpFraternity.Items[i].Value.ToString().ToLower() == spotlight.OraganizationId.ToString().ToLower())
                        {
                            DrpFraternity.ClearSelection();
                            DrpFraternity.Items[i].Selected = true;
                        }
                    }
                }

                if (spotlight.SoroityId.HasValue)
                {
                    for (int i = 0; i < DrpSoroity.Items.Count; i++)
                    {
                        if (DrpSoroity.Items[i].Value.ToString().ToLower() == spotlight.SoroityId.ToString().ToLower())
                        {
                            DrpSoroity.ClearSelection();
                            DrpSoroity.Items[i].Selected = true;
                        }
                    }
                }

                if (spotlight.GreakOrganizationId.HasValue)
                {
                    for (int i = 0; i < DrpGreekOrganizations.Items.Count; i++)
                    {
                        if (DrpGreekOrganizations.Items[i].Value.ToString().ToLower() == spotlight.GreakOrganizationId.ToString().ToLower())
                        {
                            DrpGreekOrganizations.ClearSelection();
                            DrpGreekOrganizations.Items[i].Selected = true;
                        }
                    }
                }

                if (spotlight.GreekHonorSocitiesId.HasValue)
                {
                    for (int i = 0; i < DrpGreekHonorSocities.Items.Count; i++)
                    {
                        if (DrpGreekHonorSocities.Items[i].Value.ToString().ToLower() == spotlight.GreekHonorSocitiesId.ToString().ToLower())
                        {
                            DrpGreekHonorSocities.ClearSelection();
                            DrpGreekHonorSocities.Items[i].Selected = true;
                        }
                    }
                }
            }
        }