public HttpResponseMessage GetVideoMemberData(string hsId, int employerId, string videoMemberId) { HttpResponseMessage hrm = Request.CreateResponse(HttpStatusCode.Unauthorized); if (ValidateConsumer.IsValidConsumer(hsId)) { hrm = Request.CreateErrorResponse( HttpStatusCode.NoContent, "Unexpected Error"); if (employerId > 0) { using (var gecs = new GetEmployerConnString(employerId)) { using (var gvcmd = new GetVideoCampaignMemberData()) { gvcmd.VideoCampaignFileId = videoMemberId; gvcmd.GetData(gecs.ConnString); if (!gvcmd.HasThrownError) { string videoMemberData = gvcmd.VideoMemberData; hrm = new HttpResponseMessage(HttpStatusCode.OK) { RequestMessage = Request, Content = new StringContent(videoMemberData) }; } } } } } return(hrm); }
public HttpResponseMessage GetVideoCampaign(string hsId, int employerId, int campaignId) { dynamic data = new ExpandoObject(); HttpResponseMessage hrm = Request.CreateResponse(HttpStatusCode.Unauthorized); if (ValidateConsumer.IsValidConsumer(hsId)) { hrm = Request.CreateErrorResponse( HttpStatusCode.NoContent, "Unexpected Error"); if (employerId > 0) { using (var gecs = new GetEmployerConnString(employerId)) { using (var gvc = new GetVideoCampaign()) { gvc.VideoCampaignId = campaignId; gvc.GetData(gecs.ConnString); if (!gvc.HasThrownError) { data.VideoCampaignId = campaignId; data.VideoDefinitionId = gvc.VideoDefinitionId.ToUpper(); data.IntroVideoDefinitionId = gvc.IntroVideoDefinitionId.ToUpper(); data.IsVideoCampaignActive = gvc.IsVideoCampaignActive; hrm = Request.CreateResponse(HttpStatusCode.OK, (object)data); } } } } } return(hrm); }
public HttpResponseMessage GetVideoFilesList(string hsId, int employerId, int campaignId) { dynamic data = new ExpandoObject(); HttpResponseMessage hrm = Request.CreateResponse(HttpStatusCode.Unauthorized); if (ValidateConsumer.IsValidConsumer(hsId)) { hrm = Request.CreateErrorResponse( HttpStatusCode.NoContent, "Unexpected Error"); if (employerId > 0) { using (var gecs = new GetEmployerConnString(employerId)) { using (var gvcfi = new GetVideoCampaignFileIds()) { gvcfi.CampaignId = campaignId; gvcfi.GetData(gecs.ConnString); if (!gvcfi.HasThrownError) { data.ListOfVideoIds = gvcfi.Results; hrm = Request.CreateResponse(HttpStatusCode.OK, (object)data); } } } } } return(hrm); }
public HttpResponseMessage UserDevice([FromBody] UserDeviceRequest deviceRequest) { HttpResponseMessage hrm = Request.CreateErrorResponse( HttpStatusCode.ExpectationFailed, "Unexpected Error"); using (GetEmployerConnString gecs = new GetEmployerConnString(deviceRequest.EmployerId)) { using (InsertUpdateDevice iud = new InsertUpdateDevice()) { iud.DeviceId = deviceRequest.DeviceId; int iClientAllowPushInd; if (int.TryParse(deviceRequest.ClientAllowPushInd, out iClientAllowPushInd)) { iud.ClientAllowPushInd = iClientAllowPushInd; } int iNativeAllowPushInd; if (int.TryParse(deviceRequest.NativeAllowPushInd, out iNativeAllowPushInd)) { iud.NativeAllowPushInd = iNativeAllowPushInd; } DateTime dPromptDate; if (DateTime.TryParse(deviceRequest.LastPushPromptDate, out dPromptDate)) { iud.LastPushPromptDate = dPromptDate; } iud.PostData(gecs.ConnString); if (iud.PostReturn == 1) { hrm = Request.CreateResponse(HttpStatusCode.OK); } } } return(hrm); }
public HttpResponseMessage LogExperienceEvent(string hsId, [FromBody] ExperienceLogRequest eventLogRequest) { HttpResponseMessage hrm = Request.CreateResponse(HttpStatusCode.Unauthorized); if (ValidateConsumer.IsValidConsumer(hsId)) { hrm = Request.CreateErrorResponse( HttpStatusCode.NoContent, "Unexpected Error"); if (eventLogRequest.EmployerId > 0) { AppendClientVersion(eventLogRequest); using (GetEmployerConnString gecs = new GetEmployerConnString(eventLogRequest.EmployerId)) { using (InsertExperienceLog iel = new InsertExperienceLog()) { iel.ExperienceEventId = eventLogRequest.EventId; iel.ExperienceEventDesc = eventLogRequest.EventName; if (Request.CCHID() > 0) { iel.CCHID = Request.CCHID(); } if (eventLogRequest.CchId > 0) { iel.CCHID = eventLogRequest.CchId; } if (!string.IsNullOrEmpty(eventLogRequest.ContentId)) { int contentId = eventLogRequest.ContentId.GetContentId(); if (contentId > 0) { iel.ContentId = contentId; } else { iel.ContentId = int.Parse(eventLogRequest.ContentId); } } iel.ExperienceUserId = eventLogRequest.ExperienceUserId; iel.Comment = eventLogRequest.LogComment; iel.DeviceId = eventLogRequest.DeviceId; iel.ClientVersion = eventLogRequest.ClientVersion; iel.PostData(gecs.ConnString); if (iel.PostReturn == 1) { hrm = Request.CreateResponse(HttpStatusCode.OK); } else { hrm = Request.CreateErrorResponse(HttpStatusCode.NoContent, "Insert Experience Event Procedure Failed."); } } } } } return(hrm); }
public HttpResponseMessage PasswordReset2(UserAuthenticationRequest request) { dynamic data = new ExpandoObject(); using (GetEmployerConnString gecs = new GetEmployerConnString(Request.EmployerID())) { using (GetUserContentPreference gucp = new GetUserContentPreference()) { gucp.CCHID = Request.CCHID(); gucp.GetData(gecs.ConnString); data.ContactPhoneNumber = gucp.ContactPhoneNumber; } } string userName = Request.UserName(); MembershipUser mu = Membership.GetUser(userName); if (mu == null) { data.Fail = true; data.ErrorMessage = "Unexpected Error locating User Membership"; } else { if (string.IsNullOrEmpty(request.SecretAnswer)) { data.Fail = true; data.ErrorMessage = "Missing Password Security Secret Answer"; } else { try { // Reset the password using the secret answer; the new password is a system-generated one string newPwd = mu.ResetPassword(request.SecretAnswer); // Use the system-generated password to change to the new user-provided password if (mu.ChangePassword(newPwd, request.NewPassword)) { mu.Comment = string.Empty; Membership.UpdateUser(mu); data.Success = true; } else { data.Fail = true; data.ErrorMessage = "Wrong Password Security Secret Answer"; } } catch (Exception exc) { data.Fail = true; data.ErrorMessage = exc.Message; } } } HttpResponseMessage hrm = Request.CreateResponse(HttpStatusCode.OK, (object)data); return(hrm); }
public HttpResponseMessage GetMediaUrl(string baseContentId) { HttpResponseMessage hrm = Request.CreateResponse(HttpStatusCode.NoContent); dynamic data = new ExpandoObject(); if (!string.IsNullOrEmpty(baseContentId)) { int campaignId = baseContentId.GetCampaignId(); int contentId = baseContentId.GetContentId(); if (campaignId > 0 && contentId > 0) { int employerId = Request.EmployerID(); int cchId = Request.CCHID(); string mediaBaseAddress = "MediaBaseAddress".GetConfigurationValue(); string mediaUrl = string.Format("{0}/?cid={1}|{2}|{3}|{4}", mediaBaseAddress, employerId, campaignId, contentId, cchId); using (GetEmployerConnString gecs = new GetEmployerConnString(employerId)) { using (GetUserContent guc = new GetUserContent()) { guc.CampaignId = campaignId; guc.BaseContentId = contentId; guc.PagesSize = 1; guc.CchId = cchId; guc.GetData(gecs.ConnString); if (guc.Results.Count == 1) { string contentType = guc.Results[0].ContentType; if (contentType.Equals("Vimeo")) { mediaUrl = guc.Results[0].ContentUrl; } } } } data.MediaUrl = mediaUrl; hrm = Request.CreateResponse(HttpStatusCode.OK, (object)data); } } return(hrm); }
public HttpResponseMessage GetMemberAuthorization(int employerId, int cchId, String hsId) { dynamic eo = new ExpandoObject(); HttpResponseMessage hrm = Request.CreateErrorResponse(HttpStatusCode.Unauthorized, new Exception("Client Handshake is Not Authorized")); var e = new CCHEncrypt(); if (ValidateConsumer.IsValidConsumer(hsId)) { hrm = Request.CreateErrorResponse(HttpStatusCode.Unauthorized, new Exception("Member with CCH ID was Not Found")); using (GetEmployerConnString gecs = new GetEmployerConnString(employerId)) { //UserAccess Check dstrickland 7/8/2015 using (var cpaa = new CheckPersonApplicationAccess(cchId, gecs.ConnString)) { if (!cpaa.HasAccess) { return(Request.CreateErrorResponse(HttpStatusCode.Unauthorized, new Exception(cpaa.ErrorMessage))); } } using (GetKeyEmployeeInfoByCchId gkeibc = new GetKeyEmployeeInfoByCchId()) { gkeibc.CchId = cchId; gkeibc.GetData(gecs.ConnString); if (gkeibc.Tables.Count > 0 && gkeibc.Tables[0].Rows.Count > 0) { e.UserKey = Request.EncryptionKey(); e.SecretKey = Properties.Settings.Default.SecretKey; e.Add("CCHID", cchId.ToString()); e.Add("EmployerID", employerId.ToString()); e.Add("UserID", hsId); ((IDictionary <string, object>)eo)["AuthHash"] = e.ToString(); hrm = Request.CreateResponse(HttpStatusCode.OK, (eo as ExpandoObject)); //InsertAuditTrail(cchId, hsId, // "Animation CCHID Login", Request.RequestUri.Host, gecs.ConnString); string userName = gkeibc.Tables[0].Rows[0].GetData("Email"); //LogUserLoginHistory(userName, cchId, gecs.ConnString); } } } } return(hrm); }
public HttpResponseMessage UserAlternatePhone([FromBody] AccountRequest accountRequest) { HttpResponseMessage hrm = Request.CreateErrorResponse( HttpStatusCode.NoContent, "Unexpected Error changing the Alternate Phone Number"); using (GetEmployerConnString gecs = new GetEmployerConnString(Request.EmployerID())) { using (UpdateUserPhone uup = new UpdateUserPhone()) { uup.CCHID = Request.CCHID(); uup.Phone = accountRequest.NewAlternatePhone; uup.PostData(gecs.ConnString); hrm = Request.CreateResponse(HttpStatusCode.OK); } } return(hrm); }
public HttpResponseMessage UserMobilePhone() { HttpResponseMessage hrm = Request.CreateResponse(HttpStatusCode.NoContent); dynamic data = new ExpandoObject(); using (GetEmployerConnString gecs = new GetEmployerConnString(Request.EmployerID())) { using (GetUserMobilePhone gump = new GetUserMobilePhone()) { gump.CchId = Request.CCHID(); gump.GetData(gecs.ConnString); data.MobilePhone = gump.MobilePhone; hrm = Request.CreateResponse(HttpStatusCode.OK, (object)data); } } return(hrm); }
public HttpResponseMessage GetEmployerNotificationsLocale(string hsId, string localeCode, int employerId, int pageSize, string baseContentId) { HttpResponseMessage hrm = Request.CreateResponse(HttpStatusCode.Unauthorized); if (ValidateConsumer.IsValidConsumer(hsId)) { hrm = Request.CreateResponse(HttpStatusCode.NoContent); dynamic data = new ExpandoObject(); using (GetEmployerConnString gecs = new GetEmployerConnString(employerId)) { if (!string.IsNullOrEmpty(gecs.ConnString)) { using (GetAnonymousContent gac = new GetAnonymousContent()) { gac.LocaleCode = localeCode; if (pageSize > 0) { gac.PagesSize = pageSize; } if (!string.IsNullOrEmpty(baseContentId)) { int campaignId = baseContentId.GetCampaignId(); int contentId = baseContentId.GetContentId(); if (campaignId == 0 && contentId > 0) { gac.BaseContentId = contentId; } } gac.GetData(gecs.ConnString); data.Results = gac.Results; data.TotalCount = gac.TotalCount; } if (data.TotalCount > 0) { hrm = Request.CreateResponse(HttpStatusCode.OK, (object)data); } } } } return(hrm); }
public HttpResponseMessage UserPhoneNumbers() { HttpResponseMessage hrm = Request.CreateResponse(HttpStatusCode.NoContent); dynamic data = new ExpandoObject(); using (GetEmployerConnString gecs = new GetEmployerConnString(Request.EmployerID())) { using (GetEmployeeByCchIdForCallCenter gebcfcc = new GetEmployeeByCchIdForCallCenter()) { gebcfcc.CchId = Request.CCHID(); gebcfcc.GetData(gecs.ConnString); data.MobilePhone = gebcfcc.MobilePhone; data.AlternatePhone = gebcfcc.AlternatePhone; hrm = Request.CreateResponse(HttpStatusCode.OK, (object)data); } } return(hrm); }
public HttpResponseMessage PasswordReset1(UserAuthenticationRequest request) { var e = new CCHEncrypt(); dynamic data = new ExpandoObject(); using (GetEmployerConnString gecs = new GetEmployerConnString(Request.EmployerID())) { using (GetUserContentPreference gucp = new GetUserContentPreference()) { gucp.CCHID = Request.CCHID(); gucp.GetData(gecs.ConnString); data.ContactPhoneNumber = gucp.ContactPhoneNumber; } using (GetEmployeeByCchIdForCallCenter gebcfcc = new GetEmployeeByCchIdForCallCenter()) { gebcfcc.CchId = Request.CCHID(); gebcfcc.GetData(gecs.ConnString); if (request.UserName == gebcfcc.Email && request.LastFourSsn == gebcfcc.MemberSsn) { data.Success = true; e.UserKey = Request.EncryptionKey(); e.SecretKey = Properties.Settings.Default.SecretKey; e.Add("EmployerID", Request.EmployerID().ToString()); e.Add("UserID", Request.UserID()); e.Add("UserName", request.UserName); e.Add("CCHID", Request.CCHID().ToString()); string authHash = e.ToString(); //data.AuthHash = authHash; } else { data.Fail = true; data.ErrorMessage = "Email or SSN does Not Match"; } } } HttpResponseMessage hrm = Request.CreateResponse(HttpStatusCode.OK, (object)data); return(hrm); }
public HttpResponseMessage LogInitialExperience(string hsId, [FromBody] ExperienceLogRequest eventLogRequest) { HttpResponseMessage hrm = Request.CreateResponse(HttpStatusCode.Unauthorized); if (ValidateConsumer.IsValidConsumer(hsId)) { hrm = Request.CreateErrorResponse( HttpStatusCode.NoContent, "Unexpected Error"); if (eventLogRequest.EmployerId > 0) { AppendClientVersion(eventLogRequest); using (GetEmployerConnString gecs = new GetEmployerConnString(eventLogRequest.EmployerId)) { try { using (InsertExperienceLog iel = new InsertExperienceLog()) { ExperienceLogResponse elr = new ExperienceLogResponse { ExperienceUserId = Guid.NewGuid().ToString() }; iel.ExperienceEventId = eventLogRequest.EventId; iel.ExperienceEventDesc = eventLogRequest.EventName; iel.ExperienceUserId = elr.ExperienceUserId; iel.Comment = eventLogRequest.LogComment; iel.DeviceId = eventLogRequest.DeviceId; iel.ClientVersion = eventLogRequest.ClientVersion; iel.PostData(gecs.ConnString); hrm = Request.CreateResponse(HttpStatusCode.OK, elr); } } catch (Exception exc) { hrm = Request.CreateErrorResponse(HttpStatusCode.NoContent, String.Format("Insert Experience Event Procedure Failed: {0}", exc.Message)); } } } } return(hrm); }
public HttpResponseMessage GetUserRewardsLocale(string localeCode, int pageSize, string baseContentId) { HttpResponseMessage hrm = Request.CreateResponse(HttpStatusCode.NoContent); dynamic data = new ExpandoObject(); using (GetEmployerConnString gecs = new GetEmployerConnString(Request.EmployerID())) { using (GetUserRewards gur = new GetUserRewards()) { gur.LocaleCode = localeCode; if (pageSize > 0) { gur.PagesSize = pageSize; } if (!string.IsNullOrEmpty(baseContentId)) { int campaignId = baseContentId.GetCampaignId(); int contentId = baseContentId.GetContentId(); if (contentId > 0) { gur.CampaignId = campaignId; gur.BaseContentId = contentId; } } gur.CchId = Request.CCHID(); gur.GetData(gecs.ConnString); data.TotalPoints = gur.Summary.TotalPoints; data.TotalRewards = gur.Summary.TotalRewards; data.Results = gur.Results; data.TotalCount = gur.TotalCount; } } if (data.TotalCount > 0) { hrm = Request.CreateResponse(HttpStatusCode.OK, (object)data); } return(hrm); }
public HttpResponseMessage GetCampaignMemberInfo(string hsId, int employerId, string campaignMemberId) { dynamic data = new ExpandoObject(); HttpResponseMessage hrm = Request.CreateResponse(HttpStatusCode.Unauthorized); if (ValidateConsumer.IsValidConsumer(hsId)) { hrm = Request.CreateErrorResponse( HttpStatusCode.NoContent, "Unexpected Error"); if (employerId > 0) { using (var gecs = new GetEmployerConnString(employerId)) { using (var gvcmi = new GetVideoCampaignMemberInfo()) { gvcmi.VideoCampaignMemberId = campaignMemberId; gvcmi.GetData(gecs.ConnString); if (!gvcmi.HasThrownError) { data.DateOfBirth = gvcmi.DateOfBirth; data.IntroVideoDefinitionId = gvcmi.IntroVideoDefinitionId.ToUpper(); data.IntroVideoDefinitionName = gvcmi.IntroVideoDefinitionName; data.IsVideoCampaignActive = gvcmi.IsVideoCampaignActive; data.LastName = gvcmi.LastName; data.MemberSsn = gvcmi.MemberSsn; data.VideoCampaignFileId = gvcmi.VideoCampaignFileId.ToUpper(); data.VideoCampaignId = gvcmi.VideoCampaignId; data.VideoDefinitionName = gvcmi.VideoDefinitionName; data.CchEmployerLink = gvcmi.CchEmployerLink; data.EmployerBenefitsLink = gvcmi.EmployerBenefitsLink; hrm = Request.CreateResponse(HttpStatusCode.OK, (object)data); } } } } } return(hrm); }
public HttpResponseMessage GetCampaignIntro(int employerId, int campaignId, string handshakeId) { HttpResponseMessage hrm = Request.CreateResponse(HttpStatusCode.NoContent); dynamic data = new ExpandoObject(); using (GetEmployerConnString gecs = new GetEmployerConnString(employerId)) { using (GetCampaignIntro gci = new GetCampaignIntro()) { gci.CampaignId = campaignId; gci.GetData(gecs.ConnString); data.ContentName = gci.ContentName; data.ContentType = gci.ContentType; data.ContentId = gci.ContentId; hrm = Request.CreateResponse(HttpStatusCode.OK, (object)data); } } return(hrm); }
public HttpResponseMessage UpdateUserEmail([FromBody] AccountRequest accountRequest) { HttpResponseMessage hrm = Request.CreateErrorResponse( HttpStatusCode.NoContent, "Unexpected Error changing the Email Address"); using (GetEmployerConnString gecs = new GetEmployerConnString(Request.EmployerID())) { using (UpdateUserEmail uue = new UpdateUserEmail()) { uue.Email = accountRequest.NewEmail; uue.UserID = Request.UserID(); uue.PostFrontEndData(); switch (uue.ReturnStatus) { case 0: uue.UpdateClientSide(accountRequest.NewEmail, Request.CCHID(), gecs.ConnString); hrm = Request.CreateResponse(HttpStatusCode.OK); break; } } } return(hrm); }
public HttpResponseMessage PushPromptStatus(int employerId, string hsId, string deviceId) { dynamic data = new ExpandoObject(); HttpResponseMessage hrm = Request.CreateErrorResponse(HttpStatusCode.Unauthorized, new Exception("Client Handshake is Not Authorized")); if (ValidateConsumer.IsValidConsumer(hsId)) { using (GetEmployerConnString gecs = new GetEmployerConnString(employerId)) { using (GetDevicePushPromptStatus gdpps = new GetDevicePushPromptStatus()) { gdpps.DeviceId = deviceId; gdpps.GetData(gecs.ConnString); data.PromptStatus = gdpps.PromptStatus ? "1" : "0"; } hrm = Request.CreateResponse(HttpStatusCode.OK, (object)data); } } return(hrm); }
public HttpResponseMessage UserPreferences() { HttpResponseMessage hrm = Request.CreateResponse(HttpStatusCode.NoContent); dynamic data = new ExpandoObject(); using (GetEmployerConnString gecs = new GetEmployerConnString(Request.EmployerID())) { using (GetUserContentPreference gucp = new GetUserContentPreference()) { gucp.CCHID = Request.CCHID(); gucp.GetData(gecs.ConnString); data.SmsInd = gucp.SmsInd; data.EmailInd = gucp.EmailInd; data.OsBasedAlertInd = gucp.OsBasedAlertInd; data.LocaleCode = gucp.LocaleCode; hrm = Request.CreateResponse(HttpStatusCode.OK, (object)data); } } return(hrm); }
public HttpResponseMessage GetEmployeeSegment() { HttpResponseMessage hrm = Request.CreateResponse(HttpStatusCode.NoContent); dynamic data = new ExpandoObject(); using (GetEmployerConnString gecs = new GetEmployerConnString(Request.EmployerID())) { using (GetEmployeeSegment ges = new GetEmployeeSegment()) { ges.CchId = Request.CCHID(); ges.EmployerId = Request.EmployerID(); ges.GetData(gecs.ConnString); data.CchId = Request.CCHID(); data.EmployerId = Request.EmployerID(); data.Segment = ges.PropertyCode; data.HealthPlan = ges.Insurer; data.BirthYear = ges.BirthYear; hrm = Request.CreateResponse(HttpStatusCode.OK, (object)data); } } return(hrm); }
public HttpResponseMessage UpdateUserContentStatus([FromBody] UserContentStatusRequest statusRequest) { HttpResponseMessage hrm = Request.CreateErrorResponse(HttpStatusCode.NoContent, "Unexpected Error"); using (GetEmployerConnString gecs = new GetEmployerConnString(Request.EmployerID())) { using (UpdateUserContentStatus uucs = new UpdateUserContentStatus()) { uucs.CampaignId = statusRequest.ContentId.GetCampaignId(); uucs.CchId = Request.CCHID(); uucs.ContentId = statusRequest.ContentId.GetContentId(); uucs.StatusId = statusRequest.StatusId; uucs.StatusDesc = statusRequest.StatusDesc; uucs.PostData(gecs.ConnString); if (uucs.PostReturn == 1) { hrm = Request.CreateResponse(HttpStatusCode.OK); } } } return(hrm); }
public HttpResponseMessage GetSurveyQuestionsAndAnswers(string surveyId) { HttpResponseMessage hrm = Request.CreateResponse(HttpStatusCode.NoContent); dynamic data = new ExpandoObject(); using (GetEmployerConnString gecs = new GetEmployerConnString(Request.EmployerID())) { using (GetSurveyQuestionsAndAnswers gsqaa = new GetSurveyQuestionsAndAnswers()) { gsqaa.CampaignId = surveyId.GetCampaignId(); gsqaa.SurveyId = surveyId.GetContentId(); gsqaa.GetData(gecs.ConnString); data.Results = gsqaa.Results; data.TotalCount = gsqaa.TotalCount; } } if (data.TotalCount > 0) { hrm = Request.CreateResponse(HttpStatusCode.OK, (object)data); } return(hrm); }
public HttpResponseMessage InsertUserSurveyAnswer([FromBody] UserSurveyAnswerRequest surveyRequest) { HttpResponseMessage hrm = Request.CreateErrorResponse(HttpStatusCode.NoContent, "Unexpected Error"); using (GetEmployerConnString gecs = new GetEmployerConnString(Request.EmployerID())) { using (InsertUserSurveyAnswer iusa = new InsertUserSurveyAnswer()) { iusa.CampaignId = surveyRequest.SurveyId.GetCampaignId(); iusa.CchId = Request.CCHID(); iusa.SurveyId = surveyRequest.SurveyId.GetContentId(); iusa.AnswerId = surveyRequest.AnswerId; iusa.FreeFormAnswer = surveyRequest.FreeFormAnswer; iusa.QuestionId = surveyRequest.QuestionId; iusa.PostData(gecs.ConnString); if (iusa.PostReturn == 1) { hrm = Request.CreateResponse(HttpStatusCode.OK); } } } return(hrm); }
public HttpResponseMessage LogAnEvent(string hsId, [FromBody] VideoEventLog eventLog) { HttpResponseMessage hrm = Request.CreateResponse(HttpStatusCode.Unauthorized); if (ValidateConsumer.IsValidConsumer(hsId)) { hrm = Request.CreateErrorResponse( HttpStatusCode.NoContent, "Unexpected Error"); if (eventLog.EmployerId > 0) { using (GetEmployerConnString gecs = new GetEmployerConnString(eventLog.EmployerId)) { using (LogVideoEvent lve = new LogVideoEvent()) { lve.VideoCampaignMemberId = eventLog.VideoCampaignMemberId; lve.VideoLogEvent = eventLog.VideoLogEvent; lve.VideoLogEventId = eventLog.VideoLogEventId; lve.Comment = eventLog.Comment; lve.PostData(gecs.ConnString); if (lve.PostReturn == 1) { hrm = Request.CreateResponse(HttpStatusCode.OK); } else { hrm = Request.CreateErrorResponse(HttpStatusCode.NoContent, "Log Video Event Procedure Failed."); } } } } } return(hrm); }
public HttpResponseMessage UserPreferences([FromBody] UserContentPreferenceRequest preferenceRequest) { HttpResponseMessage hrm = Request.CreateErrorResponse( HttpStatusCode.NoContent, "Unexpected Error"); using (GetEmployerConnString gecs = new GetEmployerConnString(Request.EmployerID())) { using (InsertUpdateUserContentPreference iuucp = new InsertUpdateUserContentPreference()) { iuucp.CCHID = Request.CCHID(); iuucp.EmailInd = preferenceRequest.EmailInd; iuucp.OsBasedAlertInd = preferenceRequest.OsBasedAlertInd; iuucp.SmsInd = preferenceRequest.SmsInd; iuucp.LocaleCode = preferenceRequest.LocaleCode; iuucp.PostData(gecs.ConnString); if (iuucp.PostReturn == 1) { hrm = Request.CreateResponse(HttpStatusCode.OK); } } } return(hrm); }
public HttpResponseMessage GetHash(String hsID) { HandshakeMobile h = new HandshakeMobile(); Boolean providerActive = false; CCHEncrypt e = new CCHEncrypt(); using (ValidateMobileProvider vmp = new ValidateMobileProvider(hsID)) vmp.ForEachProvider(delegate(Boolean valid) { if (valid) { providerActive = true; } }); if (providerActive) { e.UserKey = Request.EncryptionKey(); e.SecretKey = Properties.Settings.Default.SecretKey; e.Add("UserID", Request.UserID()); using (GetKeyUserInfo gkui = new GetKeyUserInfo(Request.UserName())) { e.Add("EmployerID", gkui.EmployerID); h.EmployerName = gkui.EmployerName; using (GetKeyEmployeeInfo gkei = new GetKeyEmployeeInfo()) { //UserAccess Check dstrickland 7/8/2015 using (var cpaa = new CheckPersonApplicationAccess(gkei.CCHID, gkui.CnxString)) { if (!cpaa.HasAccess) { return(Request.CreateErrorResponse(HttpStatusCode.Unauthorized, new Exception(cpaa.ErrorMessage))); } } gkei.Email = Request.UserName(); gkei.GetData(gkui.CnxString); e.Add("CCHID", gkei.CCHID.ToString()); gkei.ForEach <HandshakeMobile.EmployeeInfoData>( delegate(HandshakeMobile.EmployeeInfoData eid) { h.EmployeeInfo = eid; } ); } } using (GetEmployerConnString gecs = new GetEmployerConnString(Convert.ToInt32(e["EmployerID"]))) { using (InsertUserLoginHistory iulh = new InsertUserLoginHistory()) { iulh.UserName = Request.UserName(); iulh.Domain = Request.RequestUri.Host; iulh.CchApplicationId = 2; // 1 is for Transparency App; 2 is for HR App iulh.PostData(gecs.ConnString); } } h.AuthHash = e.ToString(); return(this.Request.CreateResponse <HandshakeMobile>(HttpStatusCode.OK, h)); } else { return(this.Request.CreateResponse(HttpStatusCode.NoContent)); } }
protected void Continue(object sender, EventArgs e) { //Get the connection string for the specific database if it isn't already in the view state if (ConnString == String.Empty) { using (GetEmployerConnString gecs = new GetEmployerConnString("AnalogDevices")) //2 = Analog Devices if (!gecs.HasErrors) { ConnString = gecs.ConnectionString; EmployerID = gecs.EmployerID.ToString(); } } if (ConnString != String.Empty) { ThisSession.CnxString = ConnString; } if (EmployerID != String.Empty) { ThisSession.EmployerID = EmployerID; } //Check if the employee exists and if they do, store session info and move on using (GetEmployeeEnrollment gee = new GetEmployeeEnrollment()) { //gee.Firstname = txtFirstName.Text; gee.LastName = Encoder.HtmlEncode(txtLastName.Text); gee.MemberID = Encoder.HtmlEncode(txtMemID.Text); gee.DOB = Encoder.HtmlEncode(txtDOB.Text); gee.GetData(ConnString); if (!gee.HasErrors) { if (gee.EmployeeTable.TableName != "Empty" && gee.EmployeeTable.Rows.Count > 0) { lblNotFound.Visible = false; lblError.Visible = false; ThisSession.CCHID = gee.CCHID; ThisSession.EmployeeID = gee.EmployeeID; ThisSession.SubscriberMedicalID = gee.SubscriberMedicalID; ThisSession.SubscriberRXID = gee.SubscriberRXID; ThisSession.LastName = gee.LastName; //ThisSession.FirstName = gee.Firstname; ThisSession.PatientAddress1 = gee.Address1; ThisSession.PatientAddress2 = gee.Address2; ThisSession.PatientCity = gee.City; ThisSession.PatientState = gee.State; ThisSession.PatientZipCode = gee.ZipCode; ThisSession.PatientLatitude = gee.Latitude; ThisSession.PatientLongitude = gee.Longitude; ThisSession.PatientDateOfBirth = gee.DOB; ThisSession.PatientPhone = gee.Phone; ThisSession.HealthPlanType = gee.HealthPlanType; ThisSession.MedicalPlanType = gee.MedicalPlanType; ThisSession.RxPlanType = gee.RxPlanType; ThisSession.PatientGender = gee.Gender; ThisSession.Parent = gee.Parent; ThisSession.Adult = gee.Adult; ThisSession.PatientEmail = gee.Email; if (gee.Insurer != String.Empty) { ThisSession.Insurer = gee.Insurer; } if (gee.RXProvider != String.Empty) { ThisSession.RXProvider = gee.RXProvider; } if (gee.DependentTable.TableName != "EmptyTable") { Dependents deps = new Dependents(); Dependent dep = null; gee.ForEachDependent(delegate(DataRow dr) { dep = new Dependent(); dep.CCHID = int.Parse(dr["CCHID"].ToString()); dep.FirstName = dr["FirstName"].ToString(); dep.LastName = dr["LastName"].ToString(); dep.DateOfBirth = DateTime.Parse(dr["DateOfBirth"].ToString()); dep.Age = int.Parse(dr["Age"].ToString()); dep.IsAdult = int.Parse(dr["Adult"].ToString()) == 1 ? true : false; dep.ShowAccessQuestions = int.Parse(dr["ShowAccessQuestions"].ToString()) == 1 ? true : false; dep.RelationshipText = dr["RelationshipText"].ToString(); dep.DepToUserGranted = int.Parse(dr["DepToUserGranted"].ToString()) == 1 ? true : false; dep.UserToDepGranted = int.Parse(dr["UserToDepGranted"].ToString()) == 1 ? true : false; dep.Email = dr["Email"].ToString(); deps.Add(dep); }); ThisSession.Dependents = deps; } if (gee.YouCouldHaveSavedTable.TableName != "EmptyTable") { ThisSession.YouCouldHaveSaved = (int)gee.YouCouldHaveSaved; } Response.Redirect("Review.aspx"); } else { lblNotFound.Visible = true; } } else { lblError.Visible = true; } } }
protected void Continue(object sender, EventArgs e) { if (!Page.IsValid) { return; } //Get the connection string for the specific database if it isn't already in the view state if (ConnString == String.Empty) { using (GetEmployerConnString gecs = new GetEmployerConnString("Starbucks")) if (!gecs.HasErrors) { ConnString = gecs.ConnectionString; EmployerID = gecs.EmployerID.ToString(); } } if (ConnString != String.Empty) { ThisSession.CnxString = ConnString; } if (EmployerID != String.Empty) { ThisSession.EmployerID = EmployerID; } //Check if the employee exists and if they do, store session info and move on using (GetEmployeeEnrollment gee = new GetEmployeeEnrollment()) { //gee.Firstname = txtFirstName.Text; gee.LastName = Encoder.HtmlEncode(txtLastName.Text); gee.SSN = "zzzz"; if (txtPremera1.Text != "XXXXXXX" && txtPremera2.Text != "XX") //From this point validation has already passed so this indicates they are using the member id { gee.MemberID = Encoder.HtmlEncode(txtPremera1.Text) + Encoder.HtmlEncode(txtPremera2.Text); } else { gee.SSN = Encoder.HtmlEncode(txtSSN.Text); } gee.DOB = String.Format("{2}-{1}-{0}", txtMonth.Text, txtDay.Text, txtYear.Text); gee.GetData(ConnString); if (!gee.HasErrors) { if (gee.EmployeeTable.TableName != "Empty" && gee.EmployeeTable.Rows.Count > 0) { lblNotFound.Visible = false; lblError.Visible = false; ThisSession.CCHID = gee.CCHID; ThisSession.EmployeeID = gee.EmployeeID; ThisSession.SubscriberMedicalID = gee.SubscriberMedicalID; ThisSession.SubscriberRXID = gee.SubscriberRXID; ThisSession.LastName = gee.LastName; ThisSession.FirstName = gee.FirstName; ThisSession.PatientAddress1 = gee.Address1; ThisSession.PatientAddress2 = gee.Address2; ThisSession.PatientCity = gee.City; ThisSession.PatientState = gee.State; ThisSession.PatientZipCode = gee.ZipCode; ThisSession.PatientLatitude = gee.Latitude; ThisSession.PatientLongitude = gee.Longitude; ThisSession.PatientDateOfBirth = gee.DOB; ThisSession.PatientPhone = gee.Phone; ThisSession.HealthPlanType = gee.HealthPlanType; ThisSession.MedicalPlanType = gee.MedicalPlanType; ThisSession.RxPlanType = gee.RxPlanType; ThisSession.PatientGender = gee.Gender; ThisSession.Parent = gee.Parent; ThisSession.Adult = gee.Adult; ThisSession.PatientEmail = gee.Email; if (gee.Insurer != String.Empty) { ThisSession.Insurer = gee.Insurer; } if (gee.RXProvider != String.Empty) { ThisSession.RXProvider = gee.RXProvider; } if (gee.DependentTable.TableName != "EmptyTable") { Dependents deps = new Dependents(); Dependent dep = null; gee.ForEachDependent(delegate(DataRow dr) { dep = new Dependent(); dep.CCHID = int.Parse(dr["CCHID"].ToString()); dep.FirstName = dr["FirstName"].ToString(); dep.LastName = dr["LastName"].ToString(); dep.DateOfBirth = DateTime.Parse(dr["DateOfBirth"].ToString()); dep.Age = int.Parse(dr["Age"].ToString()); dep.IsAdult = int.Parse(dr["Adult"].ToString()) == 1 ? true : false; dep.ShowAccessQuestions = int.Parse(dr["ShowAccessQuestions"].ToString()) == 1 ? true : false; dep.RelationshipText = dr["RelationshipText"].ToString(); dep.DepToUserGranted = int.Parse(dr["DepToUserGranted"].ToString()) == 1 ? true : false; dep.UserToDepGranted = int.Parse(dr["UserToDepGranted"].ToString()) == 1 ? true : false; dep.Email = dr["Email"].ToString(); deps.Add(dep); }); ThisSession.Dependents = deps; } if (gee.YouCouldHaveSavedTable.TableName != "EmptyTable") { ThisSession.YouCouldHaveSaved = (int)gee.YouCouldHaveSaved; } Response.Redirect("Review.aspx"); } else { pnlReg.Visible = false; pnlCapture.Visible = true; } //Membership not found } else { lblError.Visible = true; } //General error validating } }
protected void Continue(object sender, EventArgs e) { if (!Page.IsValid) return; //Get the connection string for the specific database if it isn't already in the view state if (ConnString == String.Empty) using (GetEmployerConnString gecs = new GetEmployerConnString("Starbucks")) if (!gecs.HasErrors) { ConnString = gecs.ConnectionString; EmployerID = gecs.EmployerID.ToString(); } if (ConnString != String.Empty) ThisSession.CnxString = ConnString; if (EmployerID != String.Empty) ThisSession.EmployerID = EmployerID; //Check if the employee exists and if they do, store session info and move on using (GetEmployeeEnrollment gee = new GetEmployeeEnrollment()) { //gee.Firstname = txtFirstName.Text; gee.LastName = Encoder.HtmlEncode(txtLastName.Text); gee.SSN = "zzzz"; if (txtPremera1.Text != "XXXXXXX" && txtPremera2.Text != "XX") //From this point validation has already passed so this indicates they are using the member id gee.MemberID = Encoder.HtmlEncode(txtPremera1.Text) + Encoder.HtmlEncode(txtPremera2.Text); else gee.SSN = Encoder.HtmlEncode(txtSSN.Text); gee.DOB = String.Format("{2}-{0}-{1}", txtMonth.Text, txtDay.Text, txtYear.Text); gee.GetData(ConnString); if (!gee.HasErrors) { if (gee.EmployeeTable.TableName != "Empty" && gee.EmployeeTable.Rows.Count > 0) { lblNotFound.Visible = false; lblError.Visible = false; ThisSession.CCHID = gee.CCHID; ThisSession.EmployeeID = gee.EmployeeID; ThisSession.SubscriberMedicalID = gee.SubscriberMedicalID; ThisSession.SubscriberRXID = gee.SubscriberRXID; ThisSession.LastName = gee.LastName; ThisSession.FirstName = gee.FirstName; ThisSession.PatientAddress1 = gee.Address1; ThisSession.PatientAddress2 = gee.Address2; ThisSession.PatientCity = gee.City; ThisSession.PatientState = gee.State; ThisSession.PatientZipCode = gee.ZipCode; ThisSession.PatientLatitude = gee.Latitude; ThisSession.PatientLongitude = gee.Longitude; ThisSession.PatientDateOfBirth = gee.DOB; ThisSession.PatientPhone = gee.Phone; ThisSession.HealthPlanType = gee.HealthPlanType; ThisSession.MedicalPlanType = gee.MedicalPlanType; ThisSession.RxPlanType = gee.RxPlanType; ThisSession.PatientGender = gee.Gender; ThisSession.Parent = gee.Parent; ThisSession.Adult = gee.Adult; ThisSession.PatientEmail = gee.Email; if (gee.Insurer != String.Empty) ThisSession.Insurer = gee.Insurer; if (gee.RXProvider != String.Empty) ThisSession.RXProvider = gee.RXProvider; if (gee.DependentTable.TableName != "EmptyTable") { Dependents deps = new Dependents(); Dependent dep = null; gee.ForEachDependent(delegate(DataRow dr) { dep = new Dependent(); dep.CCHID = int.Parse(dr["CCHID"].ToString()); dep.FirstName = dr["FirstName"].ToString(); dep.LastName = dr["LastName"].ToString(); dep.DateOfBirth = DateTime.Parse(dr["DateOfBirth"].ToString()); dep.Age = int.Parse(dr["Age"].ToString()); dep.IsAdult = int.Parse(dr["Adult"].ToString()) == 1 ? true : false; dep.ShowAccessQuestions = int.Parse(dr["ShowAccessQuestions"].ToString()) == 1 ? true : false; dep.RelationshipText = dr["RelationshipText"].ToString(); dep.DepToUserGranted = int.Parse(dr["DepToUserGranted"].ToString()) == 1 ? true : false; dep.UserToDepGranted = int.Parse(dr["UserToDepGranted"].ToString()) == 1 ? true : false; dep.Email = dr["Email"].ToString(); deps.Add(dep); }); ThisSession.Dependents = deps; } if (gee.YouCouldHaveSavedTable.TableName != "EmptyTable") ThisSession.YouCouldHaveSaved = (int)gee.YouCouldHaveSaved; Response.Redirect("Review.aspx"); } else { pnlReg.Visible = false; pnlCapture.Visible = true; } //Membership not found } else { lblError.Visible = true; }//General error validating } }
protected void Continue(object sender, EventArgs e) { if (!Page.IsValid) { return; } ////Dictionary<Int32, Tuple<String, String>> connections = null; //Get the connection string for the specific database if it isn't already in the view state if (ConnString == String.Empty) { using (GetEmployerConnString gecs = new GetEmployerConnString(hfEmployerIDFromURL.Value)) if (!gecs.HasErrors) { ////if (gecs.EmployerRows.Length > 1) ////{ //// connections = new Dictionary<int, Tuple<string, string>>(); //// gecs.ForEach(delegate(object[] row) //// { //// connections.Add(Convert.ToInt32(row[0]), //// new Tuple<string, string>(row[1].ToString(), row[2].ToString())); //// }); ////} ConnString = gecs.ConnectionString; EmployerID = gecs.EmployerID.ToString(); } } if (ConnString != String.Empty) { ThisSession.CnxString = ConnString; } if (EmployerID != String.Empty) { ThisSession.EmployerID = EmployerID; } //Check if the employee exists and if they do, store session info and move on using (GetEmployeeEnrollment gee = new GetEmployeeEnrollment()) { //gee.Firstname = txtFirstName.Text; gee.LastName = Encoder.HtmlEncode(txtLastName.Text); if (!String.IsNullOrWhiteSpace(cmidfWelcome.MemberIDText.Replace("X", ""))) { gee.MemberID = cmidfWelcome.MemberIDText; } else { gee.SSN = Encoder.HtmlEncode(txtSSN.Text); } //if(txtPremera1.Text != "XXXXXXX" && txtPremera2.Text != "XX") //From this point validation has already passed so this indicates they are using the member id //gee.MemberID = txtPremera1.Text + txtPremera2.Text; //else //gee.SSN = txtSSN.Text; gee.DOB = String.Format("{0}-{2}-{1}", Encoder.HtmlEncode(txtYear.Text), Encoder.HtmlEncode(txtDay.Text), Encoder.HtmlEncode(txtMonth.Text));// txtMonth.Text, txtDay.Text, txtYear.Text)); gee.GetData(ConnString); if (gee.PutInSession()) { lblNotFound.Visible = lblError.Visible = false; //////JM 11/28/12 (TO BE REMOVED 9/16/13) //////For Sanmina change the employer id and cnxstring to the BCBS version if this employee is not an AETNA insured employee ////if (hfEmployerIDFromURL.Value.Trim().ToLower().Contains("sanmina")) ////{ //// if (ThisSession.MedicalPlanType.ToLower().Contains("bcbs")) //// { //// ThisSession.EmployerID = connections.Single(cnn => cnn.Value.Item2.ToLower().Contains("bcbs")).Key.ToString(); //// ThisSession.CnxString = connections[Convert.ToInt32(ThisSession.EmployerID)].Item1; //// } ////} if (Debugger.IsAttached && Request.QueryString["e"] != null) { Response.Redirect("Review.aspx?e=" + Encoder.HtmlEncode(Request.QueryString["e"])); } else { Response.Redirect("Review.aspx"); } } else { // Membership not found pnlReg.Visible = false; pnlCapture.Visible = true; } } }
protected void Continue(object sender, EventArgs e) { //Get the connection string for the specific database if it isn't already in the view state if (ConnString == String.Empty) using (GetEmployerConnString gecs = new GetEmployerConnString("AnalogDevices")) //2 = Analog Devices if (!gecs.HasErrors) { ConnString = gecs.ConnectionString; EmployerID = gecs.EmployerID.ToString(); } if (ConnString != String.Empty) ThisSession.CnxString = ConnString; if (EmployerID != String.Empty) ThisSession.EmployerID = EmployerID; //Check if the employee exists and if they do, store session info and move on using (GetEmployeeEnrollment gee = new GetEmployeeEnrollment()) { //gee.Firstname = txtFirstName.Text; gee.LastName = Encoder.HtmlEncode(txtLastName.Text); gee.MemberID = Encoder.HtmlEncode(txtMemID.Text); gee.DOB = Encoder.HtmlEncode(txtDOB.Text); gee.GetData(ConnString); if (!gee.HasErrors) { if (gee.EmployeeTable.TableName != "Empty" && gee.EmployeeTable.Rows.Count > 0) { lblNotFound.Visible = false; lblError.Visible = false; ThisSession.CCHID = gee.CCHID; ThisSession.EmployeeID = gee.EmployeeID; ThisSession.SubscriberMedicalID = gee.SubscriberMedicalID; ThisSession.SubscriberRXID = gee.SubscriberRXID; ThisSession.LastName = gee.LastName; //ThisSession.FirstName = gee.Firstname; ThisSession.PatientAddress1 = gee.Address1; ThisSession.PatientAddress2 = gee.Address2; ThisSession.PatientCity = gee.City; ThisSession.PatientState = gee.State; ThisSession.PatientZipCode = gee.ZipCode; ThisSession.PatientLatitude = gee.Latitude; ThisSession.PatientLongitude = gee.Longitude; ThisSession.PatientDateOfBirth = gee.DOB; ThisSession.PatientPhone = gee.Phone; ThisSession.HealthPlanType = gee.HealthPlanType; ThisSession.MedicalPlanType = gee.MedicalPlanType; ThisSession.RxPlanType = gee.RxPlanType; ThisSession.PatientGender = gee.Gender; ThisSession.Parent = gee.Parent; ThisSession.Adult = gee.Adult; ThisSession.PatientEmail = gee.Email; if (gee.Insurer != String.Empty) ThisSession.Insurer = gee.Insurer; if (gee.RXProvider != String.Empty) ThisSession.RXProvider = gee.RXProvider; if (gee.DependentTable.TableName != "EmptyTable") { Dependents deps = new Dependents(); Dependent dep = null; gee.ForEachDependent(delegate(DataRow dr) { dep = new Dependent(); dep.CCHID = int.Parse(dr["CCHID"].ToString()); dep.FirstName = dr["FirstName"].ToString(); dep.LastName = dr["LastName"].ToString(); dep.DateOfBirth = DateTime.Parse(dr["DateOfBirth"].ToString()); dep.Age = int.Parse(dr["Age"].ToString()); dep.IsAdult = int.Parse(dr["Adult"].ToString()) == 1 ? true : false; dep.ShowAccessQuestions = int.Parse(dr["ShowAccessQuestions"].ToString()) == 1 ? true : false; dep.RelationshipText = dr["RelationshipText"].ToString(); dep.DepToUserGranted = int.Parse(dr["DepToUserGranted"].ToString()) == 1 ? true : false; dep.UserToDepGranted = int.Parse(dr["UserToDepGranted"].ToString()) == 1 ? true : false; dep.Email = dr["Email"].ToString(); deps.Add(dep); }); ThisSession.Dependents = deps; } if (gee.YouCouldHaveSavedTable.TableName != "EmptyTable") ThisSession.YouCouldHaveSaved = (int)gee.YouCouldHaveSaved; Response.Redirect("Review.aspx"); } else { lblNotFound.Visible = true; } } else { lblError.Visible = true; } } }
protected void Continue(object sender, EventArgs e) { if (!Page.IsValid) return; ////Dictionary<Int32, Tuple<String, String>> connections = null; //Get the connection string for the specific database if it isn't already in the view state if (ConnString == String.Empty) using (GetEmployerConnString gecs = new GetEmployerConnString(hfEmployerIDFromURL.Value)) if (!gecs.HasErrors) { ////if (gecs.EmployerRows.Length > 1) ////{ //// connections = new Dictionary<int, Tuple<string, string>>(); //// gecs.ForEach(delegate(object[] row) //// { //// connections.Add(Convert.ToInt32(row[0]), //// new Tuple<string, string>(row[1].ToString(), row[2].ToString())); //// }); ////} ConnString = gecs.ConnectionString; EmployerID = gecs.EmployerID.ToString(); } if (ConnString != String.Empty) ThisSession.CnxString = ConnString; if (EmployerID != String.Empty) ThisSession.EmployerID = EmployerID; //Check if the employee exists and if they do, store session info and move on using (GetEmployeeEnrollment gee = new GetEmployeeEnrollment()) { //gee.Firstname = txtFirstName.Text; gee.LastName = Encoder.HtmlEncode(txtLastName.Text); if (!String.IsNullOrWhiteSpace(cmidfWelcome.MemberIDText.Replace("X",""))) gee.MemberID = cmidfWelcome.MemberIDText; else gee.SSN = Encoder.HtmlEncode(txtSSN.Text); //if(txtPremera1.Text != "XXXXXXX" && txtPremera2.Text != "XX") //From this point validation has already passed so this indicates they are using the member id //gee.MemberID = txtPremera1.Text + txtPremera2.Text; //else //gee.SSN = txtSSN.Text; gee.DOB = String.Format("{0}-{2}-{1}", Encoder.HtmlEncode(txtYear.Text), Encoder.HtmlEncode(txtDay.Text), Encoder.HtmlEncode(txtMonth.Text));// txtMonth.Text, txtDay.Text, txtYear.Text)); gee.GetData(ConnString); if (gee.PutInSession()) { lblNotFound.Visible = lblError.Visible = false; //////JM 11/28/12 (TO BE REMOVED 9/16/13) //////For Sanmina change the employer id and cnxstring to the BCBS version if this employee is not an AETNA insured employee ////if (hfEmployerIDFromURL.Value.Trim().ToLower().Contains("sanmina")) ////{ //// if (ThisSession.MedicalPlanType.ToLower().Contains("bcbs")) //// { //// ThisSession.EmployerID = connections.Single(cnn => cnn.Value.Item2.ToLower().Contains("bcbs")).Key.ToString(); //// ThisSession.CnxString = connections[Convert.ToInt32(ThisSession.EmployerID)].Item1; //// } ////} if (Debugger.IsAttached && Request.QueryString["e"] != null) Response.Redirect("Review.aspx?e=" + Encoder.HtmlEncode( Request.QueryString["e"]) ); else Response.Redirect("Review.aspx"); } else { // Membership not found pnlReg.Visible = false; pnlCapture.Visible = true; } } }
protected void ValidateInput(object sender, EventArgs e) { //Handle no email entered if (Email.Text.Trim() == String.Empty) { VerifyFailureText.Text = "Email is required."; Email.Focus(); ScriptManager.RegisterStartupScript(this, this.GetType(), "ResetCursor", "document.body.style.cursor = 'default';", true); return; } //Handle no SSN nor Member ID if (SSN.Text.Trim() == String.Empty && MemberID.Text.Trim() == String.Empty) { if (onlySSN) { VerifyFailureText.Text = "Please enter the last 4 digits of your SSN."; SSN.Focus(); } else { VerifyFailureText.Text = "Please enter either the last 4 digits of your SSN or you Member ID."; } ScriptManager.RegisterStartupScript(this, this.GetType(), "ResetCursor", "document.body.style.cursor = 'default';", true); return; } //Get the Employer Connection String to validate the user String cnxString = String.Empty; using (GetEmployerConnString gecs = new GetEmployerConnString(empID)) { if (!gecs.HasErrors && gecs.Tables[0].Rows.Count > 0) { cnxString = gecs.ConnectionString; } else { VerifyFailureText.Text = "There was an error validating your enrollment."; ScriptManager.RegisterStartupScript(this, this.GetType(), "ResetCursor", "document.body.style.cursor = 'default';", true); return; } } //Always try to use SSN if it has something in the text box Boolean ssnSuccess = false; if (SSN.Text.Trim() != String.Empty) { String cleanSSN = Regex.Replace(SSN.Text, "[^0-9]", ""); if (cleanSSN.Length == 4) { String query = String.Concat( "SELECT MemberSSN FROM Enrollments WHERE Email = '", Email.Text.Trim(), "'"); using (BaseCCHData b = new BaseCCHData(query, true)) { b.GetData(cnxString); if (!b.HasErrors && b.Tables[0].Rows.Count > 0) { Int32 idFromDB = Convert.ToInt32(b.Tables[0].Rows[0]["MemberSSN"].ToString()); if (idFromDB == Convert.ToInt32(cleanSSN)) { ssnSuccess = true; sSSN = cleanSSN; } } } } } //If nothing was entered into SSN or if SSN validation failed Boolean memberIdSuccess = false; if (!ssnSuccess) { if (MemberID.Text.Trim() != String.Empty) { String cleanMemberID = Regex.Replace(MemberID.Text, "[^0-9]", ""); if (cleanMemberID.Length == 11) { String query = String.Concat( "SELECT MemberMedicalID FROM Enrollments WHERE Email = '", Microsoft.Security.Application.Encoder.HtmlEncode(Email.Text.Trim()), "'"); using (BaseCCHData b = new BaseCCHData(query, true)) { b.GetData(cnxString); if (!b.HasErrors && b.Tables[0].Rows.Count > 0) { Int64 idFromDB = Convert.ToInt64(b.Tables[0].Rows[0]["MemberMedicalID"].ToString()); if (idFromDB == Convert.ToInt64(cleanMemberID)) { memberIdSuccess = true; } } } } } } if (ssnSuccess || memberIdSuccess) { sUserName = Membership.GetUserNameByEmail(Microsoft.Security.Application.Encoder.HtmlEncode(Email.Text.Trim())); if (String.IsNullOrWhiteSpace(sUserName)) { VerifyFailureText.Text = "User not found."; ScriptManager.RegisterStartupScript(this, this.GetType(), "ResetCursor", "document.body.style.cursor = 'default';", true); } else { lblQuestion.Text = Membership.GetUser(Microsoft.Security.Application.Encoder.HtmlEncode(Email.Text.Trim())).PasswordQuestion; tblVerify.Visible = pnlVerify.Visible = false; tblReset.Visible = pnlReset.Visible = true; ScriptManager.RegisterStartupScript(this, this.GetType(), "ResetCursor", "document.body.style.cursor = 'default';", true); } } else { VerifyFailureText.Text = "There was an error resetting your password with the information provided.<br />Please double check the information you entered and try again."; ScriptManager.RegisterStartupScript(this, this.GetType(), "ResetCursor", "document.body.style.cursor = 'default';", true); } }