public AbstractDomainModel Get(AbstractDomainModel domainModel)
        {
            DomainModel.Models.EditProfile    editProfile = (DomainModel.Models.EditProfile)domainModel;
            CareHub.DataModel.Models.Provider provider    = new CareHub.DataModel.Models.Provider();
            provider = providerRepository.GetProviderByUserId(editProfile.UserId);
            editProfile.ProviderId = provider.ProviderId;
            editProfile.FirstName  = provider.FirstName;
            editProfile.LastName   = provider.LastName;
            editProfile.Gender     = provider.GenderId;
            editProfile.Email      = provider.Email;
            //editProfile.CountryName = countryRepository.GetNameById(provider.CountryId)
            editProfile.TimeZone     = provider.TimeZone;
            editProfile.MobileNumber = provider.MobileNumber;
            //editProfile.CountryId = provider.CountryId;
            //editProfile.CityId = provider.CityId;
            //editProfile.LocalityId = provider.LocalityId;
            editProfile.ZipCode = provider.ZipCode;

            return(editProfile);
        }
Example #2
0
        public AbstractDomainModel Get(AbstractDomainModel domainModel)
        {
            providerRegistration = (ProviderRegistration)domainModel;

            CareHub.DataModel.Models.Provider provider = null;
            provider = providerRepository.GetProviderByUserId(providerRegistration.UserId);
            if (provider != null)
            {
                providerRegistration.Name         = provider.FirstName;
                providerRegistration.UserId       = provider.UserId;
                providerRegistration.Name         = provider.FirstName;
                providerRegistration.Name         = provider.ScreenName;
                providerRegistration.Gender       = provider.GenderId;
                providerRegistration.MobileNumber = provider.MobileNumber;
                providerRegistration.Email        = provider.Email;
            }
            else
            {
                throw new Exception("Provider not found");
            }
            return(providerRegistration);
        }
        public AbstractDomainModel Get(AbstractDomainModel domainModel)
        {
            authenticate = (DomainModel.Models.Authenticate)domainModel;
            string encryptedPass = Encryption.Encrypt("#", authenticate.Password);
            User   user          = userRepository.GetUser(authenticate.UserId, encryptedPass);

            if (user != null)
            {
                CareHub.DataModel.Models.Provider provider = new CareHub.DataModel.Models.Provider();

                switch (user.UserRoleId)
                {
                case 1:
                    provider = providerRepository.GetProviderByUserId(authenticate.UserId);
                    if (provider != null)
                    {
                        authenticate.ProviderId = provider.ProviderId;
                    }

                    else
                    {
                        throw new Exception("Please check login credentials and then try again.");
                    }
                    break;

                default:
                    break;
                }
            }
            else
            {
                throw new Exception("Please check login credentials and then try again.");
            }

            return(authenticate);
        }