public ProfileModel(int ID)
        {
            ProfileCollection collection = new ProfileCollection();

            Profiles.Business.Profile userProfile = collection.GetProfile(ID);

            FullName        = userProfile.FirstName + " " + userProfile.LastName;
            SPIERole        = userProfile.SPIERole;
            Company         = userProfile.Company;
            JobTitle        = userProfile.JobTitle;
            PictureFileName = userProfile.PictureFileName;
        }
예제 #2
0
        public ProfileModel(int ID, string filter = "")
        {
            DatabaseService   service    = new DatabaseService();
            ProfileCollection collection = new ProfileCollection(service)
            {
                FilterText = filter
            };

            Profiles.Business.Profile userProfile = collection.GetProfile(ID);

            FullName        = userProfile.FirstName + " " + userProfile.LastName;
            SPIERole        = userProfile.SPIERole;
            Company         = userProfile.Company;
            JobTitle        = userProfile.JobTitle;
            PictureFileName = userProfile.PictureFileName;
        }
        public ProfileModel(int ID)
        {
            //Retrieve current selection of profiles
            ProfileCollection collection = new ProfileCollection();

            //Determine if queried profile exists
            Profiles.Business.Profile userProfile = collection.GetProfile(ID);
            if (userProfile != null)
            {
                FullName        = userProfile.FirstName + " " + userProfile.LastName;
                SPIERole        = userProfile.SPIERole;
                Company         = userProfile.Company;
                JobTitle        = userProfile.JobTitle;
                PictureFileName = userProfile.PictureFileName;
            }
            else
            {
                throw new Exception("Profile doesn't exist");
            }
        }