protected void SearchManagedMed(object sender, String e) { if (!e.ToLower().Contains("undefined")) { String[] drugs = e.Split('|'); DataTable dt = new DataTable("MultiRX"); dt.Columns.Add(new DataColumn("DrugID", Type.GetType("System.Int32"))); dt.Columns.Add(new DataColumn("GPI", Type.GetType("System.String"))); dt.Columns.Add(new DataColumn("Quantity", Type.GetType("System.Double"))); dt.Columns.Add(new DataColumn("PastCareID", Type.GetType("System.Int32"))); dt.Columns.Add(new DataColumn("QuantityUOM", Type.GetType("System.String"))); dt.Columns.Add(new DataColumn("DrugName", Type.GetType("System.String"))); dt.Columns.Add(new DataColumn("DrugStrength", Type.GetType("System.String"))); for (int i = 0; i < (drugs.Length - 1); i++) { QueryStringEncryption qse = new QueryStringEncryption(drugs[i], new Guid(ThisSession.UserLogginID)); DataRow dr = dt.NewRow(); dr["GPI"] = qse["GPI"].ToString(); dr["PastCareID"] = qse["PastCareID"].ToString(); dr["DrugID"] = qse["DrugID"].ToString(); dr["Quantity"] = qse["Quantity"].ToString(); dr["QuantityUOM"] = qse["QuantityUOM"].ToString(); dr["DrugName"] = qse["DrugName"].ToString(); dr["DrugStrength"] = qse["Strength"].ToString(); dt.Rows.Add(dr); } ThisSession.ChosenDrugs = dt; Response.Redirect("results_rx.aspx"); } }
public DecryptQueryString(QueryStringEncryption queryStringEncryption, string abortIfNotEncrypted, string oldCryptographicKey, string oldAuthenticationKey) : this(queryStringEncryption, AssertString.ArgumentToBool(abortIfNotEncrypted, nameof(abortIfNotEncrypted), (string)null), oldCryptographicKey, oldAuthenticationKey) { }
public static void GenerateHandlerEvent(string hostName, Guid contactId, MessageItem messageItem, EventType eventType, DateTime dateTime, string userAgent, WhoIsInformation geoData, string link) { string eventHandlerPath; switch (eventType) { case EventType.Open: eventHandlerPath = GetEventHandlePath(EventType.Open); break; case EventType.Unsubscribe: eventHandlerPath = GetEventHandlePath(EventType.Unsubscribe); link = "/sitecore modules/Web/EXM/Unsubscribe.aspx"; break; case EventType.UnsubscribeFromAll: eventHandlerPath = GetEventHandlePath(EventType.UnsubscribeFromAll); link = "/sitecore modules/Web/EXM/UnsubscribeFromAll.aspx"; break; case EventType.Click: eventHandlerPath = GetEventHandlePath(EventType.Click); break; case EventType.Bounce: GenerateBounce(hostName, contactId, messageItem, dateTime); return; case EventType.SpamComplaint: GenerateSpam(hostName, contactId, messageItem, dateTime); return; default: throw new InvalidEnumArgumentException("No such event in ExmEvents"); } var queryStrings = GetQueryParameters(contactId, messageItem, link); var encryptedQueryString = QueryStringEncryption.GetDefaultInstance().Encrypt(queryStrings); var parameters = encryptedQueryString.ToQueryString(true); var url = $"{hostName}{eventHandlerPath}{parameters}"; var fakeData = new RequestHeaderInfo { UserAgent = userAgent, RequestTime = dateTime, GeoData = geoData }; var response = RequestUrl(url, fakeData); if (!response.IsSuccessful) { Errors++; } if (response.IsSuccessful && eventType == EventType.Click) { EndSession(hostName, response); } }
private void BindMed(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { RepeaterItem riMed = e.Item; DataRowView drv = (DataRowView)riMed.DataItem; //CheckBox cb = (CheckBox)riMed.FindControl("cbMemberMed"); RadioButton rb = (RadioButton)riMed.FindControl("rbMemberMed"); rb.Text = drv["DisplayText"].ToString(); //cb.Text = drv["DisplayText"].ToString(); QueryStringEncryption qse = new QueryStringEncryption(); qse.UserKey = new Guid(ThisSession.UserLogginID); qse["GPI"] = drv["GPI"].ToString().Trim(); qse["PastCareID"] = drv["PastCareID"].ToString().Trim(); qse["DrugID"] = drv["DrugID"].ToString().Trim(); qse["Quantity"] = drv["Quantity"].ToString().Trim(); qse["QuantityUOM"] = drv["QuantityUOM"].ToString().Trim(); qse["DrugName"] = drv["DrugName"].ToString().Trim(); qse["Strength"] = drv["Strength"].ToString().Trim(); rb.Attributes.Add("n", qse.ToString()); //cb.Attributes.Add("n", qse.ToString()); } }
public DecryptQueryString(QueryStringEncryption queryStringEncryption, bool abortIfNotEncrypted, string oldCryptographicKey, string oldAuthenticationKey) : base(queryStringEncryption, abortIfNotEncrypted) { Assert.ArgumentNotNull((object)queryStringEncryption, nameof(queryStringEncryption)); this._abortIfNotEncrypted = abortIfNotEncrypted; this._queryStringEncryption = queryStringEncryption; this._oldCryptographicKey = oldCryptographicKey; this._oldAuthenticationKey = oldAuthenticationKey; this._logger = ServiceLocator.ServiceProvider.GetService <ILogger>(); }
public static String GetNavInfo(this DataRow dr) { QueryStringEncryption qs = new QueryStringEncryption(); qs.UserKey = new Guid(ThisSession.UserLogginID); qs["PracticeName"] = dr.Field <dynamic>("PracticeName"); qs["PracticeNPI"] = dr.Field <dynamic>("NPI"); qs["OrganizationLocationID"] = dr.Field <dynamic>("OrganizationLocationID").ToString(); return(qs.ToString()); }
protected void Page_Load(object sender, EventArgs e) { Page.Header.Controls.Add(this.CssSheet); //#if DEBUG // Page.AddScriptToHeader("FindADocResults.js"); //#else // Page.AddScriptToHeader("FindADocResults.min.js"); //#endif //For Debugging Purposes only load the non-minified script //if (Request.Url.Host.ToLower() == "localhost") // ScriptManager.RegisterClientScriptInclude(this, this.GetType(), "FindADocResults", ResolveUrl("~/Scripts/FindADocResults.js") + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()); //else // ScriptManager.RegisterClientScriptInclude(this, this.GetType(), "FindADocResults", ResolveUrl("~/Scripts/FindADocResults.min.js") + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()); if (ThisSession.DefaultYourCostOn) { Page.Header.Controls.Add(new LiteralControl("<script type=\"text/javascript\">var YourCostDefault = true;</script>")); } //Set the default sort to start with if it's different than Distance if (ThisSession.DefaultSort != "Distance") { String csJava = "var globDefSort = '" + ThisSession.DefaultSort + "';"; csJava += "$(\"input.sortHeader[sortCol=Distance]\").attr(\"Checked\",false);"; csJava += "$(\"input.sortHeader[sortCol=" + ThisSession.DefaultSort + "]\").attr(\"Checked\",true);"; csJava += "$(\"td[sort=Distance]\").children(\"a\").removeClass(\"sortAsc\");"; csJava += "$(\"td[sort=" + ThisSession.DefaultSort + "]\").children(\"a\").first().addClass(\"sortAsc\");"; Page.ClientScript.RegisterStartupScript(this.GetType(), "ChangeDefaultSort", csJava, true); } ltlSpinLoader.Text = String.Format(Spinner, ResolveUrl("~/Images/ajax-loader-AltCircle.gif")); pnlServices.Style[HtmlTextWriterStyle.Position] = "relative"; if (Page.IsPostBack) { if (POSTDIST.Value.Replace("undefined", "") != "" && POSTNAV.Value.Replace("undefined", "") != "") { ThisSession.FacilityDistance = POSTDIST.Value; QueryStringEncryption qs = new QueryStringEncryption(POSTNAV.Value, new Guid(ThisSession.UserLogginID)); ThisSession.PracticeName = qs["PracticeName"]; ThisSession.ProviderName = qs["ProviderName"]; ThisSession.PracticeNPI = qs["PracticeNPI"]; ThisSession.FacilityDistance = qs["FacilityDistance"]; ThisSession.TaxID = qs["TaxID"]; ThisSession.OrganizationLocationID = Convert.ToInt32(qs["OrganizationLocationID"]); Response.Redirect("doctor_specialty_detail.asxp"); } } }
protected void GetUserInfo(object sender, EventArgs e) { EmployeeData selectedEmployee = this.Employees[ddlUsers.SelectedItem.Value]; btnUnlock.Enabled = (Boolean)selectedEmployee.Locked; object[] userRoles = this.EmployeesInRoles[ddlUsers.SelectedItem.Value].Select(R => R.RoleName).ToArray(); String[] roles = Roles.GetAllRoles(); StringWriter sw = new StringWriter(); using (HtmlTextWriter htmlOut = new HtmlTextWriter(sw)) { if (roles.Length > 0) { htmlOut.RenderBeginTag(HtmlTextWriterTag.Div); htmlOut.Write("This user currently belongs to the following Roles."); htmlOut.WriteBreak(); htmlOut.Write("After updating click \"Update Roles\"."); htmlOut.RenderEndTag(); } else { htmlOut.RenderBeginTag(HtmlTextWriterTag.Div); htmlOut.Write("User is not currently set to any roles."); htmlOut.WriteBreak(); htmlOut.Write("Please choose from the following to add them to and click save"); htmlOut.RenderEndTag(); } } cblRoles.Items.Clear(); foreach (String s in roles) { cblRoles.Items.Add(s); cblRoles.Items[cblRoles.Items.Count - 1].Selected = userRoles.Contains(s); } ltlUserRoles.Text = sw.ToString(); QueryStringEncryption qse = new QueryStringEncryption(); qse.UserKey = new Guid(ThisSession.UserLogginID); qse["EmployerID"] = selectedEmployee.EmployerID.ToString(); ThisSession.CnxString = selectedEmployee.ConnectionString.ToString(); qse["CCHID"] = selectedEmployee.CCHID.ToString(); ScriptManager.RegisterStartupScript( this, this.GetType(), "ChangeIframe", "document.getElementById('iCC').src ='" + ResolveUrl("~/CallCenter/Default.aspx?srch=" + qse.ToString()) + "';", true); }
private QueryStringEncryption GetQueryStringEncryptionInstance() { var authenticatedAesStringCipher = new AuthenticatedAesStringCipher( cryptographicKeyName: this._oldCryptographicKey, authenticationKeyName: this._oldAuthenticationKey, logger: ServiceLocator.ServiceProvider.GetService <ILogger>()); var instance = new QueryStringEncryption( Sitecore.Configuration.Settings.GetSetting("QueryStringKey.ExmEncryptedQuery", "ec_eq"), authenticatedAesStringCipher); foreach (var fieldName in fieldNames) { instance.RegisterFieldName(fieldName); } return(instance); }
private void SetupShortSearch() { pnlLongSearch.Visible = false; pnlShortSearch.Visible = true; try { QueryStringEncryption qse = new QueryStringEncryption( Encoder.HtmlEncode(Request.QueryString["srch"].ToString()), (Guid)Membership.GetUser().ProviderUserKey); passedCCHID = qse["CCHID"]; passedEmployerID = qse["EmployerID"]; lblEmployerFromSrch.Text = String.Format("{0}", passedEmployerID); lblEmployeeIDFromSrch.Text = String.Format("{0}", passedCCHID); DataRow dr = (from employer in Employers.Tables[0].AsEnumerable() where employer.Field <int>("EmployerID") == int.Parse(passedEmployerID) select employer).FirstOrDefault(); ThisSession.CnxString = dr[2].ToString(); ThisSession.EmployerID = dr[0].ToString(); ThisSession.EmployerName = dr[1].ToString(); ThisSession.Insurer = dr[3].ToString(); ThisSession.RXProvider = dr[4].ToString(); ThisSession.ShowYourCostColumn = Convert.ToBoolean(dr[5].ToString()); using (GetEmployerContent gec = new GetEmployerContent(int.Parse(passedEmployerID))) gec.PutInSession(); Employee = new GetEmployeeByCCHIDForCallCenter(Convert.ToInt32(passedCCHID)); Employee.GetData(); if (!Employee.HasErrors) { gvUsers.DataSource = Employee.Employee; gvUsers.DataBind(); } else { SetupLongSearch(); } } catch (Exception ex) { SetupLongSearch(); ltlMessage.Text = "<div>" + ex.Message + "</div>"; } }
public static void GenerateHandlerEvent(string hostName, Guid userId, MessageItem messageItem, ExmEvents exmEvent, DateTime dateTime, string userAgent = null, WhoIsInformation geoData = null, string link = null) { string eventHandler; switch (exmEvent) { case ExmEvents.Open: eventHandler = "RegisterEmailOpened.ashx"; break; case ExmEvents.Unsubscribe: eventHandler = "RedirectUrlPage.aspx"; link = "/sitecore/Unsubscribe.aspx"; break; case ExmEvents.UnsubscribeFromAll: eventHandler = "RedirectUrlPage.aspx"; link = "/sitecore/UnsubscribeFromAll.aspx"; break; case ExmEvents.Click: eventHandler = "RedirectUrlPage.aspx"; break; default: throw new InvalidEnumArgumentException("No such event in ExmEvents"); } var queryStrings = GetQueryParameters(userId, messageItem, link); var encryptedQueryString = QueryStringEncryption.GetDefaultInstance().Encrypt(queryStrings); var parameters = encryptedQueryString.ToQueryString(true); var url = $"{hostName}/sitecore/{eventHandler}{parameters}"; var fakeData = new ExmFakeData { UserAgent = userAgent, RequestTime = dateTime, GeoData = geoData }; RequestUrl(url, fakeData); }
protected void Page_Load(object sender, EventArgs e) { //ltlCallbackScript.Text = @"<script type=""text/javascript"">function CallServer(arg, context) { " + Page.ClientScript.GetCallbackEventReference(this, "arg", "ReceiveServerData", "context") + "; }</script>"; //Page.Header.Controls.Add( // new LiteralControl( // String.Format(@"<script src=""{0}?Rev={1}"" type=""text/javascript""></script>", // ResolveUrl("~/Scripts/FindADocResults.js"), // System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()))); if (!Page.IsPostBack) { lblSpecialty.Text = lblSpecialty_MoreInfoTitle.Text = ThisSession.Specialty; fromFindADoc = !(Request.UrlReferrer == null ? true : Request.UrlReferrer.ToString().ToLower().Contains("specialty_search")); //GetDocsForSpecialty(ThisSession.PatientLatitude, ThisSession.PatientLongitude); lblAllResult1DisclaimerText.Text = ThisSession.AllResult1DisclaimerText; // lam, 20130425, MSF-295 move disclaimer text to content manager lblMentalHealthDisclaimerText.Text = ThisSession.MentalHealthDisclaimerText; // lam, 20130508, CI-144 } else { if (POSTDIST.Value.Replace("undefined", "") != "" && POSTNAV.Value.Replace("undefined", "") != "") { ThisSession.FacilityDistance = POSTDIST.Value; QueryStringEncryption qs = new QueryStringEncryption(POSTNAV.Value, new Guid(ThisSession.UserLogginID)); ThisSession.PracticeName = qs["PracticeName"]; ThisSession.ProviderName = qs["ProviderName"]; ThisSession.PracticeNPI = qs["PracticeNPI"]; ThisSession.TaxID = qs["TaxID"]; ThisSession.OrganizationLocationID = Convert.ToInt32(qs["OrganizationLocationID"]); // lam, 20130313, MSF-177, "Office Visit" should stay on "Find a Service" tab but not "Find a Doctor" Response.Redirect("doctor_specialty_detail.aspx#" + (ThisSession.ServiceEntered.ToLower().Contains("office") ? "tabcare" : "tabdoc")); //Response.Redirect("doctor_specialty_detail.aspx#tabdoc"); } //switch (AcceptablePostBackControl) //{ // case PostBacksIHandle.Geocoder: // //Handle the event that the user has changed their address // GetDocsForSpecialty(PostBackLatLng[0], PostBackLatLng[1]); // break; // case PostBacksIHandle.Doctor: // //Handle the event that the user has selected a doctor result // SelectDoctor(); // break; // case PostBacksIHandle.Fault: // //The post back was not recognized so same as "default" switch // break; // default: // //Do Nothing // break; //} } }
private void SetupShortSearch() { pnlLongSearch.Visible = false; pnlShortSearch.Visible = true; try { QueryStringEncryption qse = new QueryStringEncryption( Encoder.HtmlEncode(Request.QueryString["srch"].ToString()), (Guid)Membership.GetUser().ProviderUserKey); passedCCHID = qse["CCHID"]; passedEmployerID = qse["EmployerID"]; lblEmployerFromSrch.Text = String.Format("{0}", passedEmployerID); lblEmployeeIDFromSrch.Text = String.Format("{0}", passedCCHID); DataRow dr = (from employer in Employers.Tables[0].AsEnumerable() where employer.Field<int>("EmployerID") == int.Parse(passedEmployerID) select employer).FirstOrDefault(); ThisSession.CnxString = dr[2].ToString(); ThisSession.EmployerID = dr[0].ToString(); ThisSession.EmployerName = dr[1].ToString(); ThisSession.Insurer = dr[3].ToString(); ThisSession.RXProvider = dr[4].ToString(); ThisSession.ShowYourCostColumn = Convert.ToBoolean(dr[5].ToString()); using (GetEmployerContent gec = new GetEmployerContent(int.Parse(passedEmployerID))) gec.PutInSession(); Employee = new GetEmployeeByCCHIDForCallCenter(Convert.ToInt32(passedCCHID)); Employee.GetData(); if (!Employee.HasErrors) { gvUsers.DataSource = Employee.Employee; gvUsers.DataBind(); } else { SetupLongSearch(); } } catch (Exception ex) { SetupLongSearch(); ltlMessage.Text = "<div>" + ex.Message + "</div>"; } }