Ejemplo n.º 1
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;
                        }
                    }
                }
            }
        }
        public void loadSpotlightdata(Guid AccessCode)
        {
            // school data
            Spotlight spotlight;

            spotlight = Spotlight.Select(AccessCode);

            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)
                {
                    Oraganization oraganization;
                    oraganization = Generic.Get <Oraganization>(spotlight.OraganizationId.Value);
                    if (oraganization != null)
                    {
                        txtOraganizations.Text = oraganization.OraganizationName;
                    }
                }

                if (spotlight.FraternityId.HasValue)
                {
                    Fraternity fraternity;
                    fraternity = Generic.Get <Fraternity>(spotlight.FraternityId.Value);
                    if (fraternity != null)
                    {
                        txtFraternity.Text = fraternity.FraternityName;
                    }
                }

                if (spotlight.SoroityId.HasValue)
                {
                    Soroity soroity;
                    soroity = Generic.Get <Soroity>(spotlight.SoroityId.Value);
                    if (soroity != null)
                    {
                        txtSoroity.Text = soroity.SoroityName;
                    }
                }

                if (spotlight.GreakOrganizationId.HasValue)
                {
                    GreakOrganization greakOrganization;
                    greakOrganization = Generic.Get <GreakOrganization>(spotlight.GreakOrganizationId.Value);
                    if (greakOrganization != null)
                    {
                        txyGreakOrganization.Text = greakOrganization.GreakOrganizationName;
                    }
                }

                if (spotlight.GreekHonorSocitiesId.HasValue)
                {
                    GreekHonorSocities greekHonorSocities;
                    greekHonorSocities = Generic.Get <GreekHonorSocities>(spotlight.GreekHonorSocitiesId.Value);
                    if (greekHonorSocities != null)
                    {
                        txtGreekHonorSocities.Text = greekHonorSocities.GreekHonorSocitiesName;
                    }
                }
            }
        }