예제 #1
0
        public bool LoadProfileTypes()
        {
            ProfileServiceClient client = null;
            bool result = false;

            try
            {
                client = new ProfileServiceClient();
                ProfileType [] profileTypes = client.RetrieveProfileTypes();
                CommonLibrary.Utilty.Sort.GenericList <ProfileType> genericList = new CommonLibrary.Utilty.Sort.GenericList <ProfileType>();
                genericList.AddRange(profileTypes);
                genericList.Sort("ProfileName", CommonLibrary.Utilty.Sort.CollectionSortDirection.Ascending);

                if (genericList != null && genericList.Count > 0)
                {
                    _view.ProfileTypes = genericList;
                    result             = true;
                }
            }
            catch (TimeoutException te)
            {
                _log.Fatal(te);
            }
            catch (FaultException fe)
            {
                _log.Fatal(fe);
            }
            catch (CommunicationException ce)
            {
                _log.Fatal(ce);
            }

            catch (Exception ex)
            {
                _log.Fatal(ex);
            }

            finally
            {
                if (client != null)
                {
                    client.CloseProxy();
                }
            }

            return(result);
        }