public static bool IsBlocked(string strCountryCode) { customConfig.OperatorSettings opSettings = new customConfig.OperatorSettings("W88"); string strBlockedCountries = opSettings.Values.Get("BlockedCountries"); return(strBlockedCountries.IndexOf(strCountryCode) != -1); }
protected void Page_Load(object sender, EventArgs e) { System.Xml.Linq.XElement xeResources = null; commonCulture.appData.getLocalResource(out xeResources); customConfig.OperatorSettings opSettings = new customConfig.OperatorSettings("W88"); string strLPNumber = string.Empty; string strAppKey = string.Empty; string strSkill = string.Empty; System.Web.UI.WebControls.Literal litScript = (System.Web.UI.WebControls.Literal)Page.FindControl("litScript"); if (!Page.IsPostBack) { System.Text.StringBuilder sbJSDictionary = new System.Text.StringBuilder(); foreach (System.Xml.Linq.XElement xeLabel in xeResources.Elements()) { sbJSDictionary.Append("dictionary.setData('" + xeLabel.Name + "', '" + xeLabel.Value + "');"); } strLPNumber = opSettings.Values.Get("LPNumber"); strAppKey = opSettings.Values.Get("LPAppKey"); strSkill = commonCulture.ElementValues.getResourceString("lblSkill", xeResources); btnSend.InnerText = commonCulture.ElementValues.getResourceString("btnSend", xeResources); btnReqChat.InnerText = commonCulture.ElementValues.getResourceString("btnReqChat", xeResources); btnEndChat.InnerText = commonCulture.ElementValues.getResourceString("btnEndChat", xeResources); //LPVariables.SessionId = '" + System.Guid.NewGuid().ToString().ToUpper() + "'; if (litScript != null) { litScript.Text += "<script type='text/javascript'> $(function () { LPVariables.LPNumber = '" + strLPNumber + "'; LPVariables.AppKey = '" + commonEncryption.decrypting(strAppKey) + "'; LPVariables.Skill = '" + strSkill + "'; LPVariables.VisitorName = '" + base.userInfo.MemberCode + "'; LPVariables.SessionId = '" + System.Guid.NewGuid().ToString().ToUpper() + "'; " + Convert.ToString(sbJSDictionary) + " });</script>"; } } }
public SlotPromo() { opsettings = new customConfig.OperatorSettings("W88"); var user = new Members(); userInfo = user.MemberData(); }
public static string getPK10Url(bool isReal = false) { if (isReal && string.IsNullOrEmpty(commonVariables.CurrentMemberSessionId)) { return("/_Secure/Login.aspx"); } customConfig.OperatorSettings opSettings = new customConfig.OperatorSettings("W88"); string strUrl = opSettings.Values.Get("Pk10Url"); var domain = HttpContext.Current.Request.Url.Host; var domainFullSplit = domain.Split('.'); var domainHost = domainFullSplit.Length <= 2 ? domain : domainFullSplit[domainFullSplit.Length - 2] + "." + domainFullSplit[domainFullSplit.Length - 1]; var language = commonCookie.CookieLanguage; var token = commonCookie.CookieS; var isExternalPlatform = commonFunctions.isExternalPlatform(); var paramString = "?vendor=W88&s=" + token + "&lang=" + language + "&game=pk10"; if (!isReal) { paramString += "&mode=Try&view=6&theme=2&version=3"; } if (!isExternalPlatform) { paramString += "&domainlink=" + domainHost + "&domain=" + domainHost; } return(string.IsNullOrEmpty(strUrl) ? "" : strUrl + paramString); }
public static string GetLink() { if (string.IsNullOrEmpty(commonVariables.CurrentMemberSessionId)) { return(string.Empty); } var settings = new customConfig.OperatorSettings(commonVariables.OperatorCode); var user = new Members().MemberData(); var isProd = Convert.ToBoolean(ConfigurationManager.AppSettings.Get("ProductionSettings")); var url = isProd ? settings.Values.Get("FishingWorld_PROD_Url") : settings.Values.Get("FishingWorld_UAT_Url"); var op = (int)commonVariables.operatorCode.W88; url = url.Replace("{OP}", op.ToString()) .Replace("{ID}", user.MemberId) .Replace("{CURR}", commonCookie.CookieCurrency) .Replace("{LANG}", commonCookie.CookieLanguage) .Replace("{IP}", commonIp.remoteIP); var link = XDocument.Load(url); if (!string.IsNullOrEmpty((string)link.Root.Element("loginURL"))) { return((string)link.Root.Element("loginURL")); } commonAuditTrail.appendLog("system", "FishingWorldProduct", "NavMenu", "", "1", link.ToString(), "", "", url, Convert.ToString(1), "1", false); return(string.Empty); }
protected void Page_Load(object sender, EventArgs e) { xeErrors = commonVariables.ErrorsXML; bool login = false; string strSelectedLanguage = string.Empty; strSelectedLanguage = commonVariables.SelectedLanguage; #region Logout if (string.Compare(Convert.ToString(this.RouteData.DataTokens["logout"]), "true", true) == 0) { login = true; commonVariables.ClearSessionVariables(); commonCookie.ClearCookies(); Response.Redirect(string.Format("/Index?Lang={0}", strSelectedLanguage)); } if (string.Compare(Convert.ToString(this.RouteData.DataTokens["expire"]), "true", true) == 0) { login = true; commonVariables.ClearSessionVariables(); commonCookie.ClearCookies(); strAlertMessage = commonCulture.ElementValues.getResourceString("SessionExpired", xeErrors); Response.Redirect(string.Format("/Index?Lang={0}", strSelectedLanguage)); } if (string.Compare(Convert.ToString(this.RouteData.DataTokens["invalid"]), "true", true) == 0) { login = true; commonVariables.ClearSessionVariables(); commonCookie.ClearCookies(); strAlertMessage = commonCulture.ElementValues.getResourceString("SessionExpired", xeErrors); Response.Redirect(string.Format("/Index?Lang={0}", strSelectedLanguage)); } #endregion customConfig.OperatorSettings opSettings = new customConfig.OperatorSettings("W88"); string strSplashUrl = opSettings.Values.Get("SplashUrl"); /* * if (!string.IsNullOrEmpty(strSplashUrl)) * { * Response.Status = "301 Moved Permanently"; * Response.AddHeader("Location", strSplashUrl); * Response.End(); * } * else * { * Response.Redirect(string.Format("/Index?Lang={0}", strSelectedLanguage)); * } */ string arrStrLanguageSelection = opSettings.Values.Get("LanguageSelection"); List <string> lstLanguageSelection = arrStrLanguageSelection.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries).Select(p => p.Trim()).ToList(); System.Text.StringBuilder sbLanguageHTML = new System.Text.StringBuilder(); foreach (string language in lstLanguageSelection) { string strLanguage = language.Trim(); //if (string.IsNullOrEmpty(commonCookie.CookieS) || login) { sbLanguageHTML.AppendFormat("<a data-theme='b' href='/_Secure/Login.aspx?lang={0}' data-transition='slide' data-rel='dialog' data-transition='slidedown' data-inline='true'><div id='div{1}' class='divLangImg'></div></a>", strLanguage, strLanguage); } //else { sbLanguageHTML.AppendFormat("<a data-theme='b' data-ajax='false' href='/Index.aspx?lang={0}' data-inline='true'><div id='div{1}' class='divLangImg'></div></a>", strLanguage, strLanguage); } sbLanguageHTML.AppendFormat("<a data-theme='b' data-ajax='false' href='/Index.aspx?lang={0}' data-inline='true'><div id='div{1}' class='divLangImg'></div></a>", strLanguage, strLanguage); } divLanguageContainer.InnerHtml = Convert.ToString(sbLanguageHTML); if (!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("AffiliateId"))) { commonVariables.SetSessionVariable("AffiliateId", HttpContext.Current.Request.QueryString.Get("AffiliateId")); } }
protected void Page_Load(object sender, EventArgs e) { string arrStrProductsSelection = string.Empty; string strCurrencyCode = string.Empty; string strProduct = string.Empty; string strWalletName = string.Empty; System.Xml.Linq.XElement xeFTCurrencySettings = null; customConfig.OperatorSettings opSettings = null; System.Xml.Linq.XElement xeResources = null; List <string> lstProductsSelection = null; xeErrors = commonVariables.ErrorsXML; xeResources = commonCulture.appData.getRootResource("/Cashier"); opSettings = new customConfig.OperatorSettings("W88"); arrStrProductsSelection = opSettings.Values.Get("Products"); lstProductsSelection = arrStrProductsSelection.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries).Select(p => p.Trim()).ToList(); if (!Page.IsPostBack) { foreach (string product in lstProductsSelection) { strProduct = product.Trim(); strWalletName = Convert.ToString(commonCulture.ElementValues.getResourceXPathString("Wallets/" + strProduct, commonVariables.ProductsXML)); customConfig.WalletVariables walletVar = System.Configuration.ConfigurationManager.GetSection("WalletGroupSettings/" + strProduct) as customConfig.WalletVariables; if (string.Compare(commonCulture.ElementValues.getResourceXPathAttribute("Currencies/" + strCurrencyCode + "/" + strProduct.ToUpper(), "disabledfundout", xeFTCurrencySettings), "true", true) != 0) { drpTransferFrom.Items.Add(new ListItem(commonCulture.ElementValues.getResourceXPathString("Wallets/" + strProduct, commonVariables.ProductsXML), walletVar.walletId)); } if (string.Compare(commonCulture.ElementValues.getResourceXPathAttribute("Currencies/" + strCurrencyCode + "/" + strProduct.ToUpper(), "disabledfundin", xeFTCurrencySettings), "true", true) != 0) { drpTransferTo.Items.Add(new ListItem(commonCulture.ElementValues.getResourceXPathString("Wallets/" + strProduct, commonVariables.ProductsXML), walletVar.walletId)); } } lblTransferFrom.InnerText = commonCulture.ElementValues.getResourceString("lblTransferFrom", xeResources); lblTransferTo.InnerText = commonCulture.ElementValues.getResourceString("lblTransferTo", xeResources); lblTransferAmount.InnerText = commonCulture.ElementValues.getResourceString("lblTransferAmount", xeResources); lblPromoCode.InnerText = commonCulture.ElementValues.getResourceString("lblPromoCode", xeResources); btnSubmit.Value = commonCulture.ElementValues.getResourceString("btnSubmit", xeResources); btnBack.Value = commonCulture.ElementValues.getResourceString("btnCancel", xeResources); drpTransferTo.SelectedIndex = 1; } }
static void checkCountry() { customConfig.OperatorSettings opSettings = new customConfig.OperatorSettings("W88"); string strBlockedCountries = opSettings.Values.Get("BlockedCountries"); string strCountryCode = string.Empty; string strType = string.Empty; using (wsIP2Loc.ServiceSoapClient wsInstance = new wsIP2Loc.ServiceSoapClient()) { wsInstance.location(commonIp.remoteIP, ref strCountryCode, ref strType); } if (strBlockedCountries.IndexOf(strCountryCode) > -1) { //System.Web.HttpContext.Current.Response.Redirect("/forbidden.html"); } }
protected void Page_Load(object sender, EventArgs e) { string strOperatorId = commonVariables.OperatorId; string strAffiliateId = string.Empty; xeErrors = commonVariables.ErrorsXML; commonCulture.appData.getRootResource("/AccountInfo.aspx", out xeResources); customConfig.OperatorSettings opSettings = new customConfig.OperatorSettings("W88"); //testing //System.Web.HttpContext.Current.Session["AffiliateId"] = "20264"; if (!Page.IsPostBack) { try { using (wsAffiliateMS1.affiliateWSSoapClient wsInstanceAff = new wsAffiliateMS1.affiliateWSSoapClient("affiliateWSSoap")) { DataSet ds = wsInstanceAff.GetSubAffiliateList(long.Parse(commonCookie.CookieAffiliateId)); if (ds.Tables[0].Rows.Count > 0) { ds.Tables[0].Rows[0]["ParentID"] = "0"; lblEmailAddress.Text = commonCulture.ElementValues.getResourceString("lblEmailAddress", xeResources); lblMessage.Text = commonCulture.ElementValues.getResourceString("lblMessage", xeResources); btnSubmit.Text = commonCulture.ElementValues.getResourceString("btnInvite", xeResources); btnCancel.InnerText = commonCulture.ElementValues.getResourceString("btnCancel", xeResources); string emailContent = ""; string emailSubject = ""; getEmail(ref emailSubject, ref emailContent); mainContent.Text = Server.HtmlDecode(emailContent); } } } catch (Exception) { } } }
protected void Page_Load(object sender, EventArgs e) { System.Xml.Linq.XElement xeErrors = null; xeErrors = commonVariables.ErrorsXML; #region Logout if (string.Compare(Convert.ToString(this.RouteData.DataTokens["logout"]), "true", true) == 0) { commonVariables.ClearSessionVariables(); commonCookie.ClearCookies(); } if (string.Compare(Convert.ToString(this.RouteData.DataTokens["expire"]), "true", true) == 0) { commonVariables.ClearSessionVariables(); commonCookie.ClearCookies(); txtMessage.InnerHtml = commonCulture.ElementValues.getResourceString("SessionExpired", xeErrors).Replace("\\n", "<br />"); } if (string.Compare(Convert.ToString(this.RouteData.DataTokens["invalid"]), "true", true) == 0) { commonVariables.ClearSessionVariables(); commonCookie.ClearCookies(); txtMessage.InnerHtml = commonCulture.ElementValues.getResourceString("SessionExpired", xeErrors).Replace("\\n", "<br />"); } #endregion if (!Page.IsPostBack) { customConfig.OperatorSettings opSettings = new customConfig.OperatorSettings("W88"); string arrStrLanguageSelection = opSettings.Values.Get("LanguageSelection"); List <string> lstLanguageSelection = arrStrLanguageSelection.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries).Select(p => p.Trim()).ToList(); foreach (string language in lstLanguageSelection) { System.Web.UI.HtmlControls.HtmlTableRow trRow = new System.Web.UI.HtmlControls.HtmlTableRow(); System.Web.UI.HtmlControls.HtmlTableCell tdCell = new System.Web.UI.HtmlControls.HtmlTableCell(); tdCell.InnerHtml = string.Format("<a href='/_Secure/Login?lang={0}'>{0}</a>", language.Trim()); trRow.Cells.Add(tdCell); tblLanguage.Rows.Add(trRow); } } }
protected void Page_Load(object sender, EventArgs e) { string strOperatorId = commonVariables.OperatorId; string strAffiliateId = string.Empty; xeErrors = commonVariables.ErrorsXML; commonCulture.appData.getRootResource("/AccountInfo.aspx", out xeResources); customConfig.OperatorSettings opSettings = new customConfig.OperatorSettings("W88"); //testing //System.Web.HttpContext.Current.Session["AffiliateId"] = "20264"; if (!Page.IsPostBack) { lblCurrentPassword.Text = commonCulture.ElementValues.getResourceString("lblCurrentPassword", xeResources); lblNewPassword.Text = commonCulture.ElementValues.getResourceString("lblNewPassword", xeResources); lblConfirmPassword.Text = commonCulture.ElementValues.getResourceString("lblConfirmPassword", xeResources); btnSubmit.Text = commonCulture.ElementValues.getResourceString("btnSubmit", xeResources); btnCancel.InnerText = commonCulture.ElementValues.getResourceString("btnCancel", xeResources); } }
protected void Page_Load(object sender, EventArgs e) { xeErrors = commonVariables.ErrorsXML; bool login = false; #region Logout if (string.Compare(Convert.ToString(this.RouteData.DataTokens["logout"]), "true", true) == 0) { login = true; commonVariables.ClearSessionVariables(); commonCookie.ClearCookies(); } if (string.Compare(Convert.ToString(this.RouteData.DataTokens["expire"]), "true", true) == 0) { login = true; commonVariables.ClearSessionVariables(); commonCookie.ClearCookies(); strAlertMessage = commonCulture.ElementValues.getResourceString("SessionExpired", xeErrors); } if (string.Compare(Convert.ToString(this.RouteData.DataTokens["invalid"]), "true", true) == 0) { login = true; commonVariables.ClearSessionVariables(); commonCookie.ClearCookies(); strAlertMessage = commonCulture.ElementValues.getResourceString("SessionExpired", xeErrors); } #endregion customConfig.OperatorSettings opSettings = new customConfig.OperatorSettings("W88"); string arrStrLanguageSelection = opSettings.Values.Get("LanguageSelection"); List <string> lstLanguageSelection = arrStrLanguageSelection.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries) .Select(p => p.Trim()) .ToList(); System.Text.StringBuilder sbLanguageHTML = new System.Text.StringBuilder(); foreach (string language in lstLanguageSelection) { string strLanguage = language.Trim(); if (commonVariables.CDNCountryCode.Equals("MY", StringComparison.OrdinalIgnoreCase)) { if (strLanguage.Equals("zh-cn", StringComparison.OrdinalIgnoreCase)) { sbLanguageHTML.AppendFormat("<li><a data-ajax='false' href='/Index.aspx?lang={0}' data-inline='true' id='divzh-my' class='divLangImg divzh-my'></a></li>", strLanguage); continue; } else if (strLanguage.Equals("en-us", StringComparison.OrdinalIgnoreCase)) { sbLanguageHTML.AppendFormat("<li><a data-ajax='false' href='/Index.aspx?lang={0}' data-inline='true' id='diven-my' class='divLangImg diven-my'></a></li>", strLanguage); continue; } } sbLanguageHTML.AppendFormat("<li><a data-ajax='false' href='/Index.aspx?lang={0}' data-inline='true' id='div{0}' class='divLangImg div{0}'></a></li>", strLanguage); } divLanguageContainer.InnerHtml = Convert.ToString(sbLanguageHTML); string affiliateId = HttpContext.Current.Request.QueryString.Get("AffiliateId"); if (!string.IsNullOrEmpty(affiliateId)) { commonVariables.SetSessionVariable("AffiliateId", affiliateId); commonCookie.CookieAffiliateId = affiliateId; } }
protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("lang"))) { commonVariables.SelectedLanguage = HttpContext.Current.Request.QueryString.Get("lang"); } string strOperatorId = commonVariables.OperatorId; string strAffiliateId = string.Empty; xeErrors = commonVariables.ErrorsXML; System.Xml.Linq.XElement xeResources = null; commonCulture.appData.getLocalResource(out xeResources); var opSettings = new customConfig.OperatorSettings("W88"); if (commonVariables.SelectedLanguageShort.ToLower() == "th") { pnlLineId.Visible = true; } XElement xeBlockListed; commonCulture.appData.GetRootResourceNonLanguage("/Shared/BlockListed", out xeBlockListed); _blockList = xeBlockListed.Elements("BlockListed").Elements().ToList(); if (Page.IsPostBack) { return; } if (!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("referid"))) { commonCookie.CookieReferralId = HttpContext.Current.Request.QueryString.Get("referid"); } if (string.IsNullOrEmpty(commonVariables.GetSessionVariable("AffiliateId"))) { var affiliateId = HttpContext.Current.Request.QueryString.Get("AffiliateId"); if (!string.IsNullOrEmpty(affiliateId)) { commonVariables.SetSessionVariable("AffiliateId", affiliateId); commonCookie.CookieAffiliateId = affiliateId; } } if (!string.IsNullOrWhiteSpace(commonCookie.CookieAffiliateId)) { strAffiliateId = commonCookie.CookieAffiliateId; } else { strAffiliateId = string.IsNullOrEmpty(commonVariables.GetSessionVariable("AffiliateId")) ? string.Empty : Convert.ToString(commonVariables.GetSessionVariable("AffiliateId")); } lblUsername.Text = commonCulture.ElementValues.getResourceString("lblUsername", xeResources); lblPassword.Text = commonCulture.ElementValues.getResourceString("lblPassword", xeResources); lblConfirmPassword.Text = commonCulture.ElementValues.getResourceString("lblConfirmPassword", xeResources); lblEmail.Text = commonCulture.ElementValues.getResourceString("lblEmailAddress", xeResources); lblContact.Text = commonCulture.ElementValues.getResourceString("lblContact", xeResources); lblCurrency.Text = commonCulture.ElementValues.getResourceString("lblCurrency", xeResources); lblAffiliateID.Text = commonCulture.ElementValues.getResourceString("lblAffiliateID", xeResources); btnSubmit.Text = commonCulture.ElementValues.getResourceString("btnSubmit", xeResources); btnCancel.InnerText = commonCulture.ElementValues.getResourceString("btnCancel", xeResources); lblDisclaimer.InnerText = commonCulture.ElementValues.getResourceString("lblDisclaimer", xeResources); btnTermsConditionsLink.InnerText = commonCulture.ElementValues.getResourceString("termsConditions", xeResources); btnTermsConditionsLink.HRef = commonCulture.ElementValues.getResourceString("termsConditionsUrl", xeResources); #region PhoneCountryCode System.Data.DataSet dsCountryInfo = null; using (wsMemberMS1.memberWSSoapClient wsInstance = new wsMemberMS1.memberWSSoapClient()) { dsCountryInfo = wsInstance.GetCountryInfo(Convert.ToInt64(strOperatorId)); foreach (System.Data.DataRow drPhoneCountryCode in dsCountryInfo.Tables[0].Select("", "countryPhoneCode ASC")) { drpContactCountry.Items.Add(new ListItem(string.Format("+ {0}", Convert.ToString(drPhoneCountryCode["countryPhoneCode"])), Convert.ToString(drPhoneCountryCode["countryPhoneCode"]))); } if (!string.IsNullOrEmpty(CDNCountryCode)) { System.Data.DataRow[] countrySearchResult = dsCountryInfo.Tables[0].Select("countryCode='" + CDNCountryCode + "'"); if (countrySearchResult.Any()) { drpContactCountry.SelectedValue = countrySearchResult[0]["countryPhoneCode"].ToString(); } } else if (!string.IsNullOrEmpty(commonVariables.GetSessionVariable("countryCode"))) { System.Data.DataRow[] countrySearchResult = dsCountryInfo.Tables[0].Select("countryCode='" + commonVariables.GetSessionVariable("countryCode") + "'"); if (countrySearchResult.Any()) { drpContactCountry.SelectedValue = countrySearchResult[0]["countryPhoneCode"].ToString(); } } else { System.Data.DataRow[] countrySearchResult = dsCountryInfo.Tables[0].Select("countryCode='" + commonVariables.SelectedLanguageShort + "'"); if (countrySearchResult.Any()) { drpContactCountry.SelectedValue = countrySearchResult[0]["countryPhoneCode"].ToString(); } } } #endregion #region Currencies string arrStrCurrencies = opSettings.Values.Get("Currencies"); List <string> lstCurrencies = arrStrCurrencies.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries).Select(p => p.Trim()).ToList(); drpCurrency.Items.Insert(0, new ListItem(commonCulture.ElementValues.getResourceString("drpCurrencySelect", xeResources), "-1")); foreach (string currency in lstCurrencies) { drpCurrency.Items.Add(new ListItem(commonCulture.ElementValues.getResourceXPathString("Currency/" + currency, xeResources), currency)); } #endregion //lblFirstName.Text = commonCulture.ElementValues.getResourceString("lblFirstName", xeResources); //lblLastName.Text = commonCulture.ElementValues.getResourceString("lblLastName", xeResources); lblName.Text = commonCulture.ElementValues.getResourceString("lblName", xeResources); lblNote.Text = commonCulture.ElementValues.getResourceString("lblNote", xeResources); lblDOB.Text = commonCulture.ElementValues.getResourceString("lblDOB", xeResources); int intDay = 0; foreach (int vintDay in new int[31]) { intDay++; drpDay.Items.Add(new ListItem((intDay).ToString("0#"), Convert.ToString(intDay))); } foreach (System.Xml.Linq.XElement xeMonth in xeResources.Element("Calendar").Elements()) { drpMonth.Items.Add(new ListItem(xeMonth.Value, Convert.ToString(xeMonth.Name).Replace("m", ""))); } for (int intYear = System.DateTime.Now.Year - 18; intYear >= System.DateTime.Now.Year - 99; intYear--) { drpYear.Items.Add(new ListItem(Convert.ToString(intYear))); } txtAffiliateID.Text = strAffiliateId; if (!string.IsNullOrEmpty(strAffiliateId)) { txtAffiliateID.ReadOnly = true; } }
//else { Response.Redirect(Request.RawUrl); } protected void Page_Load(object sender, EventArgs e) { string strOperatorId = commonVariables.OperatorId; string strAffiliateId = string.Empty; xeErrors = commonVariables.ErrorsXML; //System.Xml.Linq.XElement xeResources = null; //commonCulture.appData.getLocalResource(out xeResources); //xeErrors = commonVariables.ErrorsXML; commonCulture.appData.getRootResource("/AccountInfo.aspx", out xeResources); commonCulture.appData.getRootResource("/security_question.aspx", out xeResourcesSecQues); customConfig.OperatorSettings opSettings = new customConfig.OperatorSettings("W88"); //testing //System.Web.HttpContext.Current.Session["AffiliateId"] = "20264"; if (!Page.IsPostBack) { using (wsAffiliateMS1.affiliateWSSoapClient wsInstanceAff = new wsAffiliateMS1.affiliateWSSoapClient("affiliateWSSoap")) { DataSet dsAffMember = wsInstanceAff.GetAffiliateMemberInfoByID(long.Parse(commonCookie.CookieAffiliateId)); if (dsAffMember.Tables.Count > 0) { if (dsAffMember.Tables[0].Rows.Count > 0) { //if (string.IsNullOrEmpty(commonVariables.GetSessionVariable("AffiliateId"))) { if (string.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("AffiliateId"))) { commonVariables.SetSessionVariable("AffiliateId", HttpContext.Current.Request.QueryString.Get("AffiliateId")); } } //strAffiliateId = string.IsNullOrEmpty(commonVariables.GetSessionVariable("AffiliateId")) ? string.Empty : Convert.ToString(commonVariables.GetSessionVariable("AffiliateId")); lblFullName.Text = commonCulture.ElementValues.getResourceString("lblFullName", xeResources); lblMemberFullName.Text = dsAffMember.Tables[0].Rows[0]["firstname"].ToString(); lblUsername.Text = commonCulture.ElementValues.getResourceString("lblUsername", xeResources); lblMemberUsername.Text = dsAffMember.Tables[0].Rows[0]["affiliateUser"].ToString(); lblEmail.Text = commonCulture.ElementValues.getResourceString("lblEmailAddress", xeResources); lblMemberEmail.Text = dsAffMember.Tables[0].Rows[0]["email"].ToString(); lblCurrency.Text = commonCulture.ElementValues.getResourceString("lblCurrency", xeResources); lblMemberCurrency.Text = dsAffMember.Tables[0].Rows[0]["currency"].ToString(); lblDOB.Text = commonCulture.ElementValues.getResourceString("lblDOB", xeResources); drpDay.SelectedValue = ((DateTime)dsAffMember.Tables[0].Rows[0]["dob"]).Year.ToString(); drpMonth.SelectedValue = ((DateTime)dsAffMember.Tables[0].Rows[0]["dob"]).Month.ToString(); drpYear.SelectedValue = ((DateTime)dsAffMember.Tables[0].Rows[0]["dob"]).Day.ToString(); lblContact.Text = commonCulture.ElementValues.getResourceString("lblContact", xeResources); //txtContact.Attributes.Add("PLACEHOLDER", lblContact.Text); //txtContact.Attributes.Add("PLACEHOLDER", lblContact.Text); string mobilno = dsAffMember.Tables[0].Rows[0]["mobileNo"].ToString(); if (mobilno.Contains("-")) { string[] mobilenosplit = mobilno.Split('-'); drpContactCountry.SelectedValue = mobilenosplit[0]; txtContact.Text = mobilenosplit[1]; } else { drpContactCountry.SelectedValue = "-1"; txtContact.Text = mobilno; } lblCountry.Text = commonCulture.ElementValues.getResourceString("lblCountry", xeResources); drpCountry.SelectedValue = dsAffMember.Tables[0].Rows[0]["countryCode"].ToString(); lblAccount.Text = commonCulture.ElementValues.getResourceString("lblAccount", xeResources); txtAccount.Text = dsAffMember.Tables[0].Rows[0]["contactMessenger"].ToString(); lblAddress.Text = commonCulture.ElementValues.getResourceString("lblAddress", xeResources); txtAddress.Text = dsAffMember.Tables[0].Rows[0]["address"].ToString(); lblCity.Text = commonCulture.ElementValues.getResourceString("lblCity", xeResources); txtCity.Text = dsAffMember.Tables[0].Rows[0]["city"].ToString(); txtPostal.Text = dsAffMember.Tables[0].Rows[0]["postal"].ToString(); lblWebsiteUrl.Text = commonCulture.ElementValues.getResourceString("lblWebsiteUrl", xeResources); System.Web.HttpContext.Current.Session["urlID1"] = ""; System.Web.HttpContext.Current.Session["url1"] = ""; System.Web.HttpContext.Current.Session["urlID2"] = ""; System.Web.HttpContext.Current.Session["url2"] = ""; System.Web.HttpContext.Current.Session["urlID3"] = ""; System.Web.HttpContext.Current.Session["url3"] = ""; DataSet dsAffMemberWebSite = wsInstanceAff.GetAffiliateMemberWebsite(long.Parse(commonCookie.CookieAffiliateId)); //check by individual if (dsAffMemberWebSite.Tables[0].Rows.Count > 0) { if (!string.IsNullOrEmpty(dsAffMemberWebSite.Tables[0].Rows[0]["AffiliateMemberURLID"].ToString())) { System.Web.HttpContext.Current.Session["urlID1"] = dsAffMemberWebSite.Tables[0].Rows[0]["AffiliateMemberURLID"].ToString(); System.Web.HttpContext.Current.Session["url1"] = dsAffMemberWebSite.Tables[0].Rows[0]["affiliateURL"].ToString(); txtURL1.Text = dsAffMemberWebSite.Tables[0].Rows[0]["affiliateURL"].ToString(); } else { lblURL1.Text = commonCulture.ElementValues.getResourceString("lblURL1", xeResources); txtURL1.Attributes.Add("PLACEHOLDER", lblURL1.Text); } if (dsAffMemberWebSite.Tables[0].Rows.Count >= 2 && !string.IsNullOrEmpty(dsAffMemberWebSite.Tables[0].Rows[1]["AffiliateMemberURLID"].ToString())) { System.Web.HttpContext.Current.Session["urlID2"] = dsAffMemberWebSite.Tables[0].Rows[1]["AffiliateMemberURLID"].ToString(); System.Web.HttpContext.Current.Session["url2"] = dsAffMemberWebSite.Tables[0].Rows[1]["affiliateURL"].ToString(); txtURL2.Text = dsAffMemberWebSite.Tables[0].Rows[1]["affiliateURL"].ToString(); } else { lblURL2.Text = commonCulture.ElementValues.getResourceString("lblURL2", xeResources); txtURL2.Attributes.Add("PLACEHOLDER", lblURL2.Text); } if (dsAffMemberWebSite.Tables[0].Rows.Count >= 3 && !string.IsNullOrEmpty(dsAffMemberWebSite.Tables[0].Rows[2]["AffiliateMemberURLID"].ToString())) { System.Web.HttpContext.Current.Session["urlID3"] = dsAffMemberWebSite.Tables[0].Rows[2]["AffiliateMemberURLID"].ToString(); System.Web.HttpContext.Current.Session["url3"] = dsAffMemberWebSite.Tables[0].Rows[2]["affiliateURL"].ToString(); txtURL3.Text = dsAffMemberWebSite.Tables[0].Rows[2]["affiliateURL"].ToString(); } else { lblURL3.Text = commonCulture.ElementValues.getResourceString("lblURL3", xeResources); txtURL3.Attributes.Add("PLACEHOLDER", lblURL3.Text); } } else { lblURL1.Text = commonCulture.ElementValues.getResourceString("lblURL1", xeResources); txtURL1.Attributes.Add("PLACEHOLDER", lblURL1.Text); lblURL2.Text = commonCulture.ElementValues.getResourceString("lblURL2", xeResources); txtURL2.Attributes.Add("PLACEHOLDER", lblURL2.Text); lblURL3.Text = commonCulture.ElementValues.getResourceString("lblURL3", xeResources); txtURL3.Attributes.Add("PLACEHOLDER", lblURL3.Text); } lblLanguage.Text = commonCulture.ElementValues.getResourceString("lblLanguage", xeResources); lblCommissionType.Text = commonCulture.ElementValues.getResourceString("lblCommissionType", xeResources); lblSecQues.Text = commonCulture.ElementValues.getResourceString("lblSecQues", xeResources); lblSecAns.Text = commonCulture.ElementValues.getResourceString("lblSecAns", xeResources); txtSecAns.Text = dsAffMember.Tables[0].Rows[0]["securityAnswer"].ToString(); lblBankAccName.Text = commonCulture.ElementValues.getResourceString("lblBankAccName", xeResources); txtBankAccName.Text = dsAffMember.Tables[0].Rows[0]["BankAccName"].ToString(); lblBankAccNo.Text = commonCulture.ElementValues.getResourceString("lblBankAccNo", xeResources); txtBankAccNo.Text = dsAffMember.Tables[0].Rows[0]["BankAccNumber"].ToString(); lblSwiftCode.Text = commonCulture.ElementValues.getResourceString("lblSwiftCode", xeResources); txtSwiftCode.Text = dsAffMember.Tables[0].Rows[0]["BankSwiftCode"].ToString(); lblBankName.Text = commonCulture.ElementValues.getResourceString("lblBankName", xeResources); txtBankName.Text = dsAffMember.Tables[0].Rows[0]["BankName"].ToString(); lblBankAdd.Text = commonCulture.ElementValues.getResourceString("lblBankAdd", xeResources); txtBankAdd.Text = dsAffMember.Tables[0].Rows[0]["BankAddress"].ToString(); //lblCaptcha.Text = commonCulture.ElementValues.getResourceString("lblCaptcha", xeResources); //txtCaptcha.Attributes.Add("PLACEHOLDER", lblCaptcha.Text); //lblDisclaimer.InnerText = commonCulture.ElementValues.getResourceString("lblDisclaimer", xeResources); btnUpdate.Text = commonCulture.ElementValues.getResourceString("lblUpdate", xeResources); btnCancel.InnerText = commonCulture.ElementValues.getResourceString("btnCancel", xeResources); #region PhoneCountryCode System.Data.DataSet dsCountryInfo = null; using (wsMemberMS1.memberWSSoapClient wsInstance = new wsMemberMS1.memberWSSoapClient()) { dsCountryInfo = wsInstance.GetCountryInfo(Convert.ToInt64(strOperatorId)); if (dsCountryInfo.Tables[0].Rows.Count > 0) { foreach (System.Data.DataRow drPhoneCountryCode in dsCountryInfo.Tables[0].Select("", "countryPhoneCode ASC")) { string strProcessRemark = "Register: GetCountryInfo" + strOperatorId; int intProcessSerialId = 0; intProcessSerialId += 1; commonAuditTrail.appendLog("system", "Register", "ParameterValidation", "DataBaseManager.DLL", "", "", "", "", strProcessRemark, Convert.ToString(intProcessSerialId), "", true); drpContactCountry.Items.Add(new ListItem(string.Format("+ {0}", Convert.ToString(drPhoneCountryCode["countryPhoneCode"])), Convert.ToString(drPhoneCountryCode["countryPhoneCode"]))); } } } #endregion #region Currencies //string arrStrCurrencies = opSettings.Values.Get("Currencies"); //List<string> lstCurrencies = arrStrCurrencies.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries).Select(p => p.Trim()).ToList(); //drpCurrency.Items.Insert(0, new ListItem(commonCulture.ElementValues.getResourceString("drpCurrencySelect", xeResources), "-1")); //foreach (string currency in lstCurrencies) //{ // string strProcessRemark = "currency: " + currency; // int intProcessSerialId = 0; // intProcessSerialId += 1; // commonAuditTrail.appendLog("system", "Register", "ParameterValidation", "DataBaseManager.DLL", "", "", "", "", strProcessRemark, Convert.ToString(intProcessSerialId), "", true); // drpCurrency.Items.Add(new ListItem(commonCulture.ElementValues.getResourceXPathString("Currency/" + currency, xeResources), currency)); //} #endregion #region Country //using (wsAffiliateMS1.affiliateWSSoapClient wsInstanceAff = new wsAffiliateMS1.affiliateWSSoapClient("affiliateWSSoap")) //{ System.Data.DataSet ds_country = wsInstanceAff.GetCountryList(); if (ds_country.Tables[0].Rows.Count > 0) { drpCountry.DataTextField = "countryName"; drpCountry.DataValueField = "countryCode"; drpCountry.DataSource = ds_country.Tables[0]; drpCountry.DataBind(); drpCountry.Items.Insert(0, new ListItem(commonCulture.ElementValues.getResourceString("drpCountrySelect", xeResources), "-1")); } //} #endregion #region Language string[] langcodes = System.Configuration.ConfigurationManager.AppSettings.Get("list_language_code").Split(','); string[] langNames = System.Configuration.ConfigurationManager.AppSettings.Get("list_language_translation").Split(','); drpLanguage.Items.Insert(0, new ListItem(commonCulture.ElementValues.getResourceString("drpLanguageSelect", xeResources), "-1")); for (int i = 0; i < langcodes.Length; i++) { drpLanguage.Items.Add(new ListItem(langNames[i], langcodes[i])); } drpLanguage.SelectedValue = dsAffMember.Tables[0].Rows[0]["languageCode"].ToString(); #endregion #region Commission Type drpCommissionType.Items.Insert(0, new ListItem(commonCulture.ElementValues.getResourceString("lblCommissionType", xeResources), "-1")); drpCommissionType.Items.Add(new ListItem(commonCulture.ElementValues.getResourceString("lblRevenueShare", xeResources).ToString(), "Revenue Share")); drpCommissionType.SelectedValue = dsAffMember.Tables[0].Rows[0]["comType"].ToString(); #endregion #region Security Question //drpSecQues.Items.Insert(0, new ListItem(commonCulture.ElementValues.getResourceString("lblSecQues", xeResources), "-1")); for (int i = 1; i <= 6; i++) { drpSecQues.Items.Add(new ListItem(commonCulture.ElementValues.getResourceString("lblsecurityquestion" + i, xeResourcesSecQues), "security_question_" + i)); } drpSecQues.SelectedValue = dsAffMember.Tables[0].Rows[0]["securityQuestion"].ToString(); #endregion int intDay = 0; foreach (int vintDay in new int[31]) { intDay++; drpDay.Items.Add(new ListItem((intDay).ToString("0#"), Convert.ToString(intDay))); } foreach (System.Xml.Linq.XElement xeMonth in xeResources.Element("Calendar").Elements()) { drpMonth.Items.Add(new ListItem(xeMonth.Value, Convert.ToString(xeMonth.Name).Replace("m", ""))); } for (int intYear = System.DateTime.Now.Year - 18; intYear >= System.DateTime.Now.Year - 99; intYear--) { drpYear.Items.Add(new ListItem(Convert.ToString(intYear))); } //txtAffiliateID.Text = strAffiliateId; } } } } }
protected void Page_Load(object sender, EventArgs e) { System.Xml.Linq.XElement xeResources = null; commonCulture.appData.getRootResource("/_Secure/UpdateProfile", out xeResources); customConfig.OperatorSettings opSettings = new customConfig.OperatorSettings("W88"); System.Data.DataSet dsMemberProfile = null; string strOperatorId = string.Empty; string strMemberId = string.Empty; #region UneditableFieldsVariablesInitialise string strEmailAddress = string.Empty; string strContactNumber = string.Empty; string strMemberCode = string.Empty; string strFName = string.Empty; string strLName = string.Empty; string strDOB = string.Empty; string strCurrency = string.Empty; string strCountry = string.Empty; #endregion #region AddressDetailInitialisation string strAddress = string.Empty; string strCity = string.Empty; string strPostal = string.Empty; #endregion #region OtherDetails string strGender = string.Empty; string strOdds = string.Empty; string strLanguage = string.Empty; string strSecurityQuestion = string.Empty; string strSecurityAnswer = string.Empty; #endregion if (!Page.IsPostBack) { strOperatorId = commonVariables.OperatorId; strMemberId = commonVariables.GetSessionVariable("MemberId"); lblSecurityQuestion.Text = commonCulture.ElementValues.getResourceString("lblSecurityQuestion", xeResources); lblSecurityAnswer.Text = commonCulture.ElementValues.getResourceString("lblSecurityAnswer", xeResources); btnSubmit.Text = commonCulture.ElementValues.getResourceString("btnSubmit", xeResources); using (wsMemberMS1.memberWSSoapClient wsInstance = new wsMemberMS1.memberWSSoapClient()) { dsMemberProfile = wsInstance.GetMemberInfo(Convert.ToInt64(strOperatorId), Convert.ToInt64(strMemberId)); if (dsMemberProfile.Tables.Count > 0) { if (dsMemberProfile.Tables[0].Rows.Count == 1) { #region UneditableFieldsVariablesPopulate strEmailAddress = Convert.ToString(dsMemberProfile.Tables[0].Rows[0]["email"]); strContactNumber = Convert.ToString(dsMemberProfile.Tables[0].Rows[0]["mobile"]); strMemberCode = Convert.ToString(dsMemberProfile.Tables[0].Rows[0]["memberCode"]); strFName = Convert.ToString(dsMemberProfile.Tables[0].Rows[0]["firstName"]); strLName = Convert.ToString(dsMemberProfile.Tables[0].Rows[0]["lastName"]); strDOB = Convert.ToDateTime(dsMemberProfile.Tables[0].Rows[0]["dob"]).ToString(commonVariables.DisplayDateFormat); strCurrency = Convert.ToString(dsMemberProfile.Tables[0].Rows[0]["currencyCode"]); strCountry = Convert.ToString(dsMemberProfile.Tables[0].Rows[0]["countryCode"]); #endregion #region AddressDetails strAddress = Convert.ToString(dsMemberProfile.Tables[0].Rows[0]["address"]); strCity = Convert.ToString(dsMemberProfile.Tables[0].Rows[0]["city"]); strPostal = Convert.ToString(dsMemberProfile.Tables[0].Rows[0]["postal"]); #endregion #region OtherDetails strGender = Convert.ToString(dsMemberProfile.Tables[0].Rows[0]["gender"]); strOdds = Convert.ToString(dsMemberProfile.Tables[0].Rows[0]["oddsType"]); strLanguage = Convert.ToString(dsMemberProfile.Tables[0].Rows[0]["languageCode"]); strSecurityQuestion = Convert.ToString(dsMemberProfile.Tables[0].Rows[0]["securityQuestion"]); strSecurityAnswer = Convert.ToString(dsMemberProfile.Tables[0].Rows[0]["securityAnswer"]); #endregion } } } } }
protected void btnUpdate_Click(object sender, EventArgs e) { string strAffiliateId = string.Empty; #region initialiseVariables int intProcessSerialId = 0; string strProcessId = Guid.NewGuid().ToString().ToUpper(); string strPageName = "Register"; string strProcessCode = string.Empty; string strResultCode = string.Empty; string strResultDetail = string.Empty; string strErrorCode = string.Empty; string strErrorDetail = string.Empty; string strProcessRemark = string.Empty; bool isProcessAbort = false; bool isSystemError = false; long lngOperatorId = 1; bool isTestAccount = false; //string strMemberCode = string.Empty; //string strPassword = string.Empty; //string strPasswordEncrypted = string.Empty; //string strEmail = string.Empty; string strContact = string.Empty; string strContactNumber = string.Empty; string strDOB = string.Empty; string strFName = string.Empty; //string strLName = string.Empty; //string strCurrencyCode = string.Empty; string strCountryCode = string.Empty; string strAccount = string.Empty; //string strReferralId = string.Empty; string strLanguageCode = string.Empty; string strCommissionType = string.Empty; string strAddress = string.Empty; string strCity = string.Empty; string strPostal = string.Empty; string strUrl1 = string.Empty; string strUrl2 = string.Empty; string strUrl3 = string.Empty; //string strDesc = string.Empty; string strIPAddress = string.Empty; string strSignUpUrl = string.Empty; string strVCode = string.Empty; string strSessionVCode = string.Empty; string strPermission = string.Empty; string strSecurityQues = string.Empty; string strSecurityAns = string.Empty; string strBankAccName = string.Empty; string strBankAccNo = string.Empty; string strSwiftCode = string.Empty; string strBankName = string.Empty; string strBankAdd = string.Empty; int intOddsType = 1; System.DateTime dtDOB = DateTime.MinValue; string strHiddenValues = hidValues.Value; List <string> lstValues = null; #endregion #region populateVariables strContact = txtContact.Text; strContactNumber = string.Format("{0}-{1}", drpContactCountry.SelectedValue, strContact); strDOB = string.Format("{0}-{1}-{2}", drpYear.SelectedValue, drpMonth.SelectedValue, drpDay.SelectedValue); strCountryCode = drpCountry.SelectedValue; strAccount = txtAccount.Text.Trim();; strLanguageCode = drpLanguage.SelectedValue; strCommissionType = drpCommissionType.SelectedValue; strAddress = txtAddress.Text.Trim(); strCity = txtCity.Text.Trim(); strPostal = txtPostal.Text.Trim(); strUrl1 = txtURL1.Text.Trim(); strUrl2 = txtURL2.Text.Trim(); strUrl3 = txtURL3.Text.Trim(); strSecurityQues = drpSecQues.SelectedValue; strSecurityAns = txtSecAns.Text.Trim(); strBankAccName = txtBankAccName.Text.Trim(); strBankAccNo = txtBankAccNo.Text.Trim(); strSwiftCode = txtSwiftCode.Text.Trim(); strBankName = txtBankName.Text.Trim(); strBankAdd = txtBankAdd.Text.Trim(); strSessionVCode = commonVariables.GetSessionVariable("vCode"); strAlertCode = "-1"; //strAffiliateId = txtAffiliateID.Text; System.Text.RegularExpressions.Regex rexContact = new System.Text.RegularExpressions.Regex("([0-9]{1,4})[-]([0-9]{6,12})$"); #endregion #region parametersValidation strResultCode = "11"; strResultDetail = "Error:ParameterValidation"; //txtCaptcha.Text = string.Empty; if (string.IsNullOrEmpty(strContact)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingContact", xeErrors); isProcessAbort = true; } else if (!rexContact.IsMatch(strContactNumber)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidContact", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strSecurityAns)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdateProfile/MissingSecurityAnswer", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strBankAccName)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdateProfile/InvalidBankAccName", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strBankAccNo)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdateProfile/InvalidBankAccNo", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strBankName)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdateProfile/InvalidBankName", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strBankAdd)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidBankAdd", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strCountryCode) || string.Compare(strCountryCode, "-1", true) == 0) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingCountryCode", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strLanguageCode) || string.Compare(strLanguageCode, "-1", true) == 0) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingLanguageCode", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strCommissionType) || string.Compare(strCommissionType, "-1", true) == 0) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingCommissionType", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strContact)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidContact", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strCountryCode)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidCountryCode", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strAccount)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidAccount", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strLanguageCode)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidLanguageCode", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strCommissionType)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidCommissionType", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strAddress)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidAddress", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strCity)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidCity", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strPostal)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidPostal", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strUrl1)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidUrl1", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strUrl2)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidUrl2", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strUrl3)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidUrl3", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strSecurityQues)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdateProfile/InvalidSecurityQuestion", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strSecurityAns)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdateProfile/InvalidSecurityAnswer", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strBankAccName)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdateProfile/InvalidBankAccName", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strBankAccNo)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdateProfile/InvalidBankAccNo", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strBankName)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdateProfile/InvalidBankName", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strBankAdd)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdateProfile/InvalidBankAdd", xeErrors); isProcessAbort = true; } else if (!DateTime.TryParse(strDOB, out dtDOB)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidDOB", xeErrors); isProcessAbort = true; } else { strResultCode = "00"; strResultDetail = "OK:ParameterValidation"; strContact = strContact.TrimStart('+'); } strErrorDetail = strAlertMessage; strProcessRemark = string.Format("strAlertMessage: {0} | HiddenValues: {1}", strAlertMessage, strHiddenValues); intProcessSerialId += 1; commonAuditTrail.appendLog("system", strPageName, "ParameterValidation", "DataBaseManager.DLL", strResultCode, strResultDetail, strErrorCode, strErrorDetail, strProcessRemark, Convert.ToString(intProcessSerialId), strProcessId, isSystemError); #endregion if (!isProcessAbort) { lstValues = strHiddenValues.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries).Select(p => p.Trim()).ToList(); if (lstValues.Count > 0) { //if (lstValues[0] != null) { strCountryCode = lstValues[0]; } //if (lstValues[1] != null) { strSignUpUrl = string.Format("m.{0}", lstValues[1]); } if (lstValues[2] != null) { strIPAddress = lstValues[2]; } if (lstValues[3] != null) { strPermission = lstValues[3]; } } strSignUpUrl = string.Format("m.{0}", commonIp.DomainName); strLanguageCode = commonVariables.SelectedLanguage; if (string.IsNullOrEmpty(strIPAddress)) { strIPAddress = commonIp.UserIP; } if (string.IsNullOrEmpty(strCountryCode) || string.Compare(strCountryCode, "-", true) == 0) { using (wsIP2Loc.ServiceSoapClient wsInstance = new wsIP2Loc.ServiceSoapClient()) { wsInstance.location(strIPAddress, ref strCountryCode, ref strPermission); } } switch (strCountryCode.ToUpper()) { case "MY": case "TH": case "VN": case "KH": intOddsType = 1; break; case "CN": intOddsType = 2; break; case "IN": case "KR": case "JP": case "AU": intOddsType = 3; break; case "ID": intOddsType = 4; break; default: intOddsType = 3; break; } customConfig.OperatorSettings opSettings = new customConfig.OperatorSettings("W88"); if (opSettings.Values.Get("DemoDomains").IndexOf(commonIp.DomainName) >= 0) { isTestAccount = true; } int intAffiliateId = string.IsNullOrEmpty(commonVariables.GetSessionVariable("AffiliateId")) ? (string.IsNullOrEmpty(strAffiliateId) ? 0 : Convert.ToInt32(strAffiliateId)) : Convert.ToInt32(commonVariables.GetSessionVariable("AffiliateId")); string strReferBy = string.Empty; string strDeviceId = "Mobile"; //System.Data.DataSet dsRegister = null; int result = 0; //using (wsMemberMS1.memberWSSoapClient svcInstance = new wsMemberMS1.memberWSSoapClient()) using (wsAffiliateMS1.affiliateWSSoapClient svcInstance = new wsAffiliateMS1.affiliateWSSoapClient()) { //result = svcInstance.MemberRegistration(strMemberCode, strPasswordEncrypted, strFName, strEmail, strContactNumber, strCountryCode, strLanguageCode, strCurrencyCode, lngOperatorId, // strAddress, strCity, strPostal, strIPAddress, strDesc, referralid, strUrl1, strUrl2, strUrl3, dtDOB, strAccount, strCommissionType, strSignUpUrl, // (string)System.Configuration.ConfigurationManager.AppSettings.Get("internal_affiliate")); //strProcessRemark = "exec spAffiliateMemberInsertWS " + "'" + strMemberCode + "'" + ",'" + strPasswordEncrypted + "'" + ",'" + strFName + "'" + ",'" + strEmail + "'" + ",'" + strContactNumber + "'" + ",'" + strCountryCode + "'" + ",'" + strLanguageCode + "'" + ",'" + strCurrencyCode + "'" + ",'" + lngOperatorId + "'" + ",'" + strAddress + "'" + ",'" + strCity + "'" + ",'" + strPostal + "'" + ",'" + strIPAddress + "'" + ",'" + strDesc + "'" + ",'" + referralid + "'" + ",'" + strUrl1 + "'" + ",'" + strUrl2 + "'" + ",'" + strUrl3 + "'" + ",'" + dtDOB + "'" + ",'" + strAccount + "'" + ",'" + strCommissionType + "'" + ",'" + strSignUpUrl + "'" + ",'" + (string)System.Configuration.ConfigurationManager.AppSettings.Get("internal_affiliate") + "'"; try { //result = svcInstance.UpdateAffiliateMemberInfo(long.Parse(System.Web.HttpContext.Current.Session["AffiliateId"].ToString()), DateTime.Parse(strDOB), //strCountryCode, strAccount, strContactNumber, strAddress, strCity, strPostal, strLanguageCode, strCommissionType, strSecurityQues, //strSecurityAns, strBankAccName, strBankAccNo, strSwiftCode, strBankName, strBankAdd); result = svcInstance.UpdateAffiliateMemberInfo(long.Parse(commonCookie.CookieAffiliateId), DateTime.Parse(strDOB), strCountryCode, strAccount, strContactNumber, strAddress, strCity, strPostal, strLanguageCode, strCommissionType, strSecurityQues, strSecurityAns, strBankAccName, strBankAccNo, strSwiftCode, strBankName, strBankAdd, ""); if (result == 1) { //delete removed url if (String.IsNullOrEmpty(txtURL1.Text) && (string)System.Web.HttpContext.Current.Session["url1"] != "") { result = svcInstance.DeleteWebsiteURL(long.Parse((string)System.Web.HttpContext.Current.Session["urlID1"])); } if (String.IsNullOrEmpty(txtURL2.Text) && (string)System.Web.HttpContext.Current.Session["url2"] != "") { result = svcInstance.DeleteWebsiteURL(long.Parse((string)System.Web.HttpContext.Current.Session["urlID2"])); } if (String.IsNullOrEmpty(txtURL3.Text) && (string)System.Web.HttpContext.Current.Session["url3"] != "") { result = svcInstance.DeleteWebsiteURL(long.Parse((string)System.Web.HttpContext.Current.Session["urlID3"])); } if ((string)System.Web.HttpContext.Current.Session["url1"] != txtURL1.Text && !String.IsNullOrEmpty((string)System.Web.HttpContext.Current.Session["url1"])) { result = svcInstance.DeleteWebsiteURL(long.Parse((string)System.Web.HttpContext.Current.Session["urlID1"])); } if ((string)System.Web.HttpContext.Current.Session["url2"] != txtURL2.Text && !String.IsNullOrEmpty((string)System.Web.HttpContext.Current.Session["url2"])) { result = svcInstance.DeleteWebsiteURL(long.Parse((string)System.Web.HttpContext.Current.Session["urlID2"])); } if ((string)System.Web.HttpContext.Current.Session["url3"] != txtURL3.Text && !String.IsNullOrEmpty((string)System.Web.HttpContext.Current.Session["url3"])) { result = svcInstance.DeleteWebsiteURL(long.Parse((string)System.Web.HttpContext.Current.Session["urlID3"])); } //add new url if ((string)System.Web.HttpContext.Current.Session["url1"] != txtURL1.Text && txtURL1.Text != commonCulture.ElementValues.getResourceString("lblURL1", xeResources) && !String.IsNullOrEmpty(txtURL1.Text)) { result = svcInstance.InsertWebsiteURL(long.Parse(commonCookie.CookieAffiliateId), txtURL1.Text); } if ((string)System.Web.HttpContext.Current.Session["url2"] != txtURL2.Text && txtURL2.Text != commonCulture.ElementValues.getResourceString("lblURL2", xeResources) && !String.IsNullOrEmpty(txtURL2.Text)) { result = svcInstance.InsertWebsiteURL(long.Parse(commonCookie.CookieAffiliateId), txtURL2.Text); } if ((string)System.Web.HttpContext.Current.Session["url3"] != txtURL3.Text && txtURL3.Text != commonCulture.ElementValues.getResourceString("lblURL3", xeResources) && !String.IsNullOrEmpty(txtURL3.Text)) { result = svcInstance.InsertWebsiteURL(long.Parse(commonCookie.CookieAffiliateId), txtURL3.Text); } } } catch (Exception) { throw; } strProcessRemark = "exec spAffiliateMemberUpdatePublic " + "'" + long.Parse(commonCookie.CookieAffiliateId) + "'" + ",'" + DateTime.Parse(strDOB) + "'" + ",'" + strCountryCode + "'" + ",'" + strAccount + "'" + ",'" + strContactNumber + "'" + ",'" + strAddress + "'" + ",'" + strCity + "'" + ",'" + strPostal + "'" + ",'" + strLanguageCode + "'" + ",'" + strCommissionType + "'" + ",'" + strSecurityQues + "'" + ",'" + strSecurityAns + "'" + ",'" + strBankAccName + "'" + ",'" + strBankAccNo + "'" + ",'" + strSwiftCode + "'" + ",'" + strBankName + ",'" + strBankAdd + "'" + "'"; intProcessSerialId += 1; commonAuditTrail.appendLog("system", strPageName, "RegistrationParameterValidation", "DataBaseManager.DLL", strResultCode, strResultDetail, strErrorCode, strErrorDetail, strProcessRemark, Convert.ToString(intProcessSerialId), strProcessId, isSystemError); strResultCode = "21"; strResultDetail = "Error:MemberRegistrationNew"; //if (dsRegister.Tables[0].Rows.Count > 0) //{ // strProcessCode = Convert.ToString(dsRegister.Tables[0].Rows[0]["RETURN_VALUE"]); //switch (strProcessCode) switch (result.ToString()) { case "0": strAlertMessage = commonCulture.ElementValues.getResourceString("Exception", xeErrors); break; case "1": strAlertCode = "1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdateProfile/Success", xeErrors); break; case "10": strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/DuplicateUsername", xeErrors); break; case "11": strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/DuplicateEmail", xeErrors); break; default: strAlertMessage = commonCulture.ElementValues.getResourceString("Exception", xeErrors); break; } strErrorCode = strProcessCode; strErrorDetail = strAlertMessage; } intProcessSerialId += 1; commonAuditTrail.appendLog("system", strPageName, "MemberRegistrationNew", "DataBaseManager.DLL", strResultCode, strResultDetail, strErrorCode, strErrorDetail, strProcessRemark, Convert.ToString(intProcessSerialId), strProcessId, isSystemError); } }
protected void btnSubmit_Click(object sender, EventArgs e) { #region initialiseVariables int intProcessSerialId = 0; string strProcessId = Guid.NewGuid().ToString().ToUpper(); string strPageName = "Register"; string strProcessCode = string.Empty; string strResultCode = string.Empty; string strResultDetail = string.Empty; string strErrorCode = string.Empty; string strErrorDetail = string.Empty; string strProcessRemark = string.Empty; bool isProcessAbort = false; bool isSystemError = false; long lngOperatorId = 1; bool isTestAccount = false; string strMemberCode = string.Empty; string strPassword = string.Empty; string strConfirmPassword = string.Empty; string strPasswordEncrypted = string.Empty; string strEmail = string.Empty; string strContact = string.Empty; string strCurrencyCode = string.Empty; string strFName = string.Empty; string strLName = string.Empty; string strDOB = string.Empty; string strCountryCode = string.Empty; string strLanguageCode = string.Empty; string strIPAddress = string.Empty; string strSignUpUrl = string.Empty; string strPermission = string.Empty; string strContactNumber = string.Empty; string strAffiliateId = string.Empty; int intOddsType = 1; System.DateTime dtDOB = DateTime.MinValue; string strHiddenValues = hidValues.Value; List <string> lstValues = null; int affiliateId; #endregion #region populateVariables strMemberCode = txtUsername.Text.Trim(); strPassword = txtPassword.Text; strConfirmPassword = txtConfirmPassword.Text; strEmail = txtEmail.Text; strContact = txtContact.Text; strCurrencyCode = drpCurrency.SelectedValue; // This changes is for the combined name on frontend only but on the BO everything will be saved in firstname strFName = System.Text.RegularExpressions.Regex.Replace(txtName.Text, @"\t|\n|\r|", "").TrimStart().TrimEnd(); strLName = string.Empty; //System.Text.RegularExpressions.Regex.Replace(txtLastName.Text, @"\t|\n|\r|", ""); strDOB = string.Format("{0}-{1}-{2}", drpYear.SelectedValue, drpMonth.SelectedValue, drpDay.SelectedValue); strAlertCode = "-1"; strContactNumber = string.Format("{0}-{1}", drpContactCountry.SelectedValue, strContact); strAffiliateId = txtAffiliateID.Text; var lineId = commonVariables.SelectedLanguageShort.ToLower() == "th" ? txtLineId.Text : string.Empty; System.Text.RegularExpressions.Regex rexContact = new System.Text.RegularExpressions.Regex("([0-9]{1,4})[-]([0-9]{6,12})$"); // get hidden values lstValues = strHiddenValues.Split(new char[] { '|' }).Select(p => p.Trim()).ToList(); if (lstValues.Count > 0) { if (lstValues[0] != null) { strCountryCode = lstValues[0]; } if (lstValues.Count > 2) { strIPAddress = lstValues[2]; } if (lstValues.Count > 3) { strPermission = lstValues[3]; } } if (string.IsNullOrEmpty(strCountryCode) || string.Compare(strCountryCode, "-", true) == 0) { if (commonCountry.IsValidCountry(CDNCountryCode)) { strCountryCode = CDNCountryCode; } else { using (wsIP2Loc.ServiceSoapClient wsInstance = new wsIP2Loc.ServiceSoapClient()) { wsInstance.location(strIPAddress, ref strCountryCode, ref strPermission); } } } #endregion #region parametersValidation strResultCode = "11"; strResultDetail = "Error:ParameterValidation"; if (string.IsNullOrEmpty(strMemberCode)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingUsername", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strPassword)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingPassword", xeErrors); isProcessAbort = true; } else if (!strPassword.Equals(strConfirmPassword)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidConfirmPass", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strEmail)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingEmail", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strContact)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingContact", xeErrors); isProcessAbort = true; } else if (!rexContact.IsMatch(strContactNumber)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidContact", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strCurrencyCode) || string.Compare(strCurrencyCode, "-1", true) == 0) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingCurrency", xeErrors); isProcessAbort = true; } //else if (string.IsNullOrEmpty(strFName)) //{ // strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingFName", xeErrors); // isProcessAbort = true; //} //else if (string.IsNullOrEmpty(strLName)) //{ // strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingLName", xeErrors); // isProcessAbort = true; //} else if (string.IsNullOrEmpty(strFName)) { // This changes is for the combined name on frontend only but on the BO everything will be saved in firstname strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingName", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strMemberCode) || strMemberCode.IndexOf(' ') >= 0 || !commonValidation.isAlphanumeric(strMemberCode) || strMemberCode.Length < 5 || strMemberCode.Length > 16) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidUsername", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strPassword) || strPassword.Length < 8 || strPassword.Length > 10) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidPassword", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strEmail)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidEmail", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strContact)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidContact", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strCurrencyCode)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidCurrency", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strFName)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidFName", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strLName)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidLName", xeErrors); isProcessAbort = true; } else if (!DateTime.TryParse(strDOB, out dtDOB)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidDOB", xeErrors); isProcessAbort = true; } else if (!CheckOver18(Convert.ToDateTime(strDOB))) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/Required18", xeErrors); isProcessAbort = true; } else if ((!string.IsNullOrEmpty(strCountryCode) && commonCountry.IsBlocked(strCountryCode) && string.IsNullOrEmpty(strPermission)) || strPermission == commonIp.Ip2locPermission.blocked.ToString()) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/CountryBlocked", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(txtLineId.Text)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidLineId", xeErrors); isProcessAbort = true; } else { strResultCode = "00"; strResultDetail = "OK:ParameterValidation"; strContact = strContact.TrimStart('+'); strPasswordEncrypted = commonEncryption.Encrypt(strPassword); } if (_blockList != null) { foreach (var item in _blockList.Where(item => item.Value.ToLower().Equals(strFName.ToLower()))) { strResultCode = "11"; strResultDetail = "Error:ParameterValidation"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("CustomerService", xeErrors); isProcessAbort = true; } } strErrorDetail = strAlertMessage; strProcessRemark = string.Format("strAlertMessage: {0} | HiddenValues: {1} ", strAlertMessage, strHiddenValues); intProcessSerialId += 1; commonAuditTrail.appendLog("system", strPageName, "ParameterValidation", "DataBaseManager.DLL", strResultCode, strResultDetail, strErrorCode, strErrorDetail, strProcessRemark, Convert.ToString(intProcessSerialId), strProcessId, isSystemError); #endregion if (!isProcessAbort) { strSignUpUrl = string.Format("m.{0}", commonIp.DomainName); strLanguageCode = commonVariables.SelectedLanguage; if (string.IsNullOrEmpty(strIPAddress)) { strIPAddress = commonIp.UserIP; } // should assign country based from currency if still empty or "xx" if (!commonCountry.IsValidCountry(strCountryCode)) { strCountryCode = commonCountry.CountryFromCurrency(strCurrencyCode); } switch (strCountryCode.ToUpper()) { case "MY": case "TH": case "VN": case "KH": intOddsType = 1; break; case "CN": intOddsType = 2; break; case "IN": case "KR": case "JP": case "AU": intOddsType = 3; break; case "ID": intOddsType = 4; break; default: intOddsType = 3; break; } customConfig.OperatorSettings opSettings = new customConfig.OperatorSettings("W88"); if (opSettings.Values.Get("DemoDomains").IndexOf(commonIp.DomainName) >= 0) { isTestAccount = true; } string strAddress = strCountryCode; string strCity = strCountryCode; string strPostal = "000000"; string strGender = "M"; //int intAffiliateId = string.IsNullOrEmpty(commonVariables.GetSessionVariable("AffiliateId")) ? (string.IsNullOrEmpty(strAffiliateId) ? 0 : Convert.ToInt32(strAffiliateId)) : Convert.ToInt32(commonVariables.GetSessionVariable("AffiliateId")); string AffiliateId; if (string.IsNullOrEmpty(commonVariables.GetSessionVariable("AffiliateId"))) { AffiliateId = (string.IsNullOrEmpty(strAffiliateId) ? "0" : strAffiliateId); } else { AffiliateId = commonVariables.GetSessionVariable("AffiliateId"); } int intAffiliateId; try { int.TryParse(AffiliateId, out intAffiliateId); } catch { intAffiliateId = 0; } var strReferBy = commonCookie.CookieReferralId; string strDeviceId = !String.IsNullOrEmpty(commonCookie.CookieDeviceId) ? commonCookie.CookieDeviceId : "Mobile"; System.Data.DataSet dsRegister = null; using (wsMemberMS1.memberWSSoapClient svcInstance = new wsMemberMS1.memberWSSoapClient()) { dsRegister = svcInstance.MemberRegistrationNewWithLineId(lngOperatorId, strMemberCode, strPasswordEncrypted, strEmail, strContactNumber, strAddress, strCity, strPostal, strCountryCode, strCurrencyCode, strGender, intOddsType, string.IsNullOrEmpty(strLanguageCode) ? "en-us" : strLanguageCode, intAffiliateId, strReferBy, strIPAddress, strSignUpUrl, strDeviceId, isTestAccount, strFName, strLName, dtDOB, string.Empty, lineId); strProcessRemark = string.Format("OperatorId: {0} | MemberCode: {1} | Password: {2} | Email: {3} | Contact: {4} | Address: {5} | City: {6} | Postal: {6} | Country: {8} | Currency: {9} | Gender: {10} | OddsType: {11} | Language: {12} | Affiliate: {13} | ReferBy: {14} | IP: {15} | SignUpUrl: {16} | DeviceID: {17} | TestAccount: {18} | FName: {19} | LName: {20} | DOB: {21} | REMOTEIP: {22} | FORWARDEDIP: {23} | REQUESTERIP: {24} | AffiliateID: {25}", lngOperatorId, strMemberCode, strPasswordEncrypted, strEmail, strContact, strAddress, strCity, strPostal, strCountryCode, strCurrencyCode, strGender, intOddsType, strLanguageCode, intAffiliateId, strReferBy, strIPAddress, strSignUpUrl, strDeviceId, isTestAccount, strFName, strLName, dtDOB, commonIp.remoteIP, commonIp.forwardedIP, commonIp.requesterIP, intAffiliateId); intProcessSerialId += 1; commonAuditTrail.appendLog("system", strPageName, "RegistrationParameterValidation", "DataBaseManager.DLL", strResultCode, strResultDetail, strErrorCode, strErrorDetail, strProcessRemark, Convert.ToString(intProcessSerialId), strProcessId, isSystemError); strResultCode = "21"; strResultDetail = "Error:MemberRegistrationNew"; if (dsRegister.Tables[0].Rows.Count > 0) { strProcessCode = Convert.ToString(dsRegister.Tables[0].Rows[0]["RETURN_VALUE"]); switch (strProcessCode) { case "0": strAlertMessage = commonCulture.ElementValues.getResourceString("Exception", xeErrors); break; case "1": strAlertCode = strProcessCode; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/Success", xeErrors); string strMemberSessionId = Convert.ToString(dsRegister.Tables[0].Rows[0]["memberSessionId"]); HttpContext.Current.Session.Add("MemberSessionId", Convert.ToString(dsRegister.Tables[0].Rows[0]["memberSessionId"])); HttpContext.Current.Session.Add("MemberId", Convert.ToString(dsRegister.Tables[0].Rows[0]["memberId"])); HttpContext.Current.Session.Add("MemberCode", Convert.ToString(dsRegister.Tables[0].Rows[0]["memberCode"])); HttpContext.Current.Session.Add("CountryCode", Convert.ToString(dsRegister.Tables[0].Rows[0]["countryCode"])); HttpContext.Current.Session.Add("CurrencyCode", Convert.ToString(dsRegister.Tables[0].Rows[0]["currency"])); HttpContext.Current.Session.Add("LanguageCode", Convert.ToString(dsRegister.Tables[0].Rows[0]["languageCode"])); HttpContext.Current.Session.Add("RiskId", Convert.ToString(dsRegister.Tables[0].Rows[0]["riskId"])); HttpContext.Current.Session.Add("PartialSignup", Convert.ToString(dsRegister.Tables[0].Rows[0]["partialSignup"])); HttpContext.Current.Session.Add("ResetPassword", Convert.ToString(dsRegister.Tables[0].Rows[0]["resetPassword"])); commonCookie.CookieS = strMemberSessionId; commonCookie.CookieG = strMemberSessionId; HttpContext.Current.Session.Add("LoginStatus", "success"); strResultCode = "00"; strResultDetail = "OK:MemberRegistrationNew"; #region IOVATION //this.IovationSubmit(ref intProcessSerialId, strProcessId, strPageName, strMemberCode, strIPAddress, strPermission); #endregion break; case "10": strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/DuplicateUsername", xeErrors); break; case "11": strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/DuplicateEmail", xeErrors); break; case "50": strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/DuplicateContact", xeErrors); break; default: strAlertMessage = commonCulture.ElementValues.getResourceString("Exception", xeErrors); break; } strErrorCode = strProcessCode; strErrorDetail = strAlertMessage; } intProcessSerialId += 1; commonAuditTrail.appendLog("system", strPageName, "MemberRegistrationNew", "DataBaseManager.DLL", strResultCode, strResultDetail, strErrorCode, strErrorDetail, strProcessRemark, Convert.ToString(intProcessSerialId), strProcessId, isSystemError); if (strAlertCode == "1") { string strRedirect = Request.QueryString.Get("redirect"); if (string.IsNullOrWhiteSpace(strRedirect)) { Response.Redirect("/_Secure/RegisterSuccess.aspx?lang=" + commonVariables.SelectedLanguage.ToLower(), false); } else { Response.Redirect(strRedirect, false); } } } } }
protected void btnSubmit_Click(object sender, EventArgs e) { string strAffiliateId = string.Empty; #region initialiseVariables int intProcessSerialId = 0; string strProcessId = Guid.NewGuid().ToString().ToUpper(); string strPageName = "Register"; string strProcessCode = string.Empty; string strResultCode = string.Empty; string strResultDetail = string.Empty; string strErrorCode = string.Empty; string strErrorDetail = string.Empty; string strProcessRemark = string.Empty; bool isProcessAbort = false; bool isSystemError = false; long lngOperatorId = 1; bool isTestAccount = false; string strMemberCode = string.Empty; string strPassword = string.Empty; string strPasswordEncrypted = string.Empty; string strEmail = string.Empty; string strContact = string.Empty; string strContactNumber = string.Empty; string strDOB = string.Empty; string strFName = string.Empty; string strLName = string.Empty; string strCurrencyCode = string.Empty; string strCountryCode = string.Empty; string strAccount = string.Empty; string strReferralId = string.Empty; string strLanguageCode = string.Empty; string strCommissionType = string.Empty; string strAddress = string.Empty; string strCity = string.Empty; string strPostal = string.Empty; string strUrl1 = string.Empty; string strUrl2 = string.Empty; string strUrl3 = string.Empty; string strDesc = string.Empty; string strIPAddress = string.Empty; string strSignUpUrl = string.Empty; string strVCode = string.Empty; string strSessionVCode = string.Empty; string strPermission = string.Empty; int intOddsType = 1; System.DateTime dtDOB = DateTime.MinValue; string strHiddenValues = hidValues.Value; List <string> lstValues = null; #endregion #region populateVariables strMemberCode = txtUsername.Text.Trim(); strPassword = txtPassword.Text; strEmail = txtEmail.Text; strContact = txtContact.Text; strContactNumber = string.Format("{0}-{1}", drpContactCountry.SelectedValue, strContact); strDOB = string.Format("{0}-{1}-{2}", drpYear.SelectedValue, drpMonth.SelectedValue, drpDay.SelectedValue); //strFName = System.Text.RegularExpressions.Regex.Replace(txtFirstName.Text, @"\t|\n|\r|", ""); //strLName = System.Text.RegularExpressions.Regex.Replace(txtLastName.Text, @"\t|\n|\r|", ""); strFName = System.Text.RegularExpressions.Regex.Replace(txtFullName.Text, @"\t|\n|\r|", ""); strCurrencyCode = drpCurrency.SelectedValue; strCountryCode = drpCountry.SelectedValue; strAccount = txtAccount.Text.Trim();; strReferralId = txtReferralID.Text.Trim(); strLanguageCode = drpLanguage.SelectedValue; strCommissionType = drpCommissionType.SelectedValue; strAddress = txtAddress.Text.Trim(); strCity = txtCity.Text.Trim(); strPostal = txtPostal.Text.Trim(); strUrl1 = txtURL1.Text.Trim(); strUrl2 = txtURL2.Text.Trim(); strUrl3 = txtURL3.Text.Trim(); strDesc = txtDesc.Text.Trim(); strVCode = txtCaptcha.Text; strSessionVCode = commonVariables.GetSessionVariable("vCode"); strAlertCode = "-1"; //strAffiliateId = txtAffiliateID.Text; System.Text.RegularExpressions.Regex rexContact = new System.Text.RegularExpressions.Regex("([0-9]{1,4})[-]([0-9]{6,12})$"); #endregion #region parametersValidation strResultCode = "11"; strResultDetail = "Error:ParameterValidation"; txtCaptcha.Text = string.Empty; if (string.IsNullOrEmpty(strMemberCode)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingUsername", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strPassword)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingPassword", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strEmail)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingEmail", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strContact)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingContact", xeErrors); isProcessAbort = true; } else if (!rexContact.IsMatch(strContactNumber)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidContact", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strFName)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingFName", xeErrors); isProcessAbort = true; } //else if (string.IsNullOrEmpty(strLName)) //{ // strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingLName", xeErrors); // isProcessAbort = true; //} else if (string.IsNullOrEmpty(strCurrencyCode) || string.Compare(strCurrencyCode, "-1", true) == 0) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingCurrency", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strCountryCode) || string.Compare(strCountryCode, "-1", true) == 0) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingCountryCode", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strLanguageCode) || string.Compare(strLanguageCode, "-1", true) == 0) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingLanguageCode", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strCommissionType) || string.Compare(strCommissionType, "-1", true) == 0) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingCommissionType", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strVCode)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/MissingVCode", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strMemberCode) || strMemberCode.IndexOf(' ') >= 0 || !commonValidation.isAlphanumeric(strMemberCode) || strMemberCode.Length < 5 || strMemberCode.Length > 16) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidUsername", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strPassword) || strPassword.Length < 8 || strPassword.Length > 10) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidPassword", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strEmail)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidEmail", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strContact)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidContact", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strCurrencyCode)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidCurrency", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strCountryCode)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidCountryCode", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strFName)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidFName", xeErrors); isProcessAbort = true; } //else if (commonValidation.isInjection(strLName)) //{ // strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidLName", xeErrors); // isProcessAbort = true; //} else if (commonValidation.isInjection(strAccount)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidAccount", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strReferralId)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidReferralId", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strLanguageCode)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidLanguageCode", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strCommissionType)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidCommissionType", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strAddress)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidAddress", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strCity)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidCity", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strPostal)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidPostal", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strUrl1)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidUrl1", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strUrl2)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidUrl2", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strUrl3)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidUrl3", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strDesc)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidDesc", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strVCode)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidVCode", xeErrors); isProcessAbort = true; } else if (!DateTime.TryParse(strDOB, out dtDOB)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidDOB", xeErrors); isProcessAbort = true; } //else if (!chkDisclaimer.Checked) //{ // strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/chkDisclaimer", xeErrors); // isProcessAbort = true; //} else if (string.Compare(commonEncryption.encrypting(strVCode), strSessionVCode, true) != 0) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/IncorrectVCode", xeErrors); isProcessAbort = true; } else { strResultCode = "00"; strResultDetail = "OK:ParameterValidation"; strContact = strContact.TrimStart('+'); strPasswordEncrypted = commonEncryption.Encrypt(strPassword); } strErrorDetail = strAlertMessage; strProcessRemark = string.Format("strAlertMessage: {0} | HiddenValues: {1}", strAlertMessage, strHiddenValues); intProcessSerialId += 1; commonAuditTrail.appendLog("system", strPageName, "ParameterValidation", "DataBaseManager.DLL", strResultCode, strResultDetail, strErrorCode, strErrorDetail, strProcessRemark, Convert.ToString(intProcessSerialId), strProcessId, isSystemError); #endregion if (!isProcessAbort) { lstValues = strHiddenValues.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries).Select(p => p.Trim()).ToList(); if (lstValues.Count > 0) { //if (lstValues[0] != null) { strCountryCode = lstValues[0]; } //if (lstValues[1] != null) { strSignUpUrl = string.Format("m.{0}", lstValues[1]); } if (lstValues[2] != null) { strIPAddress = lstValues[2]; } if (lstValues[3] != null) { strPermission = lstValues[3]; } } strSignUpUrl = string.Format("m.{0}", commonIp.DomainName); strLanguageCode = commonVariables.SelectedLanguage; if (string.IsNullOrEmpty(strIPAddress)) { strIPAddress = commonIp.UserIP; } if (string.IsNullOrEmpty(strCountryCode) || string.Compare(strCountryCode, "-", true) == 0) { using (wsIP2Loc.ServiceSoapClient wsInstance = new wsIP2Loc.ServiceSoapClient()) { wsInstance.location(strIPAddress, ref strCountryCode, ref strPermission); } } switch (strCountryCode.ToUpper()) { case "MY": case "TH": case "VN": case "KH": intOddsType = 1; break; case "CN": intOddsType = 2; break; case "IN": case "KR": case "JP": case "AU": intOddsType = 3; break; case "ID": intOddsType = 4; break; default: intOddsType = 3; break; } customConfig.OperatorSettings opSettings = new customConfig.OperatorSettings("W88"); if (opSettings.Values.Get("DemoDomains").IndexOf(commonIp.DomainName) >= 0) { isTestAccount = true; } int intAffiliateId = string.IsNullOrEmpty(commonVariables.GetSessionVariable("AffiliateId")) ? (string.IsNullOrEmpty(strAffiliateId) ? 0 : Convert.ToInt32(strAffiliateId)) : Convert.ToInt32(commonVariables.GetSessionVariable("AffiliateId")); string strReferBy = string.Empty; string strDeviceId = "Mobile"; long referralid = 0; try { referralid = long.Parse(strReferralId); } catch (Exception) { referralid = 0; } //System.Data.DataSet dsRegister = null; int result = 0; //using (wsMemberMS1.memberWSSoapClient svcInstance = new wsMemberMS1.memberWSSoapClient()) using (wsAffiliateMS1.affiliateWSSoapClient svcInstance = new wsAffiliateMS1.affiliateWSSoapClient()) { //dsRegister = svcInstance.MemberRegistrationNew(lngOperatorId, strMemberCode, strPasswordEncrypted, strEmail, strContactNumber, // strAddress, strCity, strPostal, strCountryCode, strCurrencyCode, strGender, intOddsType, strLanguageCode, // intAffiliateId, strReferBy, strIPAddress, strSignUpUrl, strDeviceId, isTestAccount, strFName, strLName, dtDOB, string.Empty); result = svcInstance.MemberRegistration(strMemberCode, strPasswordEncrypted, strFName, strEmail, strContactNumber, strCountryCode, strLanguageCode, strCurrencyCode, lngOperatorId, strAddress, strCity, strPostal, strIPAddress, strDesc, referralid, strUrl1, strUrl2, strUrl3, dtDOB, strAccount, strCommissionType, strSignUpUrl, (string)System.Configuration.ConfigurationManager.AppSettings.Get("internal_affiliate")); //strProcessRemark = string.Format("OperatorId: {0} | MemberCode: {1} | Password: {2} | Email: {3} | Contact: {4} | Address: {5} | City: {6} | Postal: {6} | Country: {8} | Currency: {9} | Gender: {10} | OddsType: {11} | Language: {12} | Affiliate: {13} | ReferBy: {14} | IP: {15} | SignUpUrl: {16} | DeviceID: {17} | TestAccount: {18} | FName: {19} | LName: {20} | DOB: {21} | REMOTEIP: {22} | FORWARDEDIP: {23} | REQUESTERIP: {24} | AffiliateID: {25}", // lngOperatorId, strMemberCode, strPasswordEncrypted, strEmail, strContact, strAddress, strCity, strPostal, strCountryCode, strCurrencyCode, strGender, intOddsType, strLanguageCode, intAffiliateId, strReferBy, strIPAddress, strSignUpUrl, strDeviceId, isTestAccount, strFName, strLName, dtDOB, commonIp.remoteIP, commonIp.forwardedIP, commonIp.requesterIP, intAffiliateId); strProcessRemark = "exec spAffiliateMemberInsertWS " + "'" + strMemberCode + "'" + ",'" + strPasswordEncrypted + "'" + ",'" + strFName + "'" + ",'" + strEmail + "'" + ",'" + strContactNumber + "'" + ",'" + strCountryCode + "'" + ",'" + strLanguageCode + "'" + ",'" + strCurrencyCode + "'" + ",'" + lngOperatorId + "'" + ",'" + strAddress + "'" + ",'" + strCity + "'" + ",'" + strPostal + "'" + ",'" + strIPAddress + "'" + ",'" + strDesc + "'" + ",'" + referralid + "'" + ",'" + strUrl1 + "'" + ",'" + strUrl2 + "'" + ",'" + strUrl3 + "'" + ",'" + dtDOB + "'" + ",'" + strAccount + "'" + ",'" + strCommissionType + "'" + ",'" + strSignUpUrl + "'" + ",'" + (string)System.Configuration.ConfigurationManager.AppSettings.Get("internal_affiliate") + "'"; intProcessSerialId += 1; commonAuditTrail.appendLog("system", strPageName, "RegistrationParameterValidation", "DataBaseManager.DLL", strResultCode, strResultDetail, strErrorCode, strErrorDetail, strProcessRemark, Convert.ToString(intProcessSerialId), strProcessId, isSystemError); strResultCode = "21"; strResultDetail = "Error:MemberRegistrationNew"; //if (dsRegister.Tables[0].Rows.Count > 0) //{ // strProcessCode = Convert.ToString(dsRegister.Tables[0].Rows[0]["RETURN_VALUE"]); //switch (strProcessCode) switch (result.ToString()) { case "0": strAlertMessage = commonCulture.ElementValues.getResourceString("Exception", xeErrors); break; case "1": strAlertCode = "1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/Success", xeErrors); //string strMemberSessionId = Convert.ToString(dsRegister.Tables[0].Rows[0]["memberSessionId"]); //HttpContext.Current.Session.Add("MemberSessionId", Convert.ToString(dsRegister.Tables[0].Rows[0]["memberSessionId"])); //HttpContext.Current.Session.Add("MemberId", Convert.ToString(dsRegister.Tables[0].Rows[0]["memberId"])); //HttpContext.Current.Session.Add("MemberCode", Convert.ToString(dsRegister.Tables[0].Rows[0]["memberCode"])); //HttpContext.Current.Session.Add("CountryCode", Convert.ToString(dsRegister.Tables[0].Rows[0]["countryCode"])); //HttpContext.Current.Session.Add("CurrencyCode", Convert.ToString(dsRegister.Tables[0].Rows[0]["currency"])); //HttpContext.Current.Session.Add("LanguageCode", Convert.ToString(dsRegister.Tables[0].Rows[0]["languageCode"])); //HttpContext.Current.Session.Add("RiskId", Convert.ToString(dsRegister.Tables[0].Rows[0]["riskId"])); ////HttpContext.Current.Session.Add("PaymentGroup", "A"); //Convert.ToString(dsSignin.Tables[0].Rows[0]["paymentGroup"])); //HttpContext.Current.Session.Add("PartialSignup", Convert.ToString(dsRegister.Tables[0].Rows[0]["partialSignup"])); //HttpContext.Current.Session.Add("ResetPassword", Convert.ToString(dsRegister.Tables[0].Rows[0]["resetPassword"])); //commonCookie.CookieS = strMemberSessionId; //commonCookie.CookieG = strMemberSessionId; //HttpContext.Current.Session.Add("LoginStatus", "success"); //strResultCode = "00"; //strResultDetail = "OK:MemberRegistrationNew"; //#region IOVATION //this.IovationSubmit(ref intProcessSerialId, strProcessId, strPageName, strMemberCode, strIPAddress, strPermission); //#endregion break; case "10": strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/DuplicateUsername", xeErrors); break; case "11": strAlertMessage = commonCulture.ElementValues.getResourceXPathString("Register/DuplicateEmail", xeErrors); break; default: strAlertMessage = commonCulture.ElementValues.getResourceString("Exception", xeErrors); break; } strErrorCode = strProcessCode; strErrorDetail = strAlertMessage; } intProcessSerialId += 1; commonAuditTrail.appendLog("system", strPageName, "MemberRegistrationNew", "DataBaseManager.DLL", strResultCode, strResultDetail, strErrorCode, strErrorDetail, strProcessRemark, Convert.ToString(intProcessSerialId), strProcessId, isSystemError); } }
protected void Page_Load(object sender, EventArgs e) { string strOperatorId = commonVariables.OperatorId; string strAffiliateId = string.Empty; xeErrors = commonVariables.ErrorsXML; System.Xml.Linq.XElement xeResources = null; commonCulture.appData.getLocalResource(out xeResources); customConfig.OperatorSettings opSettings = new customConfig.OperatorSettings("W88"); if (!Page.IsPostBack) { //if (string.IsNullOrEmpty(commonVariables.GetSessionVariable("AffiliateId"))) { if (string.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("AffiliateId"))) { commonVariables.SetSessionVariable("AffiliateId", HttpContext.Current.Request.QueryString.Get("AffiliateId")); } } //strAffiliateId = string.IsNullOrEmpty(commonVariables.GetSessionVariable("AffiliateId")) ? string.Empty : Convert.ToString(commonVariables.GetSessionVariable("AffiliateId")); lblUsername.Text = commonCulture.ElementValues.getResourceString("lblUsername", xeResources); txtUsername.Attributes.Add("PLACEHOLDER", lblUsername.Text); lblPassword.Text = commonCulture.ElementValues.getResourceString("lblPassword", xeResources); txtPassword.Attributes.Add("PLACEHOLDER", lblPassword.Text); lblEmail.Text = commonCulture.ElementValues.getResourceString("lblEmailAddress", xeResources); txtEmail.Attributes.Add("PLACEHOLDER", lblEmail.Text); lblDOB.Text = commonCulture.ElementValues.getResourceString("lblDOB", xeResources); lblContact.Text = commonCulture.ElementValues.getResourceString("lblContact", xeResources); txtContact.Attributes.Add("PLACEHOLDER", lblContact.Text); //lblFirstName.Text = commonCulture.ElementValues.getResourceString("lblFirstName", xeResources); //txtFirstName.Attributes.Add("PLACEHOLDER", lblFirstName.Text); //lblLastName.Text = commonCulture.ElementValues.getResourceString("lblLastName", xeResources); //txtLastName.Attributes.Add("PLACEHOLDER", lblLastName.Text); lblFullName.Text = commonCulture.ElementValues.getResourceString("lblFullName", xeResources); txtFullName.Attributes.Add("PLACEHOLDER", lblFullName.Text); lblAccount.Text = commonCulture.ElementValues.getResourceString("lblAccount", xeResources); txtAccount.Attributes.Add("PLACEHOLDER", lblAccount.Text); lblReferralID.Text = commonCulture.ElementValues.getResourceString("lblReferralID", xeResources); txtReferralID.Attributes.Add("PLACEHOLDER", lblReferralID.Text); lblAddress.Text = commonCulture.ElementValues.getResourceString("lblAddress", xeResources); txtAddress.Attributes.Add("PLACEHOLDER", lblAddress.Text); lblCity.Text = commonCulture.ElementValues.getResourceString("lblCity", xeResources); txtCity.Attributes.Add("PLACEHOLDER", lblCity.Text); lblPostal.Text = commonCulture.ElementValues.getResourceString("lblPostal", xeResources); txtPostal.Attributes.Add("PLACEHOLDER", lblPostal.Text); lblWebsiteUrl.Text = commonCulture.ElementValues.getResourceString("lblWebsiteUrl", xeResources); lblURL1.Text = commonCulture.ElementValues.getResourceString("lblURL1", xeResources); txtURL1.Attributes.Add("PLACEHOLDER", lblURL1.Text); lblURL2.Text = commonCulture.ElementValues.getResourceString("lblURL2", xeResources); txtURL2.Attributes.Add("PLACEHOLDER", lblURL2.Text); lblURL3.Text = commonCulture.ElementValues.getResourceString("lblURL3", xeResources); txtURL3.Attributes.Add("PLACEHOLDER", lblURL3.Text); lblDesc.Text = commonCulture.ElementValues.getResourceString("lblDesc", xeResources); txtDesc.Attributes.Add("PLACEHOLDER", lblDesc.Text); lblCaptcha.Text = commonCulture.ElementValues.getResourceString("lblCaptcha", xeResources); txtCaptcha.Attributes.Add("PLACEHOLDER", lblCaptcha.Text); lblDisclaimer.InnerText = commonCulture.ElementValues.getResourceString("lblDisclaimer", xeResources); btnSubmit.Text = commonCulture.ElementValues.getResourceString("btnSubmit", xeResources); btnCancel.InnerText = commonCulture.ElementValues.getResourceString("btnCancel", xeResources); #region PhoneCountryCode System.Data.DataSet dsCountryInfo = null; using (wsMemberMS1.memberWSSoapClient wsInstance = new wsMemberMS1.memberWSSoapClient()) { dsCountryInfo = wsInstance.GetCountryInfo(Convert.ToInt64(strOperatorId)); if (dsCountryInfo.Tables[0].Rows.Count > 0) { foreach (System.Data.DataRow drPhoneCountryCode in dsCountryInfo.Tables[0].Select("", "countryPhoneCode ASC")) { string strProcessRemark = "Register: GetCountryInfo" + strOperatorId; int intProcessSerialId = 0; intProcessSerialId += 1; commonAuditTrail.appendLog("system", "Register", "ParameterValidation", "DataBaseManager.DLL", "", "", "", "", strProcessRemark, Convert.ToString(intProcessSerialId), "", true); drpContactCountry.Items.Add(new ListItem(string.Format("+ {0}", Convert.ToString(drPhoneCountryCode["countryPhoneCode"])), Convert.ToString(drPhoneCountryCode["countryPhoneCode"]))); } } } #endregion #region Currencies string arrStrCurrencies = opSettings.Values.Get("Currencies"); List <string> lstCurrencies = arrStrCurrencies.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries).Select(p => p.Trim()).ToList(); drpCurrency.Items.Insert(0, new ListItem(commonCulture.ElementValues.getResourceString("drpCurrencySelect", xeResources), "-1")); foreach (string currency in lstCurrencies) { string strProcessRemark = "currency: " + currency; int intProcessSerialId = 0; intProcessSerialId += 1; commonAuditTrail.appendLog("system", "Register", "ParameterValidation", "DataBaseManager.DLL", "", "", "", "", strProcessRemark, Convert.ToString(intProcessSerialId), "", true); drpCurrency.Items.Add(new ListItem(commonCulture.ElementValues.getResourceXPathString("Currency/" + currency, xeResources), currency)); } #endregion #region Country using (wsAffiliateMS1.affiliateWSSoapClient wsInstanceAff = new wsAffiliateMS1.affiliateWSSoapClient("affiliateWSSoap")) { System.Data.DataSet ds_country = wsInstanceAff.GetCountryList(); if (ds_country.Tables[0].Rows.Count > 0) { drpCountry.DataTextField = "countryName"; drpCountry.DataValueField = "countryCode"; drpCountry.DataSource = ds_country.Tables[0]; drpCountry.DataBind(); drpCountry.Items.Insert(0, new ListItem(commonCulture.ElementValues.getResourceString("drpCountrySelect", xeResources), "-1")); } } #endregion #region Language string[] langcodes = System.Configuration.ConfigurationManager.AppSettings.Get("list_language_code").Split(','); string[] langNames = System.Configuration.ConfigurationManager.AppSettings.Get("list_language_translation").Split(','); drpLanguage.Items.Insert(0, new ListItem(commonCulture.ElementValues.getResourceString("drpLanguageSelect", xeResources), "-1")); for (int i = 0; i < langcodes.Length; i++) { drpLanguage.Items.Add(new ListItem(langNames[i], langcodes[i])); } #endregion #region Commission Type drpCommissionType.Items.Insert(0, new ListItem(commonCulture.ElementValues.getResourceString("lblCommissionType", xeResources), "-1")); drpCommissionType.Items.Add(new ListItem(commonCulture.ElementValues.getResourceString("lblRevenueShare", xeResources).ToString(), "Revenue Share")); #endregion //drpDOB.Items.Add(new ListItem(commonCulture.ElementValues.getResourceString("lblDOB", xeResources), string.Empty, true)); int intDay = 0; foreach (int vintDay in new int[31]) { intDay++; drpDay.Items.Add(new ListItem((intDay).ToString("0#"), Convert.ToString(intDay))); } foreach (System.Xml.Linq.XElement xeMonth in xeResources.Element("Calendar").Elements()) { drpMonth.Items.Add(new ListItem(xeMonth.Value, Convert.ToString(xeMonth.Name).Replace("m", ""))); } for (int intYear = System.DateTime.Now.Year - 18; intYear >= System.DateTime.Now.Year - 99; intYear--) { drpYear.Items.Add(new ListItem(Convert.ToString(intYear))); } //txtAffiliateID.Text = strAffiliateId; } }