private string CheckMemberSession(int signInreturnValue) { string returnMsg = string.Empty; using (var svcInstance = new wsMemberMS1.memberWSSoapClient()) { DataSet dsMember = svcInstance.MemberSessionCheck(commonVariables.CurrentMemberSessionId, commonIp.UserIP); if (dsMember.Tables[0].Rows.Count > 0) { switch (signInreturnValue) { case 0: returnMsg = commonCulture.ElementValues.getResourceString("Exception", _loginInfo.XeErrors); break; case 1: HttpContext.Current.Session.Add("MemberName", Convert.ToString(dsMember.Tables[0].Rows[0]["lastName"]) + Convert.ToString(dsMember.Tables[0].Rows[0]["firstName"])); break; } } } return(returnMsg); }
public DataTable FetchMemberData(string memberSessionId = null, string password = null) { var response = new DataTable(); try { using (var svcInstance = new wsMemberMS1.memberWSSoapClient()) { var id = memberSessionId ?? commonVariables.CurrentMemberSessionId; var dsMember = svcInstance.MemberSessionCheck(id, commonIp.UserIP); if (dsMember != null) { if (dsMember.Tables[0].Rows.Count > 0) { response = dsMember.Tables[0]; } } return(response); } } catch (Exception) { return(response); } }
protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request["dateFrom"]) && !string.IsNullOrEmpty(Request["dateTo"]) && !string.IsNullOrEmpty(commonVariables.GetSessionVariable("MemberId"))) { //Request Params var dateFrom = DateTime.Parse(Request["dateFrom"].ToString()); var dateTo = DateTime.Parse(Request["dateTo"].ToString()); //Other Params var strMemberId = long.Parse(commonVariables.GetSessionVariable("MemberId")); try { using (var svcInstance = new wsMemberMS1.memberWSSoapClient()) { DataSet history = svcInstance.MemberReferralHistory(strMemberId, dateFrom, dateTo); lblInvitees.Text = string.Format(": {0}", history.Tables[0].Rows[0]["totInvitees"].ToString()); lblRegistered.Text = string.Format(": {0}", history.Tables[0].Rows[0]["totRegistered"].ToString()); lblSuccessfulReferrals.Text = string.Format(": {0}", history.Tables[0].Rows[0]["totSuccessful"].ToString()); lblTotalReferralBonus.Text = string.Format(": {0}", history.Tables[0].Rows[0]["totBonus"].ToString()); GridView1.DataSource = history.Tables[1]; GridView1.PagerSettings.Mode = PagerButtons.NextPrevious; GridView1.EmptyDataText = commonCulture.ElementValues.getResourceXPathString("norecords", commonVariables.HistoryXML); GridView1.Columns[1].HeaderText = commonCulture.ElementValues.getResourceXPathString("dateTime", commonVariables.HistoryXML); GridView1.Columns[2].HeaderText = commonCulture.ElementValues.getResourceXPathString("transId", commonVariables.HistoryXML); GridView1.Columns[3].HeaderText = commonCulture.ElementValues.getResourceXPathString("amount", commonVariables.HistoryXML); GridView1.Columns[4].HeaderText = commonCulture.ElementValues.getResourceXPathString("lblStatus", commonVariables.HistoryXML); GridView1.DataBind(); } } catch (Exception ex) { Console.Out.Write("ex: " + ex); } } else { Response.Redirect((string)HttpContext.Current.Session["domain_Account"] + "/History"); } }
protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request["dateFrom"]) && !string.IsNullOrEmpty(Request["dateTo"]) && !string.IsNullOrEmpty(commonVariables.OperatorId) && !string.IsNullOrEmpty(commonVariables.GetSessionVariable("MemberId"))) { //Request Params var dateFrom = DateTime.Parse(Request["dateFrom"].ToString()); var dateTo = DateTime.Parse(Request["dateTo"].ToString()); //Other Params var strOperatorId = int.Parse(commonVariables.OperatorId); var strMemberId = long.Parse(commonVariables.GetSessionVariable("MemberId")); try { using (var svcInstance = new wsMemberMS1.memberWSSoapClient()) { string statusCode; DataSet history = svcInstance.MemberPromotionRegistrationHistory(strOperatorId, strMemberId, dateFrom, dateTo); GridView1.DataSource = history; GridView1.PagerSettings.Mode = PagerButtons.NextPrevious; GridView1.EmptyDataText = commonCulture.ElementValues.getResourceXPathString("norecords", commonVariables.HistoryXML); GridView1.Columns[1].HeaderText = commonCulture.ElementValues.getResourceXPathString("dateTime", commonVariables.HistoryXML); GridView1.Columns[2].HeaderText = commonCulture.ElementValues.getResourceXPathString("subjectCode", commonVariables.HistoryXML); GridView1.DataBind(); } } catch (Exception ex) { Console.Out.Write("ex: " + ex); } } else { Response.Redirect((string)HttpContext.Current.Session["domain_Account"] + "/History"); } }
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 btnSubmit_Click(object sender, EventArgs e) { #region Variable Initialization int intProcessSerialId = 0; string strProcessId = Guid.NewGuid().ToString().ToUpper(); string strPageName = "UpdatePassword"; 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; string strMemberMS1Id = string.Empty; string strPassword = string.Empty; string strPasswordEncrypted = string.Empty; string strPasswordNew = string.Empty; string strPasswordNewEncrypted = string.Empty; string strPasswordConfirm = string.Empty; int intResult = int.MinValue; #endregion #region populateVariables strAlertCode = "-1"; strMemberMS1Id = commonVariables.GetSessionVariable("MemberId"); strPassword = txtPassword.Text; strPasswordNew = txtPasswordNew.Text; strPasswordConfirm = txtPasswordConfirm.Text; #endregion #region parametersValidation if (string.IsNullOrEmpty(commonVariables.CurrentMemberSessionId)) { strAlertMessage = commonCulture.ElementValues.getResourceString("SessionExpired", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strPassword)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdatePassword/MissingPassword", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strPasswordNew)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString( "UpdatePassword/MissingPasswordNew", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strPasswordConfirm)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdatePassword/MissingPasswordConfirm", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strPassword)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdatePassword/InvalidPassword", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strPasswordNew) || strPasswordNew.Length < 8 || strPasswordNew.Length > 10) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdatePassword/InvalidPassword", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strPasswordConfirm) || strPasswordConfirm.Length < 8 || strPasswordConfirm.Length > 10) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdatePassword/InvalidPassword", xeErrors); isProcessAbort = true; } else if (string.Compare(strPasswordNew, strPasswordConfirm, true) != 0) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString( "UpdatePassword/UnmatchedPassword", xeErrors); isProcessAbort = true; } else { strPasswordEncrypted = commonEncryption.Encrypt(strPassword); strPasswordNewEncrypted = commonEncryption.Encrypt(strPasswordNew); } #endregion if (!isProcessAbort) { try { using (wsMemberMS1.memberWSSoapClient wsInstance = new wsMemberMS1.memberWSSoapClient()) { intResult = wsInstance.MemberChangePassword(Convert.ToInt64(strMemberMS1Id), strPasswordEncrypted, strPasswordNewEncrypted); strProcessRemark = string.Format( "OperatorId: {0} | MemberId: {1} | Password: {2} | PasswordNew: {3} | REMOTEIP: {4} | FORWARDEDIP: {5} | REQUESTERIP: {6}", lngOperatorId, strMemberMS1Id, strPasswordEncrypted, strPasswordNewEncrypted, commonIp.remoteIP, commonIp.forwardedIP, commonIp.requesterIP); intProcessSerialId += 1; commonAuditTrail.appendLog("system", strPageName, "UpdatePassword", "DataBaseManager.DLL", strResultCode, strResultDetail, strErrorCode, strErrorDetail, strProcessRemark, Convert.ToString(intProcessSerialId), strProcessId, isSystemError); } } catch (Exception) { } switch (intResult) { case 1: // success strAlertCode = "1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdatePassword/Success", xeErrors); break; case 10: // invalid password strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdatePassword/InvalidPassword", xeErrors); break; case 11: // wrong password strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdatePassword/IncorrectPassword", xeErrors); break; default: // general error strAlertMessage = commonCulture.ElementValues.getResourceString("Exception", xeErrors); break; } } }
protected void Page_Load(object sender, EventArgs e) { xeErrors = commonVariables.ErrorsXML; System.Xml.Linq.XElement xeResources = null; commonCulture.appData.getRootResource("/_Secure/UpdatePassword", out xeResources); System.Data.DataSet dsMemberProfile = null; string strOperatorId = string.Empty; string strMemberId = string.Empty; #region UneditableFieldsVariablesInitialise string strMemberCode = string.Empty; string strCurrencyCode = string.Empty; string strEmail = string.Empty; string strContact = 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"); lblPassword.Text = commonCulture.ElementValues.getResourceString("lblPassword", xeResources); lblPasswordNew.Text = commonCulture.ElementValues.getResourceString("lblPasswordNew", xeResources); lblPasswordConfirm.Text = commonCulture.ElementValues.getResourceString("lblPasswordConfirm", 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 strEmail = Convert.ToString(dsMemberProfile.Tables[0].Rows[0]["email"]); strContact = Convert.ToString(dsMemberProfile.Tables[0].Rows[0]["mobile"]); strMemberCode = Convert.ToString(dsMemberProfile.Tables[0].Rows[0]["memberCode"]); strCurrencyCode = Convert.ToString(dsMemberProfile.Tables[0].Rows[0]["currencyCode"]); #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 txtEmail.Text = strEmail; txtUserName.Text = strMemberCode; txtContact.Text = strContact; txtCurrency.Text = commonCulture.ElementValues.getResourceXPathString("Currency/" + strCurrencyCode, xeResources); } } } } }
protected void Page_Load(object sender, EventArgs e) { System.Xml.Linq.XElement xeErrors = commonVariables.ErrorsXML; #region initialiseVariables int intProcessSerialId = 0; string strProcessId = Guid.NewGuid().ToString().ToUpper(); string strPageName = "ProcessLogin"; 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; string strProcessCode = string.Empty; string strProcessMessage = string.Empty; string strLastLoginIP = string.Empty; bool runIovation = false; System.Xml.XmlDocument xdResponse = new System.Xml.XmlDocument(); #endregion #region populateVariables var lngOperatorId = long.Parse(commonVariables.OperatorId); var strMemberCode = Request.Form.Get("txtUsername"); var strPassword = Request.Form.Get("txtPassword"); var strSiteURL = commonVariables.SiteUrl; var strDeviceId = HttpContext.Current.Request.UserAgent; var strVCode = Request.Form.Get("txtCaptcha"); var strSessionVCode = commonEncryption.decrypting(commonVariables.GetSessionVariable("vCode")); #endregion #region parametersValidation if (string.IsNullOrEmpty(strMemberCode)) { strProcessCode = "-1"; strProcessMessage = commonCulture.ElementValues.getResourceXPathString("Login/MissingUsername", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strPassword)) { strProcessCode = "-1"; strProcessMessage = commonCulture.ElementValues.getResourceXPathString("Login/MissingPassword", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strMemberCode)) { strProcessCode = "-1"; strProcessMessage = commonCulture.ElementValues.getResourceXPathString("Login/InvalidUsername", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strPassword)) { strProcessCode = "-1"; strProcessMessage = commonCulture.ElementValues.getResourceXPathString("Login/InvalidPassword", xeErrors); isProcessAbort = true; } else if (!string.IsNullOrEmpty(strVCode) && !string.IsNullOrEmpty(strSessionVCode)) { if (string.IsNullOrEmpty(strVCode)) { strProcessCode = "-1"; strProcessMessage = commonCulture.ElementValues.getResourceString("MissingVCode", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strVCode)) { strProcessCode = "-1"; strProcessMessage = commonCulture.ElementValues.getResourceXPathString("Register/InvalidVCode", xeErrors); isProcessAbort = true; } if (strVCode != strSessionVCode) { strProcessCode = "-1"; strProcessMessage = commonCulture.ElementValues.getResourceXPathString("Register/IncorrectVCode", xeErrors); isProcessAbort = true; } } else { strPassword = commonEncryption.Encrypt(strPassword); } strProcessRemark = string.Format("MemberCode: {0} | Password: {1} | VCode: {2} | SVCode: {3} | IP: {4} ", strMemberCode, strPassword, strVCode, strSessionVCode, commonIp.UserIP); intProcessSerialId += 1; commonAuditTrail.appendLog("system", strPageName, "ParameterValidation", "DataBaseManager.DLL", strResultCode, strResultDetail, strErrorCode, strErrorDetail, strProcessRemark, Convert.ToString(intProcessSerialId), strProcessId, isSystemError); #endregion #region initiateLogin if (!isProcessAbort) { try { using (wsMemberMS1.memberWSSoapClient svcInstance = new wsMemberMS1.memberWSSoapClient()) { System.Data.DataSet dsSignin = null; dsSignin = svcInstance.MemberSignin(lngOperatorId, strMemberCode, strPassword, strSiteURL, commonIp.UserIP, strDeviceId); if (dsSignin.Tables[0].Rows.Count > 0) { strProcessCode = Convert.ToString(dsSignin.Tables[0].Rows[0]["RETURN_VALUE"]); switch (strProcessCode) { case "0": strProcessMessage = commonCulture.ElementValues.getResourceString("Exception", xeErrors); break; case "1": string strMemberSessionId = Convert.ToString(dsSignin.Tables[0].Rows[0]["memberSessionId"]); HttpContext.Current.Session.Add("MemberSessionId", Convert.ToString(dsSignin.Tables[0].Rows[0]["memberSessionId"])); HttpContext.Current.Session.Add("MemberId", Convert.ToString(dsSignin.Tables[0].Rows[0]["memberId"])); HttpContext.Current.Session.Add("MemberCode", Convert.ToString(dsSignin.Tables[0].Rows[0]["memberCode"])); HttpContext.Current.Session.Add("CountryCode", Convert.ToString(dsSignin.Tables[0].Rows[0]["countryCode"])); HttpContext.Current.Session.Add("CurrencyCode", Convert.ToString(dsSignin.Tables[0].Rows[0]["currency"])); HttpContext.Current.Session.Add("LanguageCode", Convert.ToString(dsSignin.Tables[0].Rows[0]["languageCode"])); HttpContext.Current.Session.Add("RiskId", Convert.ToString(dsSignin.Tables[0].Rows[0]["riskId"])); HttpContext.Current.Session.Add("PaymentGroup", Convert.ToString(dsSignin.Tables[0].Rows[0]["paymentGroup"])); HttpContext.Current.Session.Add("PartialSignup", Convert.ToString(dsSignin.Tables[0].Rows[0]["partialSignup"])); HttpContext.Current.Session.Add("ResetPassword", Convert.ToString(dsSignin.Tables[0].Rows[0]["resetPassword"])); commonCookie.CookieS = strMemberSessionId; commonCookie.CookieG = strMemberSessionId; commonCookie.CookiePalazzo = strPassword; bool isResetPassword = Convert.ToBoolean(string.IsNullOrWhiteSpace(Session["ResetPassword"] as string) ? 0 : Session["ResetPassword"]); if (isResetPassword) { strProcessCode = "resetPassword"; } strLastLoginIP = Convert.ToString(dsSignin.Tables[0].Rows[0]["lastLoginIP"]); if (HttpContext.Current.Request.Cookies[strMemberCode] == null) { runIovation = true; } else if (HttpContext.Current.Request.Cookies[strMemberCode] != null && string.Compare(strLastLoginIP, commonIp.UserIP, true) != 0) { runIovation = true; } if (runIovation) { this.IovationSubmit(ref intProcessSerialId, strProcessId, strPageName, strMemberCode, commonIp.UserIP); } DataSet dsMember = svcInstance.MemberSessionCheck(commonVariables.CurrentMemberSessionId, commonIp.UserIP); if (dsMember.Tables[0].Rows.Count > 0) { strProcessCode = Convert.ToString(dsSignin.Tables[0].Rows[0]["RETURN_VALUE"]); switch (strProcessCode) { case "0": strProcessMessage = commonCulture.ElementValues.getResourceString("Exception", xeErrors);; break; case "1": HttpContext.Current.Session.Add("MemberName", Convert.ToString(dsMember.Tables[0].Rows[0]["lastName"]) + Convert.ToString(dsMember.Tables[0].Rows[0]["firstName"])); break; } } break; case "21": strProcessMessage = commonCulture.ElementValues.getResourceXPathString("Login/InvalidUsername", xeErrors); break; case "22": strProcessMessage = commonCulture.ElementValues.getResourceXPathString("Login/InactiveAccount", xeErrors); break; case "23": strProcessMessage = commonCulture.ElementValues.getResourceXPathString("Login/InvalidPassword", xeErrors); break; } } } } catch (Exception ex) { strProcessCode = "0"; strProcessMessage = commonCulture.ElementValues.getResourceString("Exception", xeErrors); strProcessRemark = string.Format("{0} | Message: {1}", strProcessRemark, ex.Message); } strProcessRemark = string.Format("{0} | strProcessCode: {1}", strProcessRemark, strProcessCode); intProcessSerialId += 1; commonAuditTrail.appendLog("system", strPageName, "MemberSignin", "DataBaseManager.DLL", strResultCode, strResultDetail, strErrorCode, strErrorDetail, strProcessRemark, Convert.ToString(intProcessSerialId), strProcessId, isSystemError); } #endregion #region Response System.Xml.XmlNode xnRootNode = xdResponse.CreateElement("Login"); System.Xml.XmlNode xnCodeNode = xdResponse.CreateElement("ErrorCode"); System.Xml.XmlNode xnMessageNode = xdResponse.CreateElement("Message"); xnCodeNode.InnerText = strProcessCode; xnMessageNode.InnerText = strProcessMessage; xnRootNode.AppendChild(xnCodeNode); xnRootNode.AppendChild(xnMessageNode); xdResponse.AppendChild(xnRootNode); Response.ContentType = "text/xml"; Response.Write(xdResponse.DocumentElement.OuterXml); Response.End(); #endregion }
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; } }
protected void btnSubmit_Click(object sender, EventArgs e) { #region initialiseVariables int intProcessSerialId = 0; string strProcessId = Guid.NewGuid().ToString().ToUpper(); string strPageName = "ProcessLogin"; 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 = long.MinValue; string strMemberCode = string.Empty; string strPassword = string.Empty; string strSiteURL = string.Empty; string strLoginIp = string.Empty; string strDeviceId = string.Empty; string strVCode = string.Empty; string strSVCode = string.Empty; //string strProcessCode = string.Empty; //string strProcessMessage = string.Empty; string strCountryCode = string.Empty; string strLastLoginIP = string.Empty; string strPermission = string.Empty; bool runIovation = false; System.Xml.XmlDocument xdResponse = new System.Xml.XmlDocument(); #endregion #region populateVariables lngOperatorId = long.Parse(commonVariables.OperatorId); strMemberCode = txtUsername.Value; strPassword = txtPassword.Value; strVCode = txtCaptcha.Value; strSVCode = commonVariables.GetSessionVariable("vCode"); strLoginIp = string.IsNullOrEmpty(Request.Form.Get("txtIPAddress")) ? commonIp.UserIP : Request.Form.Get("txtIPAddress"); strDeviceId = HttpContext.Current.Request.UserAgent; strSiteURL = commonVariables.SiteUrl; #endregion #region parametersValidation if (string.IsNullOrEmpty(strMemberCode)) { strProcessCode = "-1"; strProcessMessage = commonCulture.ElementValues.getResourceXPathString("Login/MissingUsername", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strPassword)) { strProcessCode = "-1"; strProcessMessage = commonCulture.ElementValues.getResourceXPathString("Login/MissingPassword", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strVCode)) { strProcessCode = "-1"; strProcessMessage = commonCulture.ElementValues.getResourceString("MissingVCode", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strMemberCode)) { strProcessCode = "-1"; strProcessMessage = commonCulture.ElementValues.getResourceXPathString("Login/InvalidUsername", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strPassword)) { strProcessCode = "-1"; strProcessMessage = commonCulture.ElementValues.getResourceXPathString("Login/InvalidPassword", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strVCode)) { strProcessCode = "-1"; strProcessMessage = commonCulture.ElementValues.getResourceString("IncorrectVCode", xeErrors); isProcessAbort = true; } else if (string.Compare(commonEncryption.encrypting(strVCode), strSVCode, true) != 0) { strProcessCode = "-1"; strProcessMessage = commonCulture.ElementValues.getResourceString("IncorrectVCode", xeErrors); isProcessAbort = true; } else { strPassword = commonEncryption.Encrypt(strPassword); } strProcessRemark = string.Format("MemberCode: {0} | Password: {1} | VCode: {2} | SVCode: {3} | IP: {4} | Country: {5}", strMemberCode, strPassword, strVCode, strSVCode, strLoginIp, strCountryCode); intProcessSerialId += 1; commonAuditTrail.appendLog("system", strPageName, "ParameterValidation", "DataBaseManager.DLL", strResultCode, strResultDetail, strErrorCode, strErrorDetail, strProcessRemark, Convert.ToString(intProcessSerialId), strProcessId, isSystemError); #endregion #region initiateLogin if (!isProcessAbort) { try { using (wsMemberMS1.memberWSSoapClient svcInstance = new wsMemberMS1.memberWSSoapClient()) { System.Data.DataSet dsSignin = null; dsSignin = svcInstance.MemberSignin(lngOperatorId, strMemberCode, strPassword, strSiteURL, strLoginIp, strDeviceId); if (dsSignin.Tables[0].Rows.Count > 0) { strProcessCode = Convert.ToString(dsSignin.Tables[0].Rows[0]["RETURN_VALUE"]); switch (strProcessCode) { case "0": strProcessMessage = commonCulture.ElementValues.getResourceString("Exception", xeErrors); break; case "1": string strMemberSessionId = Convert.ToString(dsSignin.Tables[0].Rows[0]["memberSessionId"]); HttpContext.Current.Session.Add("MemberSessionId", Convert.ToString(dsSignin.Tables[0].Rows[0]["memberSessionId"])); HttpContext.Current.Session.Add("MemberId", Convert.ToString(dsSignin.Tables[0].Rows[0]["memberId"])); HttpContext.Current.Session.Add("MemberCode", Convert.ToString(dsSignin.Tables[0].Rows[0]["memberCode"])); HttpContext.Current.Session.Add("CountryCode", Convert.ToString(dsSignin.Tables[0].Rows[0]["countryCode"])); HttpContext.Current.Session.Add("CurrencyCode", Convert.ToString(dsSignin.Tables[0].Rows[0]["currency"])); HttpContext.Current.Session.Add("LanguageCode", Convert.ToString(dsSignin.Tables[0].Rows[0]["languageCode"])); HttpContext.Current.Session.Add("RiskId", Convert.ToString(dsSignin.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(dsSignin.Tables[0].Rows[0]["partialSignup"])); HttpContext.Current.Session.Add("ResetPassword", Convert.ToString(dsSignin.Tables[0].Rows[0]["resetPassword"])); commonCookie.CookieS = strMemberSessionId; commonCookie.CookieG = strMemberSessionId; HttpContext.Current.Session.Add("LoginStatus", "success"); strLastLoginIP = Convert.ToString(dsSignin.Tables[0].Rows[0]["lastLoginIP"]); if (HttpContext.Current.Request.Cookies[strMemberCode] == null) { runIovation = true; } else if (HttpContext.Current.Request.Cookies[strMemberCode] != null && string.Compare(strLastLoginIP, strLoginIp, true) != 0) { runIovation = true; } if (runIovation) { this.IovationSubmit(ref intProcessSerialId, strProcessId, strPageName, strMemberCode, strLoginIp, strPermission); } Response.Redirect("/Index"); break; case "21": strProcessMessage = commonCulture.ElementValues.getResourceXPathString("Login/InvalidUsername", xeErrors); break; case "22": strProcessMessage = commonCulture.ElementValues.getResourceXPathString("Login/InactiveAccount", xeErrors); break; case "23": strProcessMessage = commonCulture.ElementValues.getResourceXPathString("Login/InvalidPassword", xeErrors); break; } } } } catch (Exception ex) { strProcessCode = "0"; strProcessMessage = commonCulture.ElementValues.getResourceString("Exception", xeErrors); strProcessRemark = string.Format("{0} | Message: {1}", strProcessRemark, ex.Message); } strProcessRemark = string.Format("{0} | strProcessCode: {1}", strProcessRemark, strProcessCode); intProcessSerialId += 1; commonAuditTrail.appendLog("system", strPageName, "MemberSignin", "DataBaseManager.DLL", strResultCode, strResultDetail, strErrorCode, strErrorDetail, strProcessRemark, Convert.ToString(intProcessSerialId), strProcessId, isSystemError); } #endregion #region Response txtMessage.InnerText = strProcessMessage; #endregion }
//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) { 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; } }
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 Page_Load(object sender, EventArgs e) { xeErrors = commonVariables.ErrorsXML; System.Xml.Linq.XElement xeResources = null; commonCulture.appData.getRootResource("/_Secure/UpdateProfile", out xeResources); System.Data.DataSet dsMemberProfile = null; string strOperatorId = string.Empty; string strMemberId = string.Empty; #region UneditableFieldsVariablesInitialise string strMemberCode = string.Empty; string strCountryCode = string.Empty; string strDOB = string.Empty; string strCurrencyCode = string.Empty; string strEmail = string.Empty; string strContact = string.Empty; string strFName = string.Empty; string strLName = string.Empty; System.DateTime dtDOB = System.DateTime.MinValue; #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"); lblFirstName.Text = commonCulture.ElementValues.getResourceString("lblFirstName", xeResources); lblLastName.Text = commonCulture.ElementValues.getResourceString("lblLastName", xeResources); lblDOB.Text = commonCulture.ElementValues.getResourceString("lblDOB", xeResources); lblCountry.Text = commonCulture.ElementValues.getResourceString("lblCountry", xeResources); lblGender.Text = commonCulture.ElementValues.getResourceString("lblGender", xeResources); lblLanguage.Text = commonCulture.ElementValues.getResourceString("lblLanguage", xeResources); lblOdds.Text = commonCulture.ElementValues.getResourceString("lblOdds", xeResources); lblAddress.Text = commonCulture.ElementValues.getResourceString("lblAddress", xeResources); lblCity.Text = commonCulture.ElementValues.getResourceString("lblCity", xeResources); lblPostal.Text = commonCulture.ElementValues.getResourceString("lblPostal", xeResources); lblSecurityQuestion.Text = commonCulture.ElementValues.getResourceString("lblSecurityQuestion", xeResources); lblSecurityAnswer.Text = commonCulture.ElementValues.getResourceString("lblSecurityAnswer", xeResources); lblPassword.Text = commonCulture.ElementValues.getResourceString("lblPassword", xeResources); btnSubmit.Text = commonCulture.ElementValues.getResourceString("btnSubmit", xeResources); foreach (System.Xml.Linq.XElement xeGender in xeResources.Element("drpGender").Elements()) { drpGender.Items.Add(new ListItem(xeGender.Value, Convert.ToString(xeGender.Name))); } foreach (System.Xml.Linq.XElement xeLang in xeResources.Element("drpLanguage").Elements()) { drpLanguage.Items.Add(new ListItem(xeLang.Value, Convert.ToString(xeLang.Name))); } foreach (System.Xml.Linq.XElement xeOdds in xeResources.Element("drpOdds").Elements()) { drpOdds.Items.Add(new ListItem(xeOdds.Value, Convert.ToString(xeOdds.Attribute("id").Value))); } 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 strEmail = Convert.ToString(dsMemberProfile.Tables[0].Rows[0]["email"]); strContact = 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"]); dtDOB = Convert.ToDateTime(dsMemberProfile.Tables[0].Rows[0]["dob"]); strDOB = dtDOB.ToString(commonVariables.DisplayDateFormat); strCurrencyCode = Convert.ToString(dsMemberProfile.Tables[0].Rows[0]["currencyCode"]); strCountryCode = 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 txtEmail.Text = strEmail; txtUserName.Text = strMemberCode; txtContact.Text = strContact; txtFirstName.Text = strFName; txtLastName.Text = strLName; txtDOB.Text = strDOB; txtCountry.Text = strCountryCode; txtCurrency.Text = commonCulture.ElementValues.getResourceXPathString("Currency/" + strCurrencyCode, xeResources); txtAddress.Text = strAddress; txtCity.Text = strCity; txtPostal.Text = strPostal; drpGender.SelectedValue = strGender; drpLanguage.SelectedValue = strLanguage; drpOdds.SelectedValue = "3"; txtSecurityAnswer.Text = strSecurityAnswer; } } } foreach (System.Xml.Linq.XElement xeSQ in xeResources.Element("drpSecurityQuestion").Elements()) { if (string.Compare(Convert.ToString(xeSQ.Name).Substring(2), "0", true) != 0) { drpSecurityQuestion.Items.Add(new ListItem(xeSQ.Value, Convert.ToString(xeSQ.Name).Substring(2))); } else if (string.IsNullOrEmpty(strSecurityQuestion) || Convert.ToInt32(strSecurityQuestion) < 1) { drpSecurityQuestion.Items.Add(new ListItem(xeSQ.Value, Convert.ToString(xeSQ.Name).Substring(2))); } } drpSecurityQuestion.SelectedIndex = Convert.ToInt32(strSecurityQuestion); } }
protected void btnSubmit_Click(object sender, EventArgs e) { int intProcessSerialId = 0; string strProcessId = Guid.NewGuid().ToString().ToUpper(); string strPageName = "UpdateProfile"; 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; string strEmail = string.Empty; string strContact = string.Empty; string strFName = string.Empty; string strLName = string.Empty; string strDOB = string.Empty; string strCountryCode = string.Empty; string strCurrencyCode = string.Empty; System.DateTime dtDOB = System.DateTime.MinValue; string strGender = string.Empty; string strLanguageCode = string.Empty; string strOddsType = string.Empty; string strAddress = string.Empty; string strCity = string.Empty; string strPostal = string.Empty; string strSecurityQuestion = string.Empty; string strSecurityAnswer = string.Empty; string strMemberMS1Id = string.Empty; string strPassword = string.Empty; string strPasswordEncrypted = string.Empty; int intResult = int.MinValue; #region populateVariables strAlertCode = "-1"; strMemberMS1Id = commonVariables.GetSessionVariable("MemberId"); strEmail = txtEmail.Text; strContact = txtContact.Text; strPassword = txtPassword.Text; strFName = txtFirstName.Text; strLName = txtLastName.Text; strCountryCode = txtCountry.Text; strDOB = txtDOB.Text; dtDOB = commonConversion.convertDateTime(strDOB, commonVariables.DisplayDateFormat); strGender = drpGender.SelectedValue; strLanguageCode = drpLanguage.SelectedValue; strOddsType = drpOdds.SelectedValue; strAddress = txtAddress.Text; strCity = txtCity.Text; strPostal = txtPostal.Text; strSecurityQuestion = drpSecurityQuestion.SelectedValue; strSecurityAnswer = txtSecurityAnswer.Text; #endregion #region parametersValidation if (string.IsNullOrEmpty(commonVariables.CurrentMemberSessionId)) { strAlertMessage = commonCulture.ElementValues.getResourceString("SessionExpired", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strAddress)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdateProfile/MissingAddress", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strCity)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdateProfile/MissingCity", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strPostal)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdateProfile/MissingPostal", xeErrors); isProcessAbort = true; } else if (string.IsNullOrEmpty(strSecurityAnswer)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdateProfile/MissingSecurityAnswer", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strAddress)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdateProfile/InvalidAddress", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strCity)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdateProfile/InvalidCity", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strPostal)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdateProfile/InvalidPostal", xeErrors); isProcessAbort = true; } else if (commonValidation.isInjection(strSecurityAnswer)) { strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdateProfile/InvalidSecurityAnswer", xeErrors); isProcessAbort = true; } else { strPasswordEncrypted = commonEncryption.Encrypt(strPassword); } #endregion if (!isProcessAbort) { try { using (wsMemberMS1.memberWSSoapClient wsInstance = new wsMemberMS1.memberWSSoapClient()) { intResult = wsInstance.MemberProfileUpdate(Convert.ToInt64(strMemberMS1Id), strEmail, strContact, strAddress, strCity, strPostal, strGender, strFName, strLName, dtDOB, strPasswordEncrypted, strLanguageCode, Convert.ToInt32(strSecurityQuestion), strSecurityAnswer, Convert.ToInt32(strOddsType)); strProcessRemark = string.Format("OperatorId: {0} | MemberId: {1} | Password: {2} | Email: {3} | Contact: {4} | Address: {5} | City: {6} | Postal: {6} | Country: {8} | Currency: {9} | Gender: {10} | OddsType: {11} | Language: {12} | FName: {13} | LName: {14} | DOB: {15} | REMOTEIP: {16} | FORWARDEDIP: {17} | REQUESTERIP: {18}", lngOperatorId, strMemberMS1Id, strPasswordEncrypted, strEmail, strContact, strAddress, strCity, strPostal, strCountryCode, strCurrencyCode, strGender, strOddsType, strLanguageCode, strFName, strLName, dtDOB, commonIp.remoteIP, commonIp.forwardedIP, commonIp.requesterIP); intProcessSerialId += 1; commonAuditTrail.appendLog("system", strPageName, "UpdateProfile", "DataBaseManager.DLL", strResultCode, strResultDetail, strErrorCode, strErrorDetail, strProcessRemark, Convert.ToString(intProcessSerialId), strProcessId, isSystemError); } } catch (Exception) { } switch (intResult) { case 1: // success strAlertCode = "1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdateProfile/Success", xeErrors); break; case 10: // wrong password strAlertMessage = commonCulture.ElementValues.getResourceXPathString("UpdateProfile/IncorrectPassword", xeErrors); break; default: // general error strAlertMessage = commonCulture.ElementValues.getResourceString("Exception", xeErrors); break; } } }