コード例 #1
0
        void IUnitOfWork.Update(AbstractDomainModel domainModel)
        {
            try
            {
                editProfile = (EditProfile)domainModel;
                //string[] fullName = editProfile.FullName.Split(' ');
                //string firstName = fullName[0];
                //string lastName = string.Empty;
                //for (int i = 1; i < fullName.Length; i++)
                //{
                //    if (i > 1)
                //    { lastName += " "; }
                //    else { lastName += fullName[i]; }
                //}
                Provider provider = new Provider();
                provider.UserId       = editProfile.UserId;
                provider.ProviderId   = editProfile.ProviderId;
                provider.FirstName    = editProfile.FirstName;
                provider.LastName     = editProfile.LastName;
                provider.GenderId     = editProfile.Gender;
                provider.TimeZone     = editProfile.TimeZone;
                provider.MobileNumber = editProfile.MobileNumber;
                //provider.CountryId = editProfile.CountryId;
                //provider.CityId = editProfile.CityId;
                //provider.LocalityId = editProfile.LocalityId;
                provider.ZipCode = editProfile.ZipCode;

                providerRepository.Update(provider);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
        public AbstractDomainModel Get(AbstractDomainModel domainModel)
        {
            searchPractice = (DomainModel.Models.PracticesSearch)domainModel;
            switch (searchPractice.SearchType)
            {
            case 1:
                searchPractice.Practices = practiceRepository.GetPracticeByHospital(searchPractice.City, searchPractice.Hospital);
                break;

            case 2:
                searchPractice.Practices = practiceRepository.GetPracticeByHospitalLocality(searchPractice.City, searchPractice.Hospital, searchPractice.Locality);
                break;

            case 3:
                searchPractice.Practices = practiceRepository.GetPracticeByLab(searchPractice.City, searchPractice.Lab);
                break;

            case 4:
                searchPractice.Practices = practiceRepository.GetPracticeByLabLocality(searchPractice.City, searchPractice.Lab, searchPractice.Locality);
                break;

            default:
                break;
            }

            return(searchPractice);
        }
コード例 #3
0
        public string GetABetterOffer(string address, int cityId, int customerId, short cylinders, string emailAddress, string make, string model, string name, string phone, string questionnaire, int selectedMakeId, int selectedModelId, int selectedYear, int stateId, string zipCode)
        {
            FactoryFacade factory = new FactoryFacade();

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(Home));
            domainModel.Fill(HashHelper.GetABetterOffer(address, cityId, customerId, cylinders, emailAddress, make, model, name, phone, questionnaire, selectedMakeId, selectedModelId, selectedYear, stateId, zipCode));
            domainService = factory.DomainServiceFactory.CreateDomainService(typeof(HomeDomainService));
            return(((DomainModel.Models.Home)domainService.Query(domainModel, DomainModelEnum.GET_A_BETTER_OFFER)).OfferPrice);
        }
コード例 #4
0
        public string ConfirmOfferWithQuestionnaire(string address, int cityId, string contactNo, int customerId, short cylinders, string emailAddress, string make, string model, string name, string phone, string price, string questionnaire, int selectedMakeId, int selectedModelId, int selectedYear, int stateId, string zipCode)
        {
            FactoryFacade factory = new FactoryFacade();

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(Home));
            domainModel.Fill(HashHelper.ConfirmOfferWithQuestionnaire(address, cityId, contactNo, customerId, cylinders, emailAddress, make, model, name, phone, price, questionnaire, selectedMakeId, selectedModelId, selectedYear, stateId, zipCode));
            domainService = factory.DomainServiceFactory.CreateDomainService(typeof(HomeDomainService));
            return(((DomainModel.Models.Home)domainService.Query(domainModel, DomainModelEnum.CONFIRM_OFFER_WITH_QUESTIONNAIRE)).ResponseMessage);
        }
コード例 #5
0
        public int GetCustomerId(string address, int cityId, string emailAddress, string name, string phone, int stateId, string zipCode)
        {
            FactoryFacade factory = new FactoryFacade();

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(Home));
            domainModel.Fill(HashHelper.GetCustomerId(address, cityId, emailAddress, name, phone, stateId, zipCode));
            domainService = factory.DomainServiceFactory.CreateDomainService(typeof(HomeDomainService));
            return(((DomainModel.Models.Home)domainService.Query(domainModel, DomainModelEnum.GET_CUSTOMER_ID)).CustomerId);
        }
コード例 #6
0
        public List <JunkCar.DataModel.Models.Set_Model> GetModels(int year, int makeId)
        {
            FactoryFacade factory = new FactoryFacade();

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(Home));
            domainModel.Fill(HashHelper.GetModels(year, makeId));
            domainService = factory.DomainServiceFactory.CreateDomainService(typeof(HomeDomainService));
            return(((DomainModel.Models.Home)domainService.Query(domainModel, DomainModelEnum.GET_MODELS)).Models);
        }
コード例 #7
0
        public CheckZipCode_Result CheckZipCode(string zipCode)
        {
            FactoryFacade factory = new FactoryFacade();

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(Home));
            domainModel.Fill(HashHelper.CheckZipCode(zipCode));
            domainService = factory.DomainServiceFactory.CreateDomainService(typeof(HomeDomainService));
            return(((DomainModel.Models.Home)domainService.Query(domainModel, DomainModelEnum.CHECK_ZIPCODE)).ZipCodeResult);
        }
コード例 #8
0
        public List <Set_City> GetCities(int stateId)
        {
            FactoryFacade factory = new FactoryFacade();

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(Home));
            domainModel.Fill(HashHelper.GetCities(stateId));
            domainService = factory.DomainServiceFactory.CreateDomainService(typeof(HomeDomainService));
            return(((DomainModel.Models.Home)domainService.Query(domainModel, DomainModelEnum.GET_CITIES)).Cities);
        }
コード例 #9
0
        public override AbstractDomainModel Query(AbstractDomainModel domainModel, CareHub.Factory.Enumerations.DomainModelEnum domainModelType)
        {
            DomainModel.Models.DoctorsSearch searchDoctor = (DomainModel.Models.DoctorsSearch)domainModel;
            try
            {
                if (domainModel != null)
                {
                    FactoryFacade factory = new FactoryFacade();
                    switch (domainModelType)
                    {
                    case CareHub.Factory.Enumerations.DomainModelEnum.DOCTOR_SEARCH:
                        unitOfWork   = factory.UnitOfWorkFactory.CreateUnitOfWork(typeof(CareHub.UnitOfWork.DoctorsSearchUOW));
                        searchDoctor = (DomainModel.Models.DoctorsSearch)unitOfWork.Get(searchDoctor);
                        searchDoctor.ResponseMessage = "Valid domain model";
                        break;

                    default:
                        break;
                    }
                }
                else
                {
                    switch (domainModelType)
                    {
                    case CareHub.Factory.Enumerations.DomainModelEnum.DOCTOR_SEARCH:
                        searchDoctor.ResponseMessage = "Invalid domain model";
                        break;

                    default:
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                switch (domainModelType)
                {
                case CareHub.Factory.Enumerations.DomainModelEnum.DOCTOR_SEARCH:
                    searchDoctor.ResponseMessage = ex.Message;
                    break;

                default:
                    break;
                }
            }
            switch (domainModelType)
            {
            case CareHub.Factory.Enumerations.DomainModelEnum.DOCTOR_SEARCH:
                return(searchDoctor);

            default:
                break;
            }

            return(null);
        }
コード例 #10
0
        public IQueryable SearchProvider(long city, string locality, string specialty, string doctor, string hospital, string lab, string pharmacist, string nurse, string treatment, int searchType)
        {
            FactoryFacade factory = new FactoryFacade();

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(DoctorsSearch));
            domainModel.Fill(HashHelper.SearchDoctor(city, locality, specialty, doctor, hospital, lab, pharmacist, nurse, treatment, searchType));
            domainService = factory.DomainServiceFactory.CreateDomainService(typeof(DoctorsSearchDomainService));
            domainModel   = domainService.Query(domainModel, CareHub.Factory.Enumerations.DomainModelEnum.DOCTOR_SEARCH);
            return(((DomainModel.Models.DoctorsSearch)domainModel).Providers.AsQueryable());
        }
コード例 #11
0
        public IQueryable GetLocalities(int country, long city, int searchType)
        {
            FactoryFacade factory = new FactoryFacade();

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(DoctorsSearch));
            domainModel.Fill(HashHelper.GetLocalitiesByCountryCity(country, city, searchType));
            domainService = factory.DomainServiceFactory.CreateDomainService(typeof(DoctorsSearchDomainService));
            domainModel   = domainService.Query(domainModel, CareHub.Factory.Enumerations.DomainModelEnum.DOCTOR_SEARCH);
            return(((DomainModel.Models.DoctorsSearch)domainModel).Localities.AsQueryable());
        }
コード例 #12
0
        public IQueryable SearchPractice(long city, string locality, string hospital, string lab, int searchType)
        {
            FactoryFacade factory = new FactoryFacade();

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(PracticesSearch));
            domainModel.Fill(HashHelper.SearchPractice(city, locality, hospital, lab, searchType));
            domainService = factory.DomainServiceFactory.CreateDomainService(typeof(PracticesSearchDomainService));
            domainModel   = domainService.Query(domainModel, CareHub.Factory.Enumerations.DomainModelEnum.PRACTICE_SEARCH);
            return(((DomainModel.Models.PracticesSearch)domainModel).Practices.AsQueryable());
        }
コード例 #13
0
        public IHttpActionResult ForgotPassword(string newPassword, string userId)
        {
            ForgotPassword forgotPassword = null;
            FactoryFacade  factory        = new FactoryFacade();

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(ForgotPassword));
            domainModel.Fill(HashHelper.ForgotPassword(newPassword, userId));
            domainService = factory.DomainServiceFactory.CreateDomainService(typeof(AccountsDomainService));
            return(Ok(((ForgotPassword)domainService.Update(domainModel, CareHub.Factory.Enumerations.DomainModelEnum.FORGOT_PASSWORD)).ResponseMessage));
        }
コード例 #14
0
        public IHttpActionResult EditProfileApp(string email, string name, string address, string phone, string zipCode, int?questionId, string answer)
        {
            EditProfile   editProfile = null;
            FactoryFacade factory     = new FactoryFacade();

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(EditProfile));
            domainModel.Fill(HashHelper.EditProfile(email, name, address, phone, zipCode, questionId, answer));
            domainService = factory.DomainServiceFactory.CreateDomainService(typeof(AccountsDomainService));
            editProfile   = (EditProfile)domainService.Update(domainModel, JunkCar.Core.Enumerations.DomainModelEnum.EDIT_PROFILE);
            return(Ok(editProfile.ResponseMessage));
        }
コード例 #15
0
        public string CheckSecurityQuestionAnswer(string answer, int questionId, string userId)
        {
            FactoryFacade  factory        = new FactoryFacade();
            ForgotPassword forgotPassword = null;

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(ForgotPassword));
            domainModel.Fill(HashHelper.CheckSecurityQuestion(questionId, answer.ToLower(), userId));
            domainService  = factory.DomainServiceFactory.CreateDomainService(typeof(AccountsDomainService));
            forgotPassword = (ForgotPassword)domainService.Query(domainModel, DomainModelEnum.CHECK_SECURITY_QUESTION_ANSWER);
            return(forgotPassword.ResponseMessage);
        }
コード例 #16
0
        public string CheckVerificationCode(int verificationCode)
        {
            FactoryFacade  factory        = new FactoryFacade();
            ForgotPassword forgotPassword = null;

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(ForgotPassword));
            domainModel.Fill(HashHelper.CheckVerificationCode(verificationCode));
            domainService  = factory.DomainServiceFactory.CreateDomainService(typeof(AccountsDomainService));
            forgotPassword = (ForgotPassword)domainService.Query(domainModel, DomainModelEnum.CHECK_VERIFICATION_CODE);
            return(forgotPassword.ResponseMessage);
        }
コード例 #17
0
        public IHttpActionResult ChangePasswordApp(string email, string currentPassword, string newPassword)
        {
            ChangePassword changePassword = null;
            FactoryFacade  factory        = new FactoryFacade();

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(ChangePassword));
            domainModel.Fill(HashHelper.ChangePassword(currentPassword, newPassword, email));
            domainService  = factory.DomainServiceFactory.CreateDomainService(typeof(AccountsDomainService));
            changePassword = (ChangePassword)domainService.Update(domainModel, JunkCar.Core.Enumerations.DomainModelEnum.CHANGE_PASSWORD);
            return(Ok(changePassword.ResponseMessage));
        }
コード例 #18
0
        public string ResetPassword(string newPassword, string userId)
        {
            FactoryFacade  factory        = new FactoryFacade();
            ForgotPassword forgotPassword = null;

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(ForgotPassword));
            domainModel.Fill(HashHelper.ResetPassword(userId, newPassword));
            domainService  = factory.DomainServiceFactory.CreateDomainService(typeof(AccountsDomainService));
            forgotPassword = (ForgotPassword)domainService.Query(domainModel, DomainModelEnum.RESET_PASSWORD);
            return(forgotPassword.ResponseMessage);
        }
コード例 #19
0
        public UserProfile GetUserInfoApp(string email)
        {
            UserProfile   userProfile = null;
            FactoryFacade factory     = new FactoryFacade();

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(UserProfile));
            domainModel.Fill(HashHelper.GetUserInfo(email));
            domainService = factory.DomainServiceFactory.CreateDomainService(typeof(AccountsDomainService));
            userProfile   = (UserProfile)domainService.Query(domainModel, DomainModelEnum.GET_USER_INFO);
            return(userProfile);
        }
コード例 #20
0
        public JunkCar.DataModel.Models.Sec_Password_Question GetSecurityQuestion(string userId)
        {
            FactoryFacade  factory        = new FactoryFacade();
            ForgotPassword forgotPassword = null;

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(ForgotPassword));
            domainModel.Fill(HashHelper.GetSecurityQuestion(userId));
            domainService  = factory.DomainServiceFactory.CreateDomainService(typeof(AccountsDomainService));
            forgotPassword = (ForgotPassword)domainService.Query(domainModel, DomainModelEnum.GET_SECURITY_QUESTION);
            return(forgotPassword.SecurityQuestion);
        }
コード例 #21
0
        public string CheckUserId(string userId)
        {
            FactoryFacade factory      = new FactoryFacade();
            Authenticate  authenticate = null;

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(Authenticate));
            domainModel.Fill(HashHelper.CheckUserId(userId));
            domainService = factory.DomainServiceFactory.CreateDomainService(typeof(AccountsDomainService));
            authenticate  = (Authenticate)domainService.Query(domainModel, DomainModelEnum.CHECK_USER_ID);
            return(authenticate.ResponseMessage);
        }
コード例 #22
0
 void IUnitOfWork.Update(AbstractDomainModel domainModel)
 {
     try
     {
         forgotPassword = (ForgotPassword)domainModel;
         userRepository.Update(forgotPassword.UserId, CareHub.Core.Common.Encryption.Encrypt("#", forgotPassword.NewPassword));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #23
0
        public string Signup(string address, string email, string name, string password, string phone, string zipCode, int questionId, string answer)
        {
            string        response = string.Empty;
            FactoryFacade factory  = new FactoryFacade();
            Signup        signup   = null;

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(Signup));
            domainModel.Fill(HashHelper.Signup(address, email, name, password, phone, zipCode, questionId, answer));
            domainService = factory.DomainServiceFactory.CreateDomainService(typeof(AccountsDomainService));
            signup        = (Signup)domainService.Save(domainModel, DomainModelEnum.SIGNUP);
            return(signup.ResponseMessage);
        }
コード例 #24
0
        public string ContactEmailMessage(string email, string message, string name, string phone, string subject)
        {
            string        response  = string.Empty;
            FactoryFacade factory   = new FactoryFacade();
            ContactUs     contactUs = null;

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(ContactUs));
            domainModel.Fill(HashHelper.ContactEmailMessage(name, email, phone, subject, message));
            domainService = factory.DomainServiceFactory.CreateDomainService(typeof(ContactUsDomainService));
            contactUs     = (ContactUs)domainService.Query(domainModel, DomainModelEnum.CONTACT_EMAIL_MESSAGE);
            return(contactUs.ResponseMessage);
        }
コード例 #25
0
 void IUnitOfWork.Update(AbstractDomainModel domainModel)
 {
     try
     {
         changePassword = (ChangePassword)domainModel;
         userRepository.Update(changePassword.UserId, CareHub.Core.Common.Encryption.Encrypt("#", changePassword.CurrentPassword),
                               CareHub.Core.Common.Encryption.Encrypt("#", changePassword.NewPassword));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #26
0
        public IHttpActionResult ProviderRegistration(string name, int gender, string phone, string email, string password, string clinicName, long majorSpecialty, int country, long city, long area, string clinicAddress)
        {
            string               response             = string.Empty;
            FactoryFacade        factory              = new FactoryFacade();
            ProviderRegistration providerRegistration = null;

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(ProviderRegistration));
            domainModel.Fill(HashHelper.ProviderRegistration(name, gender, phone, email, password, clinicName, majorSpecialty, country, city, area, clinicAddress));
            domainService        = factory.DomainServiceFactory.CreateDomainService(typeof(AccountsDomainService));
            providerRegistration = (ProviderRegistration)domainService.Save(domainModel, CareHub.Factory.Enumerations.DomainModelEnum.PROVIDER_REGISTRATION);

            return(Ok(providerRegistration.ResponseMessage));
        }
コード例 #27
0
        public IHttpActionResult EditProfile(string name, string address, string phone, string zipCode, int?questionId, string answer)
        {
            EditProfile editProfile = null;
            string      data        = TicketHelper.GetDecryptedUserId();

            string[]      dataList = data.Split(',');
            FactoryFacade factory  = new FactoryFacade();

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(EditProfile));
            domainModel.Fill(HashHelper.EditProfile(dataList[0], name, address, phone, zipCode, questionId, answer));
            domainService = factory.DomainServiceFactory.CreateDomainService(typeof(AccountsDomainService));
            editProfile   = (EditProfile)domainService.Update(domainModel, JunkCar.Core.Enumerations.DomainModelEnum.EDIT_PROFILE);
            return(Ok(editProfile.ResponseMessage));
        }
コード例 #28
0
        public UserProfile GetUserInfo()
        {
            UserProfile userProfile = null;
            string      data        = TicketHelper.GetDecryptedUserId();

            string[]      datalist = data.Split(',');
            FactoryFacade factory  = new FactoryFacade();

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(UserProfile));
            domainModel.Fill(HashHelper.GetUserInfo(datalist[0]));
            domainService = factory.DomainServiceFactory.CreateDomainService(typeof(AccountsDomainService));
            userProfile   = (UserProfile)domainService.Query(domainModel, DomainModelEnum.GET_USER_INFO);
            return(userProfile);
        }
コード例 #29
0
        public IHttpActionResult ChangePassword(string currentPassword, string newPassword)
        {
            ChangePassword changePassword = null;
            string         data           = TicketHelper.GetDecryptedUserId();

            string []     dataList = data.Split(',');
            FactoryFacade factory  = new FactoryFacade();

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(ChangePassword));
            domainModel.Fill(HashHelper.ChangePassword(currentPassword, newPassword, dataList[0]));
            domainService  = factory.DomainServiceFactory.CreateDomainService(typeof(AccountsDomainService));
            changePassword = (ChangePassword)domainService.Update(domainModel, CareHub.Factory.Enumerations.DomainModelEnum.CHANGE_PASSWORD);
            return(Ok(changePassword.ResponseMessage));
        }
コード例 #30
0
        public Authenticate Authenticate(string password, string userId)
        {
            FactoryFacade factory = new FactoryFacade();

            domainModel = factory.DomainModelFactory.CreateDomainModel(typeof(Authenticate));
            domainModel.Fill(HashHelper.Authenticate(userId, password));
            domainService = factory.DomainServiceFactory.CreateDomainService(typeof(AccountsDomainService));
            domainModel   = domainService.Query(domainModel, DomainModelEnum.AUTHENTICATE);
            DomainModel.Models.Authenticate authenticate = (DomainModel.Models.Authenticate)domainModel;
            if (authenticate.ResponseMessage != "User id is required" && authenticate.ResponseMessage != "Password is required" && authenticate.ResponseMessage != "Invalid domain model" && authenticate.ResponseMessage != "Please check login credentials and then try again.")
            {
                UserData userData = new UserData(userId, authenticate.Name);
                TicketHelper.CreateAuthCookie(authenticate.Name, userData.GetUserData(), false);
            }
            return(authenticate);
        }