예제 #1
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);
        }
예제 #2
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);
        }
예제 #3
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);
        }
예제 #4
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);
        }
예제 #5
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);
        }
예제 #6
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);
        }
예제 #7
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());
        }
        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));
        }
예제 #9
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());
        }
예제 #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());
        }
        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));
        }
        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);
        }
        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);
        }
        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);
        }
        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));
        }
        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);
        }
        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);
        }
        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);
        }
예제 #19
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);
        }
        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);
        }
        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));
        }
        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);
        }
        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));
        }
        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));
        }
        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);
        }
        public IHttpActionResult Authenticate(string userId, string password)
        {
            if (userId == null || password == null)
            {
                return(Ok("Please check login credentials and then try again."));
            }
            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, CareHub.Factory.Enumerations.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.ProviderId.ToString(), "");
                TicketHelper.CreateAuthCookie(userData.UserId, userData.GetProviderUserData(), false);
            }
            return(Ok(authenticate.ResponseMessage));
        }