protected void Page_Load(object sender, EventArgs e) { string userName = User.Identity.Name.Split('¬')[1]; BrTypeMembership brTypeMembership = new BrTypeMembership(); var codes = brTypeMembership.GetListCodeMemberships(userName); Response.Write(codes + "¬" + userName); }
protected void Page_Load(object sender, EventArgs e) { BrTypeMembership brTypeMembership = new BrTypeMembership(); var correlativo = 0; if (Session["corregirdatos"] != null) { correlativo = int.Parse(brTypeMembership.GetTotalMemberships(Session["corregirdatos"].ToString())); } else { correlativo = int.Parse(brTypeMembership.GetTotalMemberships(User.Identity.Name.Split('¬')[1])); } correlativo--; Session["correlativoDoc"] = correlativo.ToString(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache); //Response.Cache.SetAllowResponseInBrowserHistory(false); //Response.Cache.SetNoStore(); string correlativo = ""; string userName = ""; // userName = User.Identity.Name.Split('¬')[1]; BrTypeMembership brTypeMembership = new BrTypeMembership(); correlativo = int.Parse(brTypeMembership.GetTotalMemberships(userName)).ToString(); Session["correlativoDoc"] = correlativo; string currencyCode = Session["TypeCurrency"].ToString(); Cronograma2(correlativo, currencyCode); Pagares2(correlativo, currencyCode); hlPagares.NavigateUrl = this.RutaUrlPagare; hlCronograma.NavigateUrl = this.RutaUrlCronog; } }
protected void Page_Load(object sender, EventArgs e) { string TypeMembership = ""; #region Declaracion de variables string quotesPendiente = ""; string codeCurrencyPay = ""; string namePeson = ""; string[] dataLogin = null; int typeRegister = 0, numberQuotes = 0, formPay = 0, idMemberDetails = 0; string dataKit = null, dataKitMember = null, dataMemberSinKit; string token = null, userCurrent = null, newUserName = null, emailNewUser = null; double amountPay = 0; bool isRegister = false; BrUser brUser = null; BrTypeMembership brTypeMembership = null; Email oEmail = null; BrPayments brPayments = null; BrConsuption brConsuption; #endregion #region Entradas de valores var _var = (string)Session["typeRegister"]; if (!string.IsNullOrEmpty(_var)) { typeRegister = int.Parse(Session["typeRegister"].ToString()); } formPay = int.Parse("1"); token = Request["token"].ToString(); numberQuotes = int.Parse(Request["numcuotes"].ToString()); brUser = new BrUser(); brTypeMembership = new BrTypeMembership(); dataLogin = HttpContext.Current.User.Identity.Name.Split('¬'); oEmail = new Email(); brPayments = new BrPayments(); brConsuption = new BrConsuption(); #endregion #region Procesos userCurrent = dataLogin[0]; if (dataLogin.Length > 1) { userCurrent = dataLogin[1]; } #endregion #region Registrar Usuario Y Generar Cuenta if (formPay == 1) { if (!string.IsNullOrEmpty((string)Session["SwitchAmort"])) { var values = (string)Session["dataAmort"]; var arrayValues = values.Split('|'); if (!string.IsNullOrEmpty(values)) { brPayments = new BrPayments(); PayCulqi payCulqi = new PayCulqi(); MyMessages myMessages = new MyMessages(); // (int TypePay, string IdMembershipDetail, int nQuotes, decimal NewAmort, int Rate) //Get the Email string photo = "culqi.jpeg"; string emailUser = brPayments.PayQuoteMembership(arrayValues[0], "10", photo); bool ans = brPayments.Amortization(1, arrayValues[0], Int32.Parse(arrayValues[1]), decimal.Parse(arrayValues[2]), Int32.Parse(arrayValues[3]), photo); string currencyCode = "PEN"; string[] culqiAnwser = payCulqi.newPayment(emailUser, emailUser, double.Parse(arrayValues[2]), token, numberQuotes, currencyCode).Split('¬'); if (culqiAnwser[0] == "true") { bool awnserEmail = oEmail.SubmitEmail(emailUser, "[RIBERA DEL RIO - PAGO]", myMessages.EmailPago()); Response.Write("true¬" + culqiAnwser[1]); Session.Remove("SwitchAmort"); return; } Response.Redirect("Payments.aspx"); return; } } else if (Session["StatusCalendar"] == null) { string dataBdd = Session["datos"].ToString(); TypeMembership = (dataBdd.Split('$')[3]).Split('|')[7]; // string data2 = (string)Session["civilStatus"]; string data2 = (string)Session["civilState"]; string[] oIdMembreship_amount = brUser.RegisterUser(dataBdd, data2).Split('¬'); if (oIdMembreship_amount.Length < 2) { Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar al Usuario"); return; } string[] parameterPerson = dataBdd.Split('$'); string[] arraydata = parameterPerson[0].Split('|'); string[] arrayTypeaccount = parameterPerson[2].Split('|'); string[] arrayaccount = parameterPerson[3].Split('|'); string parameterAccount = arraydata[5].Trim() + "|" + arrayTypeaccount[7].Trim() + '|' + userCurrent + '|' + oIdMembreship_amount[0]; //'999999999999|1|sa|1' newUserName = brUser.GenerateAccount(parameterAccount); if (string.IsNullOrEmpty(newUserName)) { Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar al Usuario"); return; } } else { var calendar = (string)Session["StatusCalendar"]; var data = (string)Session["StatusCalendar"]; string numCuota = Session["numCuota"].ToString(); var listParameters = data.Split('|'); var data2 = listParameters[0]; string quotePay = (string)Session["quotePay"]; string userName = User.Identity.Name.Split('¬')[1]; TypeMembership = User.Identity.Name.Split('¬')[7]; string emailUser = brUser.GetPersonalInformation(userName).Split('|')[5]; PayCulqi payCulqi = new PayCulqi(); string currencyCode = "PEN"; if (Session["CurrencyCode"] != null) { currencyCode = Session["CurrencyCode"].ToString(); } string[] culqiAnwser = payCulqi.newPayment(userCurrent, emailUser, Double.Parse(quotePay), token, numberQuotes, currencyCode).Split('¬'); bool awnserEmail = oEmail.SubmitEmail(emailUser, "[RIBERA DEL RIO - PAGO]", "Ud. Ha efectuado su pago en Ribera del Rio con Exito."); if (culqiAnwser[0] == "true") { //enviar recibo var dateCurrent = DateTime.Now.ToString("yyyy-MM-dd").Split('-');; string tranferId = culqiAnwser[2]; string numReceipt = "0"; string date = dateCurrent[2] + " de " + GetMonth(dateCurrent[1]) + " del " + dateCurrent[0]; string nAffiliate = ""; string hour = DateTime.Now.ToString("HH:mm:ss"); string detalle = Double.Parse(quotePay).ToString(); namePeson = User.Identity.Name.Split('¬')[0].ToUpper(); //cvbc string nameTicket = GetRecibo(tranferId, userName, numReceipt, date, nAffiliate, TypeMembership, namePeson, hour, detalle, quotesPendiente, " " + numCuota); string EmailUserA = brPayments.PayQuoteMembership(data2, "1", nameTicket); Response.Write("true¬" + culqiAnwser[1]); } else { Response.Write("false¬" + culqiAnwser[1]); } return; } } #endregion #region Solo elegio el kit if (typeRegister == 1 && formPay == 1) { string arrayKit = Session["arrayKit"].ToString() + "¬" + newUserName; //'2018-10-19¬31¬31¬31¬userName' // isRegister = brUser.PutRegisterkIT(arrayKit); string data2 = Session["financedAmount"].ToString(); if (data2 == "0") { data2 = Session["Amount"].ToString(); } string codeCurrency = Session["TypeCurrency"].ToString(); Int32 ansNmembershi = brUser.RegisterNmembership(TypeMembership + '|' + newUserName, data2, 1, codeCurrency); if (ansNmembershi != 0) { isRegister = brUser.PutRegisterkIT(arrayKit, ansNmembershi); } else { Response.Write("false¬Ha Ocurrido Un Error al Intentar Obtener el monto a Pagar"); return; } //monto a pagar string[] username_idmen_amount_email = brUser.getAmountPay(newUserName).Split('¬'); if (username_idmen_amount_email.Length < 4) { Response.Write("false¬Ha Ocurrido Un Error al Intentar Obtener el monto a Pagar"); return; } idMemberDetails = int.Parse(username_idmen_amount_email[1]); amountPay = double.Parse(username_idmen_amount_email[2]); emailNewUser = username_idmen_amount_email[3]; username_idmen_amount_email = null; } #endregion #region Elegio kit mas membresia if (typeRegister == 2 && formPay == 1) { dataKitMember = Session["cronograma"].ToString(); string[] datos = Session["datos"].ToString().Split('$'); if (Session["datos"] == null) { Response.Write("false¬Ha Ocurrido Un Error, no hay datos."); return; } string[] arraycontacto = datos[3].Split('|'); string[] arrayperson = datos[0].Split('|'); amountPay = double.Parse(Session["FirtsPay"].ToString()); if (idMemberDetails <= 0 || amountPay <= 0) { Response.Write("false¬Ha Ocurrido Un Error id idMemberDetails vacio,amountPay vacio"); return; } string dni = arrayperson[5]; newUserName = arrayperson[0].Substring(0, 1).ToUpper() + arrayperson[1].Substring(0, 1).ToUpper() + dni; emailNewUser = arraycontacto[0].Trim(); codeCurrencyPay = Session["TypeCurrency"].ToString(); PayCulqi payCulqi = new PayCulqi(); MyMessages myMessages = new MyMessages(); //string currencyCode = "PEN"; string[] culqiAnwser = payCulqi.newPayment(newUserName, emailNewUser, amountPay, token, numberQuotes, codeCurrencyPay).Split('¬'); if (culqiAnwser[0] == "false") { Response.Write("false¬" + culqiAnwser[1]); return; } /*=====================================================================================================================================================================*/ //correo = arraycontacto[0]; namePeson = arrayperson[0] + " " + arrayperson[1]; string date = dataKitMember.Split('$')[1]; string[] array1 = Session["cronogramaYa"].ToString().Split('^'); string[] datosMem = array1[0].Split('|'); string[] array2 = array1[1].Split('~'); string[] cuotas = array2[0].Split('¬'); string cronoActiv = ""; quotesPendiente = (cuotas.Length - 2).ToString(); for (int i = 0; i < cuotas.Length - 1; i++) { var fila = cuotas[i].Split('|'); if (fila[0].Substring(0, 7) != "Inicial") { cronoActiv += DateTime.Parse(fila[1]).ToString("yyyy-MM-dd"); //amountFinanciade = double.Parse(fila[2].Replace("S/.", "")); break; } else { cronoActiv += DateTime.Parse(fila[1]).ToString("yyyy-MM-dd") + "¬"; } } string respData = brPayments.PersonGetData(newUserName); respData = respData + '^' + dataKitMember; // isRegister = brPayments.GetCalculatePaymentSchedule(respData, newUserName); string data2 = Session["financedAmount"].ToString(); string codeCurrency = Session["TypeCurrency"].ToString(); Int32 ansNmembershi = brUser.RegisterNmembership(TypeMembership + '|' + newUserName, data2, 1, codeCurrency); string exchange = Session["carrito"].ToString().Split('|')[4]; isRegister = brPayments.GetCalculatePaymentSchedule(respData, newUserName, ansNmembershi, exchange, 1); //validamos si tiene consumo if (!isRegister) { Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar el Cronograma de Pagos del Usuario"); return; } BrActivation brActivation = new BrActivation(); bool registerActi = brActivation.PutCronograma(cronoActiv, newUserName, ansNmembershi); //obtengo el monto a pagar string[] username_idmen_amount_email = brUser.getAmountPay(newUserName).Split('¬'); if (username_idmen_amount_email.Length < 4) { Response.Write("false¬Ha Ocurrido Un Error al Intentar Obtener el monto a Pagar"); return; } idMemberDetails = int.Parse(username_idmen_amount_email[1]); amountPay = double.Parse(username_idmen_amount_email[2]); emailNewUser = username_idmen_amount_email[3]; codeCurrencyPay = username_idmen_amount_email[4]; date = null; username_idmen_amount_email = null; dataKitMember = null; respData = null; /*=============================================================================================================================*/ var dateCurrent = DateTime.Now.ToString("yyyy-MM-dd").Split('-');; string tranferId = culqiAnwser[2] == null ? "" : culqiAnwser[2]; string numReceipt = "0"; string datecomplete = dateCurrent[2] + " de " + GetMonth(dateCurrent[1]) + " del " + dateCurrent[0]; string nAffiliate = ""; string hour = DateTime.Now.ToString("HH:mm:ss"); string detalle = amountPay.ToString(); //cvbc string nameTicket = GetRecibo(tranferId, newUserName, numReceipt, datecomplete, nAffiliate, TypeMembership, namePeson, hour, detalle, quotesPendiente, " Inicial 1"); //marcar como pagado en la tabla membershipdetails bool habiliAccount = brUser.enableAcount(idMemberDetails, nameTicket); int nAfiliate = int.Parse(brUser.GetNafiliate(idMemberDetails)); Cronograma2(nAfiliate, codeCurrencyPay); // enviar el email de confirmacion con la data y lo redirecciona al post register if (!habiliAccount) { Response.Write("false¬Ha Ocurrido un Error al Intentar Habilitar Su Cuenta.Sin embargo su Pago fue Exitoso"); return; } string ruta = HttpContext.Current.Server.MapPath("~/Resources/PoliticsPdf/"); //enviar email con los documentos if (typeRegister == 2 && formPay == 1) { bool awnserEmailDoc = oEmail.SubmitEmail(emailNewUser, "[RIBERA DEL RIO - BIENVENIDO]", myMessages.DocumentosRegister(newUserName), true, ruta, newUserName); } else { bool awnserEmailDoc = oEmail.SubmitEmailKit(emailNewUser, "[RIBERA DEL RIO - BIENVENIDO]", myMessages.DocumentosRegister(newUserName), true, ruta); } bool awnserEmail = oEmail.SubmitEmail(emailNewUser, "[RIBERA DEL RIO - PAGO]", myMessages.EmailPago()); //ejecutamos el core para los puntos de equipo // BrCore_Automation brCore_Automation = new BrCore_Automation(); //bool isCoreRegister = brCore_Automation.ExecuteCore(); Response.Write("true¬" + culqiAnwser[1]); return; } #endregion }
public void RegisterMembership(string nameImages) { BrPayments brPayments = new BrPayments(); BrUser brUser = new BrUser(); BrTypeMembership brTypeMemb = new BrTypeMembership(); string[] dataLogin = HttpContext.Current.User.Identity.Name.Split('¬'); string userName = dataLogin[0]; if (dataLogin.Length > 1) { userName = dataLogin[1]; } string dataBdd = Session["datos"].ToString(); string[] acarrito = Session["carrito"].ToString().Split('|'); string TypeMembership = acarrito[6]; string cronograma = Session["cronograma"].ToString(); //string respData = brPayments.PersonGetData(userName); string respData = ""; respData = respData + '^' + cronograma; double amountFinanciade = 0; string[] array1 = Session["cronogramaYa"].ToString().Split('^'); string[] datosMem = array1[0].Split('|'); string[] array2 = array1[1].Split('~'); string[] cuotas = array2[0].Split('¬'); string cronoActiv = ""; for (int i = 0; i < cuotas.Length - 1; i++) { var fila = cuotas[i].Split('|'); if (fila[0].Substring(0, 7) != "Inicial") { cronoActiv += DateTime.Parse(fila[1]).ToString("yyyy-MM-dd"); amountFinanciade = double.Parse(fila[2].Replace("S/.", "")); break; } else { cronoActiv += DateTime.Parse(fila[1]).ToString("yyyy-MM-dd") + "¬"; } } string codeCurrency = Session["TypeCurrency"].ToString(); int ansNmembershi = brUser.RegisterNmembership(TypeMembership + '|' + userName, amountFinanciade.ToString(), Int32.Parse(Session["membPred"].ToString()), codeCurrency); bool isRegister = false; if (Session["codeUpgrate"] != null) { //si es upgrate string exchange = Session["carrito"].ToString().Split('|')[4]; //ultParametroSinCalculoDePuntaje isRegister = brPayments.GetCalculatePaymentScheduleUpgrate(respData, userName, ansNmembershi, exchange, 0); if (!isRegister) { // Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar el Cronograma de Pagos del Usuario"); return; } if (Session["dateup"] != null) { string dateup = Session["dateup"].ToString(); bool an = brPayments.PutDateUpgrate(ansNmembershi, dateup); } } else { //si no es upgrate string exchange = Session["carrito"].ToString().Split('|')[4]; isRegister = brPayments.GetCalculatePaymentSchedule(respData, userName, ansNmembershi, exchange, 0); if (!isRegister) { //Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar el Cronograma de Pagos del Usuario"); return; } BrActivation brActivation = new BrActivation(); bool registerActi = brActivation.PutCronograma(cronoActiv, userName, ansNmembershi); } if (Session["codeUpgrate"] != null) { int codeUpgrate = int.Parse(Session["codeUpgrate"].ToString()); bool upgrate = brTypeMemb.CancelMembershipUpgrate(codeUpgrate, ansNmembershi); if (!upgrate) { // Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar el Cronograma de Pagos del Usuario"); return; } BrActivation brActivation = new BrActivation(); string fechaAnterior = Session["fechaanterior"].ToString(); bool registerActi = brActivation.PutCronogramaUpgrade(fechaAnterior, userName, ansNmembershi, codeUpgrate); //cambia el estado de la cuota upgrate y si el segundo parametro es 1 paga la primera cuota BrMembershipPayDetail brMembershipPayDetail = new BrMembershipPayDetail(); isRegister = brMembershipPayDetail.UpgrateStatusPaymentInitial(ansNmembershi, 0, "upgrade.png"); } if (nameImages != null) { bool upload = brPayments.UploadReceiptUpgradeCerooInitial(ansNmembershi.ToString() + '|' + nameImages); } if (!isRegister) { //Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar el Cronograma de Pagos del Usuario"); return; } brPayments = null; brUser = null; }
protected void SendEmail_Click(object sender, EventArgs e) { bool anwser = false; string nombre = "", dni = "", username = "", correo = ""; //Session["datos"] = "Aaaaa|Aaaa|birthDay|M|DocumentType|88884444$NombreC|ApellidoC|1|313231c$bankName|nombreBankAccount|TypeAccount|nroAccount|nroTaxer|SocialReason|fiscalAdress|[email protected]|nroCell|nroCell2|country|State|City|Adress"; //Session["carrito"] = "6000.00|descripcionDB|60|9750.00|3.25|10|TOP"; //Session["cronograma"] = "6000|222"; username = txtUserName.Text; if (string.IsNullOrEmpty(username)) { return; } BrUser brUser = new BrUser(); MyMessages mm = new MyMessages(); var arrayperson = brUser.GetPersonalInformation(username).Split('|'); if (arrayperson.Length < 5) { return; } correo = arrayperson[5]; nombre = arrayperson[1] + " " + arrayperson[2]; dni = arrayperson[13]; username = arrayperson[1].Substring(0, 1).ToUpper() + arrayperson[2].Substring(0, 1).ToUpper() + dni; string gender = arrayperson[4]; string name = arrayperson[1]; BrAccount brAccount = new BrAccount(); string codeMemb = brAccount.GetLastCodeMembership(username).Trim(); if (string.IsNullOrEmpty(codeMemb)) { MessageError.Text = "no tiene membresia."; return; } if (rbDoc.Checked) { BrTypeMembership brTypeMembership = new BrTypeMembership(); var correlativo = int.Parse(brTypeMembership.GetTotalMemberships(username)); correlativo--; if (correlativo < 0) { correlativo = 0; } username = $"{username}{correlativo}"; var ruta = HttpContext.Current.Server.MapPath("~/Resources/PoliticsPdf/"); if (codeMemb == "KIT") { anwser = this.SendEmailKit(name, gender, username, ruta, correo); } if (codeMemb == "EXP" || codeMemb == "LHT" || codeMemb == "STD" || codeMemb == "PLUS" || codeMemb == "TOP" || codeMemb == "VIT") { anwser = this.SendEmailClub(name, gender, username, ruta, correo); } if (codeMemb == "EVOL" || codeMemb == "MVC") { anwser = this.SendEmailVacational(name, gender, username, ruta, correo); } if (codeMemb == "SBY") { anwser = this.SendEmailFounder(name, gender, username, ruta, correo); } } if (rbRece.Checked) { MyConstants mc = new MyConstants(); var bankAccount = mc.BankAccount; var repsonse_ = brAccount.GetFirtsPayCurrency(username).Split('|'); var infoAfiliate = brAccount.GetSponsorInfo(username).Split('|'); var nameAfiliate = infoAfiliate[0]; var correoAfiliate = infoAfiliate[1]; var firtsPay = repsonse_[0]; var currencyCode = repsonse_[1]; string fullname = arrayperson[1].Trim().ToLower() + " " + arrayperson[2].Trim().ToLower(); fullname = ToCapitalize(fullname); string[] sepName = arrayperson[1].Split(' '); var fName = ToCapitalize(sepName[0]); var bienvenido = "Bienvenido"; if (arrayperson[4] == "F") { bienvenido = "Bienvenida"; } var cuerpo = "<html><head><title></title></head><body style='color:black'>"; cuerpo += "<div style='width: 100%'>"; cuerpo += "<div style='display:flex;'>"; cuerpo += "<div style='width:50%;'>"; cuerpo += " <img src='http://www.inresorts.club/Views/img/novologo.png' align='left' style='width: 98px;'>"; cuerpo += "</div>"; cuerpo += "<div style='width:50%;'>"; cuerpo += "<img src='http://cieneguillariberadelrio.com/riberadelrio/img/image006.png' align='right' style='width: 120px;padding-top: 7px;'>"; cuerpo += "</div>"; cuerpo += "</div>"; cuerpo += "<img style='width: 100%' src='http://www.inresorts.club/Views/img/fondo.png'>"; cuerpo += "<h1 style='margin-top: 2px ;text-align: center;font-weight: bold;font-style: italic;'>" + bienvenido + " " + fName + "</h1>"; cuerpo += "<h2 style='text-align: center;'>Muy pronto formarás parte de la familia inResorts. Estamos a la espera de que nos brindes tu comprobante de pago</h2>"; cuerpo += "<center><p style='margin-left: 10%;margin-right: 10%;'>Cuando lo tengas listo, solo tienes que subirlo a nuestra pagina y enseguida lo estaremos validando</p></center> "; cuerpo += ""; cuerpo += "<center><div style='width: 100%'>"; cuerpo += "<p style='margin-left: 10%;margin-right: 10%; '> Click en el boton para validar el pago.</p>"; cuerpo += "<a style='text-decoration: none;' href='https://inresorts.club/Views/Login.aspx?usuario=" + dni + "&fullname=" + fullname + "'>"; cuerpo += "<center><div style='background: #0d80ea;border-radius:10px;width: 158px;height: 30px;font-size: 16px;color: white;font-weight: bold;padding: 4px;padding-top: 10px;cursor: pointer;text-align: center;margin: 23px;'>Validar pago<div></center>"; cuerpo += "</a></div></center>"; cuerpo += "<center><div style='width: 100%'>"; cuerpo += "<p style='margin-left: 10%;margin-right: 10%; '></p>"; cuerpo += "<center>Recuerde que el pago lo puede realizar mediante deposito en nuestra cuenta corriente atravez de Agente BCP, Agencia BCP O transferencia bancaria desde Banca por Internet.</center>"; cuerpo += "</div></center>"; cuerpo += "<center><div style='width: 100%'>"; cuerpo += "<p style='margin-left: 10%;margin-right: 10%; '>Cuenta Bancaria </p>"; cuerpo += $"<center>BCP: N° {bankAccount} - Valle Encantado S.A.C</center>"; cuerpo += "</div></center>"; cuerpo += "<center><div style='width: 50%;display: flex;border-radius: 10px;margin: 11px;'>"; cuerpo += "<p style='margin-left: 10%;margin-right: 10%;'>Monto a depositar</p>"; cuerpo += "<center style=' margin: 12px;'> " + firtsPay + " (" + currencyCode + ")</center>"; cuerpo += "</div></center>"; //cuerpo += "<center><img src='http://www.inresorts.club/Views/img/recibo.png' align='left' style='width: 100%'></center></div>"; cuerpo += "<div style='margin-left: 9%;'>"; cuerpo += "<p style='margin:5px'>Patrocinador: " + nameAfiliate + "</p>"; cuerpo += "<p style='margin:5px'>Saludos Cordiales</p><p style='margin:5px'>Equipo inResorts</p></div>"; cuerpo += "<div style='margin: 5%; width: 70%;background-image: url('https://lh3.googleusercontent.com/NSDQDl8ytJrWSwMe0b3b9DlxubIal-RBEPIWI1a-15f9ynEGQ9eYjTnm-PVqst26f4KJThmjOEPK4lcVoaUw=w1016-h917-rw');'></ div > "; cuerpo += "<img style='width: 100%' src='https://preview.ibb.co/ixY7iL/fondo222.png'>"; cuerpo += "</div>"; cuerpo += "</body>"; cuerpo += "</html>"; Email email = new Email(); anwser = email.SubmitEmail(correo, "[Ribera del Rio - Inresorts, Registro en Proceso] ", cuerpo); string correoOamr = "*****@*****.**"; email.SubmitEmail(correoOamr, "[Ribera del Rio - Inresorts, Registro en Proceso] ", cuerpo); if (correoAfiliate != "") { email.SubmitEmail(correoAfiliate, "[Ribera del Rio - Inresorts, Registro en Proceso] ", cuerpo); } } if (rbQuote.Checked) { //SendEmailAmountRestante(username, "PEN", "", "", "", "", ""); } MessageError.Text = string.Empty; MessageSucces.Text = string.Empty; if (!anwser) { MessageError.Text = "ocurred error."; return; } MessageSucces.Text = "correo enviado."; }
protected void btnRegister_Click(object sender, EventArgs e) { bool exonerarKit = false; string amountInicial = ""; bool eligioMen = false; var resp = ""; var memb = ""; Session["flag"] = "1"; Session["typeBuy"] = "store"; //if (rbtExp.Checked) //{ // dataBdd = str("EXP"); // amountInicial = txtInitialEXP.Text.Trim(); // Session["Amount"] = amountInicial; // numCuotas = txtNumCuEXP.Text.Trim(); // txtp1 = textPag1.Text.Trim(); // memb = "Experience"; // eligioMen = true; // //Membership= str("EXP"); // Membership = "EXP"; //} //if (rbtStd.Checked == true) //{ // dataBdd = str("STD"); // amountInicial = txtInitialSTA.Text.Trim(); // Session["Amount"] = amountInicial; // numCuotas = txtNumCuSTA.Text.Trim(); // txtp1 = textPag2.Text.Trim(); // memb = "Stantard"; // eligioMen = true; // //Membership = str("STD"); // Membership ="STD"; //} //if (rbtPlus.Checked) //{ // dataBdd = str("PLUS"); // amountInicial = txtInitialPLU.Text; // Session["Amount"] = amountInicial; // numCuotas = txtNumCuPLU.Text; // txtp1 = textPag3.Text.Trim(); // memb = "Plus"; // eligioMen = true; // //Membership = str("PLUS"); // Membership = "PLUS"; //} //if (rbtTop.Checked == true) //{ // dataBdd = str("TOP"); // amountInicial = txtInitialTOP.Text; // Session["Amount"] = amountInicial; // numCuotas = txtNumCuTOP.Text; // txtp1 = txtTopCuotaInicial.Text.Trim(); // memb = "Top"; // eligioMen = true; // //Membership = str("TOP"); // Membership = "TOP"; //} //if (rbtLight.Checked) //{ // dataBdd = str("LHT"); // amountInicial = txtInitialLigh.Text.Trim(); // Session["Amount"] = amountInicial; // numCuotas = txtNumCuLigh.Text.Trim(); // txtp1 = textPag2.Text.Trim(); // memb = "Light"; // eligioMen = true; // //Membership = str("LHT"); // Membership = "LHT"; //} //if (rdrEx.SelectedValue == "Exonerar") //{ // Session["StatusExonerar"] = 1; //} //else if (rdrEx.SelectedValue == "NoExonerar") //{ // Session["StatusExonerar"] = 0; //} //else //{ // Session["StatusExonerar"] = 0; //} Session["membresia"] = memb; BrTypeMembership brTypeMembership = new BrTypeMembership(); //Register Payment si es kit inserte unico 'montodolaresKit¬tipocambio¬fecha' string[] kitData = brTypeMembership.GetKitData().Split('¬'); double amountKit = double.Parse(kitData[0]); double tpKit = double.Parse(kitData[1]); string date = kitData[2]; //if (string.IsNullOrEmpty(this.CodeMembership) && isExonerar.Checked == false) //{ // dataBdd = str("KIT"); // Session["datos"] = dataBdd; // double totalKit = TwoDecimas(amountKit * tpKit); // string arrayKit = date + "¬" + totalKit.ToString("0.00") + "¬" + totalKit.ToString("0.00") + "¬" + totalKit.ToString("0.00"); // Session["QuoteAux"] = "0"; // Session["Amount"] = totalKit; // Session["arrayKit"] = arrayKit; // Session["carrito"] = amountKit.ToString("0.00") + "|" + "" + "|" + "0" + "|" + amountKit.ToString("0.00") + "|" + tpKit.ToString("0.00") + "|" + "10" + "|" + CodeMembership; // Session["typeRegister"] = "1"; // //Response.Redirect("PoliticsKit.aspx?name=" + txtName.Text + "&lastNama=" + txtLastName.Text + "&pais=" + txtCountry.Text + "&dni=" + txtNumDoc.Text); // Response.Redirect("Politics.aspx"); // var storeT = Session["tienda"].ToString(); // var plop = int.Parse(storeT.ToString()); //} //solo exonerar si es el administrador string[] arrayLogin = HttpContext.Current.User.Identity.Name.Split('¬'); if (arrayLogin.Length > 2) { if (int.Parse(arrayLogin[2]) == 1) { //if (isExonerar.Checked) //{ // if (eligioMen == true) // { // BrInformacion brInformacion = new BrInformacion(); // string textExonerarDB = brInformacion.GetTextExonerarDB(); // brInformacion = null; // if (txtContaExonerar.Text.Trim() == textExonerarDB.Trim()) // { // if (eligioMen == true) // { // exonerarKit = true;////////////////////////********************** // } // else // { // lblMessagge.Text = "Debe Comprar al menos una Membresia"; // return; // } // } // else // { // lblMessagge.Text = "Codigo Incorrecto"; // return; // } // } // else // { // lblMessagge.Text = "Debe Comprar al menos una Membresia"; // return; // } //} } } if (eligioMen == true) { if (string.IsNullOrEmpty(dataBdd)) { return; } BrPayments brPayments = new BrPayments(); var arraydata = dataBdd.Split('|'); //amount¬quoteInitial¬numQuotes¬descripcioon¬fecha¬tipocambio ---se le envia el code de la membership //string[] arrayMontoTotal = brPayments.GetAmountTotal(this.CodeMembership).Split('¬'); //brPayments = null; //double amountTotalDB = double.Parse(arrayMontoTotal[0]); //double amountInicialDB = double.Parse(arrayMontoTotal[1]); //int numCuotasDB = int.Parse(arrayMontoTotal[2]); //string descripcionDB = arrayMontoTotal[3]; //string fecha = arrayMontoTotal[4]; //double tipoCambio = double.Parse(arrayMontoTotal[5]); //double amountInicialU = TwoDecimas(double.Parse(amountInicial)); ////validar que la cuota inicial debe ser mayor al valor asignado como minimo //if (amountInicialU < amountInicialDB) //{ // //txtMessagge.Text = "El Monto de la Inicial debe ser Mayor"; // return; //} ////validar que el numero de las cuotas debe ser menor a las asignadas como maximo //if (int.Parse(numCuotas) > numCuotasDB || int.Parse(numCuotas) <= 0) //{ // //txtMessagge.Text = "El Numero de Las Cuotas debe ser Menor"; // return; //} //if ((int.Parse(textPlusQuoteInitial.Text) > 2 || int.Parse(textPlusQuoteInitial.Text) < 1) && CodeMembership == "PLUS") //{ // // txtMessagge.Text = "El Numero de Las Cuotas INITIAL debe ser Menor"; // return; //} //if ((int.Parse(textPlusQuoteInitial.Text) > 3 || int.Parse(textPlusQuoteInitial.Text) < 1) && CodeMembership == "TOP") //{ // //txtMessagge.Text = "El Numero de Las Cuotas INITIAL debe ser Menor"; // return; //} //HGHG //string exonerarkit = Session["StatusExonerar"].ToString(); //double cuotaInicialS = TwoDecimas(amountInicialU * tipoCambio); //if (!exonerarKit) //{ // //suma el monto del kit de unicio // amountTotalDB += TwoDecimas(amountKit); // cuotaInicialS += TwoDecimas(amountKit * tipoCambio); //} //int numCuotasU = int.Parse(numCuotas); //datos para mostrar en la parte de pasarela de pagos //string Req = ""; //brConsuption = new BrConsuption(); //if (consumePack1.Checked) //{ // Req = brConsuption.GetAmountConsuption("PB1"); //} //else if (ConsumePack2.Checked) //{ // Req = brConsuption.GetAmountConsuption("PB2"); //} //else if (ConsumePack3.Checked) //{ // Req = brConsuption.GetAmountConsuption("PB3"); //} //else if (ConsumePack4.Checked) //{ // Req = brConsuption.GetAmountConsuption("PB4"); //} //else if (ConsumePack5.Checked) //{ // Req = brConsuption.GetAmountConsuption("PB5"); //} //Session["carrito"] = amountTotalDB.ToString("0.00") + "|" + descripcionDB + "|" + numCuotasU + "|" + amountInicialU.ToString("0.00") + "|" + tipoCambio.ToString("0.00") + "|" + amountKit.ToString() + '|' + CodeMembership; //monto total de la membresia debe estar en dolares //la cuota inicial debe estar en soles //"gfdgdf|gdfgdfg|20/11/2018|M|1|77777738$navacito | |1|$EMPTY|EMPTY|CORRIENTE|EMPTY|EMPTY|EMPTY|EMPTY|[email protected]|960614917| |Peru|fs|sf|fs|STD|admin$1" string data = arrayLogin[1] + '|' + Membership; brUser = new BrUser(); string dataPerson = brUser.GetDataPerson(data); Session["datos"] = dataPerson; //william //if (rbtTop.Checked) //{ // QuoteInitial = Int32.Parse(txtTopCuotaInicial.Text); // amount = Double.Parse(txtInitialTOP.Text) * 3.37; // amount = amount / QuoteInitial; // Session["Amount"] = amount; //} //else if (rbtPlus.Checked) //{ // QuoteInitial = Int32.Parse(textPlusQuoteInitial.Text); // amount = Double.Parse(txtInitialPLU.Text) * 3.37; // amount = amount / QuoteInitial; // Session["Amount"] = amount; //} //else if (rbtStd.Checked) //{ // QuoteInitial = 1; // amount = Double.Parse(txtInitialSTA.Text) * 3.37; // amount = amount / QuoteInitial; // Session["Amount"] = amount; //} //else if (rbtLight.Checked) //{ // QuoteInitial = 1; // amount = Double.Parse(txtInitialLigh.Text) * 3.37; // amount = amount / QuoteInitial; // Session["Amount"] = amount; //} //else if (rbtExp.Checked) //{ // QuoteInitial = 1; // amount = Double.Parse(txtInitialEXP.Text) * 3.37; // amount = amount / QuoteInitial; // Session["Amount"] = amount; //} //strDate = ""; //for (var i = 0; i < QuoteInitial; i++) //{ // if (i > 0) // { // strDate += '|' + fecha + '|' + amount.ToString(); // } // else // { // strDate += fecha + '|' + amount.ToString(); // } // var dateAux = ((Convert.ToDateTime(fecha)).AddMonths(i)).ToString("yyyy-MM-dd"); // fecha = dateAux; //} ///////// CAGADA START para analizarrr samir!!! ////////////// //Session["cronograma"] = (amountTotalDB - 10).ToString() + "|" + tipoCambio.ToString() + "|empty|empty|" + numCuotasU + "|" + fecha + "|" + cuotaInicialS.ToString() + "|10|1|empty^" + strDate + "~" + // "$" + "2018-11-01"; ////////// CAGADA START //////////// /// Session["typeRegister"] = "2"; /// var auxData = brPayment.PersonGetData(userLog);//problem var idPerson = auxData.Split('|')[0]; string respData = idPerson.ToString() + '|' + memb; string flag = (string)Session["flag"]; // string showReport = brPayment.GetCalculatePaymentScheduleString(respData, userName, QuoteInitial.ToString(), flag); //Session["cronograma"] = showReport; //Session["cronograma"] = ((amountTotalDB - 10).ToString()+ "|" + tipoCambio.ToString() + "|empty|empty|" + numCuotasU + "|" + fecha + "|" + cuotaInicialS.ToString() + "|10|1|empty^" + strDate + "~" + // "nombre de prueba" + "|" + "apellido de prueba" + "|1" + "222222" + "|" + "22222" + "$" + "2018-11-01"); //brPayment = new BrPayments(); //Session["exchange"] = tipoCambio; /// //brPayment = new BrPayments(); ////string respData = brPayment.PersonGetData(userName); //respData = respData + '^' + (string)Session["cronograma"]; //string showReport = brPayment.GetCalculatePaymentScheduleString(respData, userName, QuoteInitial.ToString(), "0"); //Session["cronogramaYa"] = showReport; //var macro = showReport.Split('^'); //var micro = macro[1].Split('¬'); //string quoteReference = ""; //for (int i = 0; i <= micro.Length; i++) //{ // var listRegisters = micro[i].Split('|'); // if (listRegisters[0] == "Cuota nro: 1") // { // quoteReference = listRegisters[5]; // break; // } //} //Session["QuoteAux"] = quoteReference; /// //var ej = "2500|3.25|VE034|VE035|23|2018-09-19|1944|10|1|obs^2018-09-19|1944~nombre|apellido|1|45345345|45345345$2018-10-19"; Session["JustKit"] = 0; // Response.Redirect("Politics.aspx?name=" + txtName.Text + "&lastNama=" + txtLastName.Text + "&pais=" + txtCountry.Text + "&dni=" + txtNumDoc.Text); Response.Redirect("Politics.aspx"); } else { //lblMessagge.Text = "Debe Comprar al menos una Membresia"; //Session["JustKit"] = 1; //Response.Redirect("PoliticsKit.aspx?name=" + txtName.Text + "&lastNama=" + txtLastName.Text + "&pais=" + txtCountry.Text + "&dni=" + txtNumDoc.Text); //Response.Redirect("Politics.aspx"); return; } }
protected void Page_Load(object sender, EventArgs e) { MyConstants mc = new MyConstants(); try { string token = ""; int numberQuotes = 0; token = Request["token"].ToString(); numberQuotes = int.Parse(Request["numcuotes"].ToString()); //pagar con wallet BrWallet brWallet = new BrWallet(); var amountWalletc = decimal.Parse(brWallet.GetAmount(User.Identity.Name.Split('¬')[1])); var amountTotal = 0m; if (Session["MontoWallet"] != null) { amountTotal = decimal.Parse(Session["MontoWallet"].ToString()); } var amountRestan = amountTotal - amountWalletc; //if (amountWalletc < quota) //{ // MessageError.Text = "No tiene el monto suficiente para realizar Pago."; // return; //} var methods2 = "CULQI"; var recibe = string.Empty; BrPayments brPayments = new BrPayments(); BrUser brUser = new BrUser(); string dataKitMember = Session["cronograma"].ToString(); string date = dataKitMember.Split('$')[1]; var cart = Session["carrito"].ToString(); var arrayCart = cart.Split('|'); var codeMemb = arrayCart[6]; string[] datos = Session["datos"].ToString().Split('$'); var dataBdd = Session["datos"].ToString(); if (Session["datos"] == null) { Response.Write("false¬Ha Ocurrido Un Error, no hay datos."); return; } string[] arraycontacto = datos[3].Split('|'); string[] arrayperson = datos[0].Split('|'); string dni = arrayperson[5]; var newUserName = User.Identity.Name.Split('¬')[1]; var emailNewUser = arraycontacto[0].Trim(); var codeCurrencyPay = Session["TypeCurrency"].ToString(); string[] array1 = Session["cronogramaYa"].ToString().Split('^'); string[] datosMem = array1[0].Split('|'); string[] array2 = array1[1].Split('~'); string[] cuotas = array2[0].Split('¬'); string cronoActiv = ""; var quotesPendiente = (cuotas.Length - 2).ToString(); for (int i = 0; i < cuotas.Length - 1; i++) { var fila = cuotas[i].Split('|'); if (fila[0].Substring(0, 7) != "Inicial") { cronoActiv += DateTime.Parse(fila[1]).ToString("yyyy-MM-dd"); //amountFinanciade = double.Parse(fila[2].Replace("S/.", "")); break; } else { cronoActiv += DateTime.Parse(fila[1]).ToString("yyyy-MM-dd") + "¬"; } } var respDataper = brPayments.PersonGetData(newUserName); string respData = string.Empty; respData = respData + '^' + dataKitMember; // isRegister = brPayments.GetCalculatePaymentSchedule(respData, newUserName); //string data2 = Session["financedAmount"].ToString(); string data2 = "0"; //string codeCurrency = Session["TypeCurrency"].ToString(); var currencyCode = Session[""].ToString(); PayCulqi payCulqi = new PayCulqi(); string[] culqiAnwser = payCulqi.newPayment(newUserName, emailNewUser, double.Parse(amountRestan.ToString()), token, numberQuotes, codeCurrencyPay).Split('¬'); if (culqiAnwser[0] == "false") { Response.Write("false¬" + culqiAnwser[1]); return; } Int32 ansNmembershi = brUser.RegisterNmembership(codeMemb + '|' + newUserName, data2, 1, codeCurrencyPay); BrTypeMembership brTypeMemb = new BrTypeMembership(); string typeChange = arrayCart[4]; //var isRegister = brPayments.GetCalculatePaymentSchedule(respData, newUserName, ansNmembershi, typeChange, 1); bool isRegister = false; if (Session["codeUpgrate"] != null) { //si es upgrate isRegister = brPayments.GetCalculatePaymentScheduleUpgrate(respData, newUserName, ansNmembershi, typeChange, 1); if (!isRegister) { Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar el Cronograma de Pagos del Usuario"); return; } if (Session["dateup"] != null) { string dateup = Session["dateup"].ToString(); bool an = brPayments.PutDateUpgrate(ansNmembershi, dateup); } //registramos si upgrate para } else { //si no es upgrate isRegister = brPayments.GetCalculatePaymentSchedule(respData, newUserName, ansNmembershi, typeChange, 1); if (!isRegister) { Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar el Cronograma de Pagos del Usuario"); return; } //cronograma de activacion BrActivation brActivation = new BrActivation(); bool registerActi = brActivation.PutCronograma(cronoActiv, newUserName, ansNmembershi); } if (Session["codeUpgrate"] != null) { //el id de account n membership del upgrate ¬ y el nuevo int codeUpgrate = int.Parse(Session["codeUpgrate"].ToString()); bool upgrate = brTypeMemb.CancelMembershipUpgrate(codeUpgrate, ansNmembershi); if (!upgrate) { Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar el Cronograma de Pagos del Usuario"); return; } BrActivation brActivation = new BrActivation(); string fechaAnterior = Session["fechaanterior"].ToString(); bool registerActi = brActivation.PutCronogramaUpgrade(fechaAnterior, newUserName, ansNmembershi, codeUpgrate); } //validamos si tiene consumo if (!isRegister) { // "Ha Ocurrido Un Error al Intentar Registrar el Cronograma de Pagos del Usuario"; return; } //BrActivation brActivation = new BrActivation(); //bool registerActi = brActivation.PutCronograma(cronoActiv, newUserName, ansNmembershi); //obtengo el monto a pagar string[] username_idmen_amount_email = brUser.getAmountPay(newUserName).Split('¬'); if (username_idmen_amount_email.Length < 4) { // "false¬Ha Ocurrido Un Error al Intentar Obtener el monto a Pagar"; return; } var idMemberDetails = int.Parse(username_idmen_amount_email[1]); var amountPay = double.Parse(username_idmen_amount_email[2]); emailNewUser = username_idmen_amount_email[3]; codeCurrencyPay = username_idmen_amount_email[4]; date = null; username_idmen_amount_email = null; dataKitMember = null; respData = null; var namePeson = arrayperson[0].Trim() + " " + arrayperson[1].Trim(); var dateCurrent = DateTime.Now.ToString("yyyy-MM-dd").Split('-');; string tranferId = ""; string numReceipt = "0"; string datecomplete = dateCurrent[2] + " de " + GetMonth(dateCurrent[1]) + " del " + dateCurrent[0]; string nAffiliate = ""; string hour = DateTime.Now.ToString("HH:mm:ss"); string detalle = amountRestan.ToString(); MyMessages myMessages = new MyMessages(); namePeson = myMessages.ToCapitalize(namePeson); //cvbc var imgTicket = GetRecibo(tranferId, newUserName, numReceipt, datecomplete, nAffiliate, codeMemb, namePeson, hour, detalle, quotesPendiente, " Inicial 1"); /*=============================================================================================================================*/ //var currencyCode = Session["CurrencyCode"].ToString(); BrMembershipPayDetail brMembership = new BrMembershipPayDetail(); var response = brMembership.GetQuote(idMemberDetails, User.Identity.Name.Split('¬')[1]).Split('|'); if (decimal.Parse(response[0]) == 0) { // "Ocurrio un error."; return; } var amount = decimal.Parse(response[0]).ToString(); if (codeCurrencyPay == "USD") { amount = (decimal.Parse(amount) * decimal.Parse(typeChange)).ToString(); } var idInfo = idMemberDetails.ToString(); //dos es que wallet es una parte del pago de una cuota var typeInfo = "2"; var walleOperationId = "2"; bool IsPay = brMembership.IsPayQuote(idMemberDetails.ToString()); if (!IsPay) { // "Tu Cuota ya esta Pagada.Verifica tu cronograma de pagos."; return; } var amountWallet = decimal.Parse(brWallet.GetAmount(User.Identity.Name.Split('¬')[1])); //if (amountWallet < decimal.Parse(amount)) //{ // MessageError.Text = "No tiene el monto suficiente para realizar Pago."; // return; //} imgTicket += recibe; var moneyStatus = 0; if (amountWallet > 0) { var imgTicketWalle = GetRecibo(idMemberDetails.ToString(), newUserName, numReceipt, datecomplete, nAffiliate, codeMemb, namePeson, hour, amountWalletc.ToString(), quotesPendiente, " Inicial 1"); imgTicket += $"~{imgTicketWalle}"; //amount | @idInfo | @typeInfo | @walletOperationId | @currencyCode | @typeChange | idmembershipDetail | imgTicket string data = $"{amountWalletc}|{idInfo}|{typeInfo}|{walleOperationId}|PEN|{typeChange}|{idMemberDetails.ToString()}|{imgTicket}"; bool answer = brWallet.Put(data, User.Identity.Name.Split('¬')[1], moneyStatus); //Extorno if (!answer) { // = "Ocurrio un error."; return; } } //MessageSucces.Text = "Su Pago de Realizo Con Exito."; /*=============================================================================================================================*/ var amountOthers = amount; //esta en estado pendienete var statusPay = 1; //marcar como pagado en la tabla membershipdetails //TODO: Agregar los detalles del pago bool habiliAccount = brUser.BiPayQuote(idMemberDetails, imgTicket, amountWalletc, amountRestan, "WALLET", methods2, statusPay, decimal.Parse(typeChange)); int nAfiliate = int.Parse(brUser.GetNafiliate(idMemberDetails)); BrTypeMembership brTypeMembership = new BrTypeMembership(); var correlativo = int.Parse(brTypeMembership.GetTotalMemberships(User.Identity.Name.Split('¬')[1])); correlativo--; if (correlativo < 0) { correlativo = 0; } Cronograma2(nAfiliate, codeCurrencyPay, correlativo.ToString()); // enviar el email de confirmacion con la data y lo redirecciona al post register if (!habiliAccount) { Response.Write("false¬Ha Ocurrido un Error al Intentar Habilitar Su Cuenta.Sin embargo su Pago fue Exitoso"); return; } var urlRedirect = "EndPaymendMbs"; if (codeMemb == "EXP" || codeMemb == "LHT" || codeMemb == "STD" || codeMemb == "PLUS" || codeMemb == "TOP" || codeMemb == "VIT") { urlRedirect = "EndPaymendMbs"; } if (codeMemb == "EVOL" || codeMemb == "MVC") { urlRedirect = "EndPaymendMbs"; } if (codeMemb == "SBY") { urlRedirect = "EndPaymentSby"; } Response.Write($"true¬{urlRedirect}.aspx"); } catch (Exception ex) { Email email = new Email(); email.SendEmail(mc.ErrorEmail, "error-inresorts", ex.StackTrace + '¬' + DateTime.Now.ToLongDateString(), false); Response.Write("false¬ocurrio un error"); } }
protected void Page_Load(object sender, EventArgs e) { string[] dataLogin = null; int typeRegister = 0, numberQuotes = 0, formPay = 0, idMemberDetails = 0; string dataKit = null, dataKitMember = null, dataMemberSinKit; string token = null, userCurrent = null, newUserName = null, emailNewUser = null; double amountPay = 0; bool isRegister = false; BrUser brUser = null; BrTypeMembership brTypeMembership = null; Email oEmail = null; BrPayments brPayments = null; BrConsuption brConsuption; if (Session["typeRegister"] == null) { Session["typeRegister"] = 0; } typeRegister = int.Parse(Session["typeRegister"].ToString()); //formPay = int.Parse(Session["formPay"].ToString()); formPay = int.Parse("1"); // token = Request["token"].ToString(); numberQuotes = 1; brUser = new BrUser(); brTypeMembership = new BrTypeMembership(); dataLogin = HttpContext.Current.User.Identity.Name.Split('¬'); oEmail = new Email(); brPayments = new BrPayments(); brConsuption = new BrConsuption(); string TypeMembership = ""; userCurrent = dataLogin[0]; if (dataLogin.Length > 1) { userCurrent = dataLogin[1]; } if (formPay == 1) { string dataBdd = Session["datos"].ToString(); TypeMembership = (dataBdd.Split('$')[3]).Split('|')[7]; string data2 = (string)Session["civilState"]; string[] oIdMembreship_amount = brUser.RegisterUser(dataBdd, data2).Split('¬'); if (oIdMembreship_amount.Length < 2) { //Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar al Usuario1"); Response.Redirect("Pagos.aspx"); return; } string[] parameterPerson = dataBdd.Split('$'); string[] arraydata = parameterPerson[0].Split('|'); string[] arrayTypeaccount = parameterPerson[2].Split('|'); string[] arrayaccount = parameterPerson[3].Split('|'); string parameterAccount = arraydata[5].Trim() + "|" + arrayTypeaccount[7].Trim() + '|' + userCurrent + '|' + oIdMembreship_amount[0]; //'999999999999|1|sa|1' newUserName = brUser.GenerateAccount(parameterAccount); if (string.IsNullOrEmpty(newUserName)) { //Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar al Usuario2"); //Response.Redirect("Pagos.aspx"); return; } } if (typeRegister == 1) { // string arrayKit = Session["arrayKit"].ToString() + "¬" + newUserName; //'2018-10-19¬31¬31¬31¬userName' //isRegister = brUser.PutRegisterkIT(arrayKit); string arrayKit = Session["arrayKit"].ToString() + "¬" + newUserName; //'2018-10-19¬31¬31¬31¬userName' string data2 = Session["financedAmount"].ToString(); string codeCurrency = Session["TypeCurrency"].ToString(); Int32 ansNmembershi = brUser.RegisterNmembership(TypeMembership + '|' + newUserName, data2, 1, codeCurrency); isRegister = brUser.PutRegisterkIT(arrayKit, ansNmembershi); //monto a pagar string[] username_idmen_amount_email = brUser.getAmountPay(newUserName).Split('¬'); /*UPDATE*/ bool resp = brPayments.InitialExoneration(newUserName); // bool notAvilable = brUser.NotAvailableUser(newUserName); Response.Redirect("EndPayments.aspx"); } if (typeRegister == 2) { dataKitMember = Session["cronograma"].ToString(); string date = dataKitMember.Split('$')[1]; string respData = brPayments.PersonGetData(newUserName); respData = respData + '^' + dataKitMember; // isRegister = brPayments.GetCalculatePaymentSchedule(respData, newUserName); string data2 = Session["financedAmount"].ToString(); string codeCurrency = Session["TypeCurrency"].ToString(); Int32 ansNmembershi = brUser.RegisterNmembership(TypeMembership + '|' + newUserName, data2, 1, codeCurrency); var exchange = Session["exchange"]; if (string.IsNullOrEmpty(exchange.ToString())) { exchange = "0.00"; } isRegister = brPayments.GetCalculatePaymentSchedule(respData, newUserName, ansNmembershi, exchange.ToString(), 1); //validamos si tiene consumo if (!isRegister) { // Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar el Cronograma de Pagos del Usuario"); //Response.Redirect("Pagos.aspx"); return; } //obtengo el monto a pagar string[] username_idmen_amount_email = brUser.getAmountPay(newUserName).Split('¬'); if (username_idmen_amount_email.Length < 4) { //Response.Write("false¬Ha Ocurrido Un Error al Intentar Obtener el monto a Pagar"); //Response.Redirect("Pagos.aspx"); return; } idMemberDetails = int.Parse(username_idmen_amount_email[1]); amountPay = double.Parse(username_idmen_amount_email[2]); emailNewUser = username_idmen_amount_email[3]; date = null; username_idmen_amount_email = null; dataKitMember = null; respData = null; /*UPDATE*/ bool resp = brPayments.InitialExoneration(newUserName); // bool notAvilable = brUser.NotAvailableUser(newUserName); Response.Redirect("EndPayments.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { string def = "profile.png"; string extension = ".png"; string name = ""; string nombreu = ""; int AccountNews = 0; try { if (!IsPostBack) { var arraLogin = HttpContext.Current.User.Identity.Name.Split('¬'); var refer = arraLogin[arraLogin.Length - 1]; if (refer == "referido") { Response.Redirect("SignOutC.aspx"); } BrUser brUser = new BrUser(); MyConstants myConstants = new MyConstants(); var Arraytexto = brUser.GetNews(); if (Arraytexto != "") { var rows = Arraytexto.Split('¬'); for (var i = 0; i < rows.Length; i++) { var row = rows[i].Split('|'); var ids = row[1]; } } int ServerNews = brUser.GetNewsCount(); if (arraLogin.Length > 1) { AccountNews = brUser.GetCountAccountNews(arraLogin[2]); if (AccountNews == 0 && ServerNews > 0) { var Read = 0; var IdAccount = arraLogin[2]; var NotifCount = ServerNews; var regNewsCount = Read + "|" + IdAccount + "|" + NotifCount; brUser.RegNewsCount(regNewsCount); quantity2.Text = ServerNews.ToString(); //globo2.Style.Add("display", "block"); } else { if (ServerNews > AccountNews) { var newCurrent = ServerNews - AccountNews; AccountNews = AccountNews + newCurrent; quantity2.Text = AccountNews.ToString(); //globo2.Style.Add("display", "block"); var update = arraLogin[2] + "¬" + AccountNews; brUser.UpdateAccountNewsCount(update); } else { quantity2.Text = AccountNews.ToString(); //globo2.Style.Add("display", "block"); } } } //ejecutamos la validation del estado BrInformacion brInformacion = new BrInformacion(); bool activeUp = brInformacion.ActiveUp(); if (arraLogin[0] == "ERROR" || string.IsNullOrEmpty(arraLogin[0])) { Session.Contents.RemoveAll(); FormsAuthentication.SignOut(); HttpContext.Current.Response.Redirect("Index.aspx", true); } string range = ""; string userName = ""; string depthLevels = ""; string nameRange = ""; string userNameBann = arraLogin[0]; //Label1.Text = DateTime.Now.ToString("G"); if (string.IsNullOrEmpty(arraLogin[0])) { Response.Redirect("Login.aspx", true); } if (arraLogin.Length == 1) { Response.Redirect("Register.aspx", true); } Session.Clear(); Session["tienda"] = "0"; Session["StatusExonerar"] = 0; Session["link"] = ""; userName = arraLogin[1]; //BrAccount brAccount = new BrAccount(); //bool IsupdateRange = brAccount.UpdateRange(userName); DateTime now = DateTime.Now; var startDate = new DateTime(now.Year, now.Month, 1); var test = startDate; var Today = DateTime.Now.ToString("dd/MM/yyyy"); var Quince = startDate.AddDays(+14); var Quincetest = Quince.ToString("dd/MM/yyyy"); var Dieci = startDate.AddDays(+15).ToShortDateString(); var endDate = startDate.AddMonths(1).AddDays(-1).ToString("dd/MM/yyyy"); string[] arrayLines = brInformacion.GetPointsLines(userName).Split('¬'); double[] linesInt = new double[arrayLines.Length]; List <double> mnNivel = new List <double>(); int[] countInt = new int[arrayLines.Length]; for (int i = 0; i < arrayLines.Length; i++) { var row = arrayLines[i].Split('|'); linesInt[i] = double.Parse(row[0] + row[1]); mnNivel.Add(double.Parse(row[0])); countInt[i] = int.Parse(row[1]); } //Array.Sort(linesInt); //Array.Reverse(linesInt); string formartNumber = "###,###,###,##0.00"; double total1 = 0, total2 = 0, total3 = 0, total4 = 0; int rama1 = 1, rama2 = 2, rama3 = 3, rama4 = 4; int indice = 0; if (arrayLines.Length >= 1) { //lblRankVolume.Text = arrayIndex[0]; FirtsLine.Text = linesInt[0].ToString(formartNumber); total1 = linesInt[0]; indice = int.Parse(total1.ToString().Substring(total1.ToString().Length - 1, 1)); rama1 = indice; //FirtsLineChildren.Text = countInt[indice].ToString(); } if (arrayLines.Length >= 2) { SecondLine.Text = linesInt[1].ToString(formartNumber); total2 = linesInt[1]; indice = int.Parse(total2.ToString().Substring(total2.ToString().Length - 1, 1)); rama2 = indice; //SecondLineChildren.Text = countInt[indice].ToString(); } if (arrayLines.Length >= 3) { ThirdLine.Text = linesInt[2].ToString(formartNumber); total3 = linesInt[2]; indice = int.Parse(total3.ToString().Substring(total3.ToString().Length - 1, 1)); rama3 = indice; //ThirdLineChildren.Text = countInt[indice].ToString(); } if (arrayLines.Length >= 4) { total4 = linesInt[3]; indice = int.Parse(total4.ToString().Substring(total4.ToString().Length - 1, 1)); rama4 = indice; //FourthLineChildren.Text = countInt[indice].ToString(); } double VoluRango = total1 + total2 + total3 + total4; lblRankVolume.Text = VoluRango.ToString(formartNumber); RamaTo1.Text = rama1.ToString(); RamaTo2.Text = rama2.ToString(); RamaTo3.Text = rama3.ToString(); //proximo rango //var nextRangea = brInformacion.GetNextRange(userName).Split('|'); //NextRange.Text = nextRangea[0]; //NextRangePoints.Text = nextRangea[1]; //la ultima version publicada el dia 26-12-2018 var statusLeter = string.Empty; string dataValues = brUser.GetAccountStatus(userName); if (dataValues.Split('|').Length > 1) { StatusAcount.Text = dataValues.Split('|')[0]; statusLeter = dataValues.Split('|')[0]; if (dataValues.Split('|')[1] != "--") { NextDate.Text = DateTime.Parse(dataValues.Split('|')[1]).ToString(myConstants.DateFormatUser); } else { NextDate.Text = dataValues.Split('|')[1]; } string pointQuotePay = brUser.GetPointsQuotePay(userName); Points.Text = pointQuotePay; //lblRankVolume.Text = dataValues.Split('|')[2]; if (!string.IsNullOrEmpty(dataValues.Split('|')[3])) { ActivoHasta.Text = DateTime.Parse(dataValues.Split('|')[3]).ToString(myConstants.DateFormatUser); } else { ActivoHasta.Text = dataValues.Split('|')[3]; } } string[] arrayrange = brUser.GetRange(userName).Split('|'); range = "SOC"; depthLevels = "0"; if (arrayrange.Length > 1) { range = arrayrange[0]; namerange.Text = arrayrange[2].ToString(); lblUserban.Text = userNameBann; depthLevels = arrayrange[1]; lblDepthLevels.Text = depthLevels; var lastDateRange = DateTime.Parse(arrayrange[3]).AddDays(5); if (lastDateRange < DateTime.Now) { modalCara.Style.Add("display", "none"); } if (statusLeter == "Stand bye" || statusLeter == "Promotor") { modalCara.Style.Add("display", "none"); } } if (now > Quince) //para saber si funciona ... solo cambiar > por < { lblCicloFacIni.Text = Convert.ToDateTime(Dieci).ToString("dd/MM/yyyy"); lblCicloFacTo.Text = endDate; lblCicloCalIni.Text = Convert.ToDateTime(Dieci).ToString("dd/MM/yyyy"); lblCicloCalTo.Text = endDate; } else { lblCicloFacIni.Text = Convert.ToDateTime(test).ToString("dd/MM/yyyy"); lblCicloFacTo.Text = Quincetest; lblCicloCalIni.Text = Convert.ToDateTime(test).ToString("dd/MM/yyyy"); lblCicloCalTo.Text = Quincetest; } //puntaje de rango y puntaje del proximo rango var rangess = brInformacion.GetCurrentAndNextRange(range).Split('$'); var ranges = rangess[0].Split('¬'); var firtran = ranges[0].Split('|'); var seconran = ranges[1].Split('|'); double firtsLinePd = double.Parse(firtran[0]) * double.Parse(rangess[1]); double secondLinePd = double.Parse(firtran[1]) * double.Parse(rangess[1]); double thirdLinePd = double.Parse(firtran[2]) * double.Parse(rangess[1]); double fourthLinePd = double.Parse(firtran[3]) * double.Parse(rangess[1]); double totalRangeCurren = firtsLinePd + secondLinePd + thirdLinePd; TotalRangeCurrent.Text = totalRangeCurren.ToString(formartNumber); if (firtsLinePd != 0) { TituloRActual.Text = "Rango Actual"; } else { DivRange1.CssClass = "display-none"; DivRange2.CssClass = "display-none"; DivRange3.CssClass = "display-none"; } FirtsLineP.Text = firtsLinePd.ToString(formartNumber); SecondLineP.Text = secondLinePd.ToString(formartNumber); ThirdLineP.Text = thirdLinePd.ToString(formartNumber); double firtsLineP2d = double.Parse(seconran[0]) * double.Parse(rangess[1]); double secondLineP2d = double.Parse(seconran[1]) * double.Parse(rangess[1]); double thirdLineP2d = double.Parse(seconran[2]) * double.Parse(rangess[1]); double fourthLineP2d = double.Parse(seconran[3]) * double.Parse(rangess[1]); double sumProxRang = firtsLineP2d + secondLineP2d + thirdLineP2d; FirtsLineP2Icon.CssClass = "range-bag"; SecondLineP2Icon.CssClass = "range-bag"; ThirdLineP2Icon.CssClass = "range-bag"; var maxminiun = brInformacion.GetMaximiumMinium(range).Split('|'); var maxi = Math.Round(double.Parse(maxminiun[0])); var mini = Math.Round(double.Parse(maxminiun[1])); var pointmm = double.Parse(maxminiun[2]); maxi = maxi * pointmm; mini = mini * pointmm; ValueIdeal.Text = firtsLineP2d.ToString("0.00"); ValueIdeal2.Text = secondLineP2d.ToString("0.00"); ValueIdeal3.Text = thirdLineP2d.ToString("0.00"); if (total1 < mini) { firtsLineP2d = total1; } if (total2 < mini) { secondLineP2d = total2; } if (total3 < mini) { thirdLineP2d = total3; } if (total1 > mini) { FirtsLineP2Icon.CssClass = "range-ambar"; firtsLineP2d = mini; } if (total2 > mini) { SecondLineP2Icon.CssClass = "range-ambar"; secondLineP2d = mini; } if (total3 > mini) { ThirdLineP2Icon.CssClass = "range-ambar"; thirdLineP2d = mini; } if (total1 >= maxi) { FirtsLineP2Icon.CssClass = "range-good"; firtsLineP2d = maxi; } if (total2 >= maxi) { SecondLineP2Icon.CssClass = "range-good"; secondLineP2d = maxi; } if (total3 >= maxi) { ThirdLineP2Icon.CssClass = "range-good"; thirdLineP2d = maxi; } if (total4 > fourthLineP2d) { } FirtsLineP2.Text = firtsLineP2d.ToString(formartNumber); SecondLineP2.Text = secondLineP2d.ToString(formartNumber); ThirdLineP2.Text = thirdLineP2d.ToString(formartNumber); SumProxRange.Text = sumProxRang.ToString(formartNumber); double rpuntaj1 = 0, rpuntaj2 = 0, rpuntaj3 = 0, rpuntaj4 = 0, rpuntajto = 0; rpuntaj1 = total1; rpuntaj2 = total2; rpuntaj3 = total3; rpuntaj4 = total4; if (firtsLineP2d < total1) { rpuntaj1 = firtsLineP2d; } if (secondLineP2d < total2) { rpuntaj2 = secondLineP2d; } if (thirdLineP2d < total3) { rpuntaj3 = thirdLineP2d; } if (fourthLineP2d < total4) { rpuntaj4 = fourthLineP2d; } rpuntajto = rpuntaj1 + rpuntaj2 + rpuntaj3 + rpuntaj4; Rpuntaje1.Text = rpuntaj1.ToString(formartNumber); Rpuntaje2.Text = rpuntaj2.ToString(formartNumber); Rpuntaje3.Text = rpuntaj3.ToString(formartNumber); Rpuntajtotal.Text = rpuntajto.ToString(formartNumber); double ptsFalta = sumProxRang - rpuntajto; double persFalta = ptsFalta / double.Parse(rangess[1]); PtsFaltan.Text = ptsFalta.ToString(formartNumber); PersFaltan.Text = persFalta.ToString("0"); //hasta ahora 4 //nombree completo ¬ usuario ¬ id person¬ status payments //login con usuario y contraseña Session["Referido"] = arraLogin[1]; lblUser.Text = "Hola " + arraLogin[0]; lblUserName.Text = arraLogin[0]; lblNumPartner.Text = "N° Asociado: " + arraLogin[4]; imgProfile.ImageUrl = "~/Resources/Images/profile.png"; imgProfileFl.ImageUrl = "~/Resources/Images/profile.png"; string nsocios = brUser.GetCountsAsociate(); lblnsocios.Text = nsocios; string lineActive = brUser.GetLineActives(userName); lblActivas.Text = lineActive.ToString(); //int idMember = int.Parse(brUser.GetMembershipType(arraLogin[1])); ////int idMember = 1; //brUser = null; //int isadmin = int.Parse(arraLogin[2]); //if (isadmin == 1) //{ // brUser.NotifRegPendients(); //} string[] arrayLinesResid = brInformacion.GetPointsLinesResid(userName).Split('¬'); double[] linesIntResid = new double[arrayLinesResid.Length]; var rangeResidualCurrent = brInformacion.GetRangeResidualCurrent(userName); var resPointres = brInformacion.GetPointsRange(rangeResidualCurrent).Split('|'); var resPointres1 = decimal.Parse(resPointres[0]); var resPointres2 = decimal.Parse(resPointres[1]); var resPointres3 = decimal.Parse(resPointres[2]); var resPointresTotal = resPointres1 + resPointres2 + resPointres3; TotalResidualc.Text = resPointresTotal.ToString(); Residualpa1.Text = resPointres1.ToString(); Residualpa2.Text = resPointres2.ToString(); Residualpa3.Text = resPointres3.ToString(); //proximo rango ideal var resPointresprox = brInformacion.GetPointsRangeProximo(rangeResidualCurrent).Split('|'); var resPointres1prox = decimal.Parse(resPointresprox[0]); var resPointres2prox = decimal.Parse(resPointresprox[1]); var resPointres3prox = decimal.Parse(resPointresprox[2]); var resPointresTotalprox = resPointres1prox + resPointres2prox + resPointres3prox; TotalResidualActual.Text = resPointresTotalprox.ToString(); ResidualIdeal1.Text = resPointres1prox.ToString(); ResidualIdeal2.Text = resPointres2prox.ToString(); ResidualIdeal3.Text = resPointres3prox.ToString(); var maxminiunResid = brInformacion.GetMaximiumMinium(rangeResidualCurrent).Split('|'); var maxir = Math.Round(double.Parse(maxminiunResid[0])); var minir = Math.Round(double.Parse(maxminiunResid[1])); var pointmmr = double.Parse(maxminiunResid[2]); maxir = maxir * pointmm; minir = minir * pointmm; var firtsRes = arrayLinesResid[0].Split('|')[0]; var secondRes = "0"; var thereRes = "0"; var fourthRes = "0"; if (arrayLinesResid.Length > 1) { secondRes = arrayLinesResid[1].Split('|')[0]; if (arrayLinesResid.Length > 2) { thereRes = arrayLinesResid[2].Split('|')[0]; if (arrayLinesResid.Length > 3) { fourthRes = arrayLinesResid[3].Split('|')[0]; } } } var residTotal = decimal.Parse(firtsRes) + decimal.Parse(secondRes) + decimal.Parse(thereRes) + decimal.Parse(fourthRes); TitleResidualPts.Text = residTotal.ToString("0.00"); ResidRama1.Text = firtsRes; ResidRama2.Text = secondRes; ResidRama3.Text = thereRes; FirtsLineR2Icon.CssClass = "range-bag"; SecondLineR2Icon.CssClass = "range-bag"; ThirdLineR2Icon.CssClass = "range-bag"; if (double.Parse(firtsRes) >= minir) { FirtsLineR2Icon.CssClass = "range-ambar"; firtsLineP2d = minir; } if (double.Parse(secondRes) >= minir) { SecondLineR2Icon.CssClass = "range-ambar"; secondLineP2d = minir; } if (double.Parse(thereRes) >= minir) { ThirdLineR2Icon.CssClass = "range-ambar"; thirdLineP2d = mini; } if (double.Parse(firtsRes) >= maxir) { FirtsLineR2Icon.CssClass = "range-good"; firtsRes = maxir.ToString(); } if (double.Parse(secondRes) >= maxir) { SecondLineR2Icon.CssClass = "range-good"; secondRes = maxir.ToString(); } if (double.Parse(thereRes) >= maxir) { ThirdLineR2Icon.CssClass = "range-good"; thereRes = maxir.ToString(); } FirtsLineR2.Text = decimal.Parse(firtsRes).ToString(formartNumber); SecondLineR2.Text = decimal.Parse(secondRes).ToString(formartNumber); ThirdLineR2.Text = decimal.Parse(thereRes).ToString(formartNumber); //ACTUALZIACION DE FECHA PARA MOSTRAR BANNER BrTypeMembership brTypeMembership = new BrTypeMembership(); MyConstants mc = new MyConstants(); //DateTime ya = DateTime.Now; //var startDate2 = new DateTime(ya.Year, ya.Month, 1); //var veamos = ya.AddHours(+24); var userbanner = arraLogin[2]; var FechaActualizacion = brTypeMembership.GetUpdateBanner(userbanner); //var conhoras =brTypeMembership.UpdateNextDay(userbanner);falta sp if (FechaActualizacion == "0") { FechaActualizacion = "2000-12-10"; } var vchoras = DateTime.Now.ToString(mc.DateFormatBd); /*DateTime.Parse("2019-05-23")*/ if (DateTime.Parse(vchoras) == DateTime.Parse(FechaActualizacion)) { //banni.Style.Add("display", "block"); modalCara.Style.Add("display", "block"); } // Imagen de PErfil var rutaImgP = HttpContext.Current.Server.MapPath("~/Resources/imguser"); DirectoryInfo di1 = new DirectoryInfo(rutaImgP); nombreu = arraLogin[1]; foreach (var fi2 in di1.GetFiles()) { var archivo = fi2.Name.Split('.'); name = archivo[archivo.Length - 2]; extension = archivo[archivo.Length - 1]; if (name == nombreu) { def = nombreu + "." + extension; } } if (def != "") { imgProfile.ImageUrl = "~/Resources/imguser/" + def; imgProfile.Style.Add("width", "40px"); imgProfile.Style.Add("height", "40px"); imgProfile.Style.Add("margin", "0 auto"); imgProfileFl.ImageUrl = "~/Resources/imguser/" + def; imgProfileFl.Style.Add("width", "80px"); imgProfileFl.Style.Add("height", "80px"); imgProfileFl.Style.Add("margin", "180 0 auto 154px"); } //range = "ORO"; var rutaBanner = HttpContext.Current.Server.MapPath("~/Views/ImgHistoryRange/" + userName + range + ".png"); if (!File.Exists(rutaBanner)) { var infoPerson = brUser.GetPersonalInformation(User.Identity.Name.Split('¬')[1]).Split('|'); MyFunctions mf = new MyFunctions(); if (range != "SOC") { CreateImageFromString(mf.ToCapitalize(infoPerson[1]), mf.ToCapitalize(infoPerson[2]), def, range, userName); } else { CreateImageFromStringSoc(mf.ToCapitalize(infoPerson[1]), mf.ToCapitalize(infoPerson[2]), def, range, userName); } } if (range == "DIM") { BannerHistoryRange.ImageUrl = "~/Resources/ImgHistoryRange/" + userName + "DIM.png"; PtoAzul2.Style.Add("background-color", "#0f8cfb"); namerange.Text = arrayrange[2].ToString(); lblUserban.Text = userNameBann; } if (range == "TDI") { BannerHistoryRange.ImageUrl = "~/Resources/ImgHistoryRange/" + userName + "TDI.png"; PtoAzul11.Style.Add("background-color", "#0f8cfb"); namerange.Text = arrayrange[2].ToString(); } if (range == "DDI") { BannerHistoryRange.ImageUrl = "~/Resources/ImgHistoryRange/" + userName + "DDI.png"; PtoAzul10.Style.Add("background-color", "#0f8cfb"); namerange.Text = arrayrange[2].ToString(); } if (range == "DAZ") { BannerHistoryRange.ImageUrl = "~/Resources/ImgHistoryRange/" + userName + "DAZ.png"; PtoAzul9.Style.Add("background-color", "#0f8cfb"); namerange.Text = arrayrange[2].ToString(); } if (range == "DNE") { BannerHistoryRange.ImageUrl = "~/Resources/ImgHistoryRange/" + userName + "DNE.png"; PtoAzul8.Style.Add("background-color", "#0f8cfb"); namerange.Text = arrayrange[2].ToString(); } if (range == "DIA") { BannerHistoryRange.ImageUrl = "~/Resources/ImgHistoryRange/" + userName + "DIA.png"; PtoAzul7.Style.Add("background-color", "#0f8cfb"); namerange.Text = arrayrange[2].ToString(); } if (range == "ESM") { BannerHistoryRange.ImageUrl = "~/Resources/ImgHistoryRange/" + userName + "ESM.png"; PtoAzul6.Style.Add("background-color", "#0f8cfb"); namerange.Text = arrayrange[2].ToString(); } if (range == "RUB") { BannerHistoryRange.ImageUrl = "~/Resources/ImgHistoryRange/" + userName + "RUB.png"; PtoAzul5.Style.Add("background-color", "#0f8cfb"); namerange.Text = arrayrange[2].ToString(); } if (range == "ZAF") { BannerHistoryRange.ImageUrl = "~/Resources/ImgHistoryRange/" + userName + "ZAF.png"; PtoAzul4.Style.Add("background-color", "#0f8cfb"); namerange.Text = arrayrange[2].ToString(); } if (range == "ORO") { BannerHistoryRange.ImageUrl = "~/Resources/ImgHistoryRange/" + userName + "ORO.png"; PtoAzul3.Style.Add("background-color", "#0f8cfb"); namerange.Text = arrayrange[2].ToString(); } if (range == "PLT") { BannerHistoryRange.ImageUrl = "~/Resources/ImgHistoryRange/" + userName + "PLT.png"; PtoAzul2.Style.Add("background-color", "#0f8cfb"); namerange.Text = arrayrange[2].ToString(); } if (range == "SOC") { BannerHistoryRange.ImageUrl = "~/Resources/ImgHistoryRange/" + userName + "SOC.png"; PtoAzul1.Style.Add("background-color", "#0f8cfb"); namerange.Text = arrayrange[2].ToString(); } // SendEmailAmountRestante("170.84", "113.91", "284.75", "3345", "Cuota nro: 1"); } } catch (Exception ex) { } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { string quotesPendiente = ""; string namePeson = ""; string token = "", emailNewUser = "", userName = "", codeMembers = ""; int numberQuotes = 0, idMemberDetails = 0; double amountPay = 0; string currencyCode = string.Empty; BrUser brUser = new BrUser(); BrPayments brPayments = new BrPayments(); BrTypeMembership brTypeMemb = new BrTypeMembership(); string[] dataLogin = HttpContext.Current.User.Identity.Name.Split('¬'); userName = dataLogin[1]; token = Request["tokenid"].ToString(); numberQuotes = int.Parse(Request["ddlQuote"].ToString()); currencyCode = Request["ddlcurrencyCode"].ToString(); if (numberQuotes < 0 || numberQuotes > 32) { Response.Write("false¬" + "Numero de Cuotas No Valido"); return; } codeMembers = Session["carrito"].ToString().Split('|')[6]; string dataBdd = Session["datos"].ToString(); string[] arraycontacto = dataBdd.Split('$')[3].Split('|'); string[] arrayperson = dataBdd.Split('$')[0].Split('|'); //correo = arraycontacto[0]; namePeson = arrayperson[0] + " " + arrayperson[1]; string[] acarrito = Session["carrito"].ToString().Split('|'); string TypeMembership = acarrito[6]; string cronograma = Session["cronograma"].ToString(); //string respData = brPayments.PersonGetData(userName); string respData = ""; respData = respData + '^' + cronograma; double amountFinanciade = 0; string cronogramaYa = Session["cronogramaYa"].ToString(); string[] array1 = Session["cronogramaYa"].ToString().Split('^'); string[] datosMem = array1[0].Split('|'); string[] array2 = array1[1].Split('~'); string[] cuotas = array2[0].Split('¬'); string cronoActiv = ""; for (int i = 0; i < cuotas.Length - 1; i++) { var fila = cuotas[i].Split('|'); if (fila[0].Substring(0, 7) != "Inicial") { cronoActiv += DateTime.Parse(fila[1]).ToString("yyyy-MM-dd"); amountFinanciade = double.Parse(fila[2].Replace("S/.", "")); break; } else { cronoActiv += DateTime.Parse(fila[1]).ToString("yyyy-MM-dd") + "¬"; } } string codeCurrency = Session["TypeCurrency"].ToString(); int ansNmembershi = brUser.RegisterNmembership(TypeMembership + '|' + userName, amountFinanciade.ToString(), Int32.Parse(Session["membPred"].ToString()), codeCurrency); bool isRegister = false; string exchange = Session["carrito"].ToString().Split('|')[4]; var typeChange = double.Parse(exchange); if (Session["codeUpgrate"] != null) { //si es upgrate isRegister = brPayments.GetCalculatePaymentScheduleUpgrate(respData, userName, ansNmembershi, exchange, 1); if (!isRegister) { Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar el Cronograma de Pagos del Usuario"); return; } if (Session["dateup"] != null) { string dateup = Session["dateup"].ToString(); bool an = brPayments.PutDateUpgrate(ansNmembershi, dateup); } //registramos si upgrate para } else { //si no es upgrate isRegister = brPayments.GetCalculatePaymentSchedule(respData, userName, ansNmembershi, exchange, 1); if (!isRegister) { Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar el Cronograma de Pagos del Usuario"); return; } //cronograma de activacion BrActivation brActivation = new BrActivation(); bool registerActi = brActivation.PutCronograma(cronoActiv, userName, ansNmembershi); } if (Session["codeUpgrate"] != null) { //el id de account n membership del upgrate ¬ y el nuevo int codeUpgrate = int.Parse(Session["codeUpgrate"].ToString()); bool upgrate = brTypeMemb.CancelMembershipUpgrate(codeUpgrate, ansNmembershi); if (!upgrate) { Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar el Cronograma de Pagos del Usuario"); return; } BrActivation brActivation = new BrActivation(); string fechaAnterior = Session["fechaanterior"].ToString(); bool registerActi = brActivation.PutCronogramaUpgrade(fechaAnterior, userName, ansNmembershi, codeUpgrate); } //validamos si tiene consumo if (!isRegister) { Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar el Cronograma de Pagos del Usuario"); return; } string[] username_idmen_amount_email = brUser.GetAmountPay(ansNmembershi).Split('|'); if (username_idmen_amount_email.Length < 4) { Response.Write("false¬Ha Ocurrido Un Error al Intentar Obtener el monto a Pagar"); return; } idMemberDetails = int.Parse(username_idmen_amount_email[1]); amountPay = double.Parse(username_idmen_amount_email[2]); emailNewUser = username_idmen_amount_email[3]; username_idmen_amount_email = null; brPayments = null; brUser = null; if (idMemberDetails <= 0 || amountPay <= 0) { Response.Write("false¬Ha Ocurrido Un Error al Intentar Registrar al Usuario"); return; } if (currencyCode == "USD") { amountPay = amountPay / typeChange; } PayCulqi payCulqi = new PayCulqi(); string[] culqiAnwser = payCulqi.newPayment(userName, emailNewUser, amountPay, token, numberQuotes, currencyCode).Split('¬'); if (culqiAnwser[0] == "false") { Response.Write("false¬" + culqiAnwser[1]); return; } //marcar como pagado en la tabla membershipdetails BrMembershipPayDetail brMembershipPayDetail = new BrMembershipPayDetail(); if (Session["codeUpgrate"] != null) { bool habiliAccount = brMembershipPayDetail.UpgrateStatusPaymentInitial(ansNmembershi, 1, ""); //enviar el email de confirmacion con la data y lo redirecciona al post register if (!habiliAccount) { Response.Write("false¬Ha Ocurrido un Error al Intentar Habilitar Su Cuenta."); return; } } else { var dateCurrent = DateTime.Now.ToString("yyyy-MM-dd").Split('-');; string tranferId = culqiAnwser[2] == null ? "" : culqiAnwser[2]; string numReceipt = "0"; string date = dateCurrent[2] + " de " + GetMonth(dateCurrent[1]) + " del " + dateCurrent[0]; string nAffiliate = ""; string hour = DateTime.Now.ToString("HH:mm:ss"); string detalle = amountPay.ToString(); //cvbc string nameTicket = GetRecibo(tranferId, userName, numReceipt, date, nAffiliate, TypeMembership, namePeson, hour, detalle, quotesPendiente); bool habiliAccount = brMembershipPayDetail.UpgrateStatusPaymentInitial(ansNmembershi, 0, nameTicket); //enviar el email de confirmacion con la data y lo redirecciona al post register if (!habiliAccount) { Response.Write("false¬Ha Ocurrido un Error al Intentar Habilitar Su Cuenta."); return; } } Email oEmail = new Email(); bool awnserEmail = oEmail.SubmitEmail(emailNewUser, "[RIBERA DEL RIO - PAGO]", "Ud. Ha efectuado su pago en Ribera del Rio con Exito."); if (!awnserEmail) { Response.Write("false¬" + culqiAnwser[1] + "\n" + "Ocurrio un Error al intentar enviar un Email de conformidad con su compra"); return; } //ejecutamos el core para los puntos de equipo //BrCore_Automation brCore_Automation = new BrCore_Automation(); // bool isCoreRegister = brCore_Automation.ExecuteCore(); var urlRedire = string.Empty; var codeMemb = TypeMembership.Trim(); if (codeMemb == "EXP" || codeMemb == "LHT" || codeMemb == "STD" || codeMemb == "PLUS" || codeMemb == "TOP" || codeMemb == "VIT") { urlRedire = "EndPayments"; } if (codeMemb == "EVOL" || codeMemb == "MVC") { urlRedire = "EndPaymentQuote"; } if (codeMemb == "SBY") { urlRedire = "EndPaymentSby"; } Response.Write($"true¬{urlRedire}.aspx"); return; } } catch (Exception ex) { Response.Redirect("error.aspx?error=" + ex.Message, true); } }
protected void Page_Load(object sender, EventArgs e) { bool anwser = false; string ruta = string.Empty; BrPayments brPayment = new BrPayments(); // var _aux = Request["action"]; int _action = int.Parse(Request["action"].ToString()); if (_action == 0) { var _var = (Session["params"].ToString()); string data = brPayment.getPayDetailByPerson(_var); Response.Write(data); return; } int _id = int.Parse(Request["id"]); string quote = Request["quote"]; string parameter = _action.ToString() + "|" + _id.ToString(); BrInformacion brInformacion = new BrInformacion(); string[] arrayData = brInformacion.GetBYIdMembershipDetail(_id).Split('|'); string userName = arrayData[0]; string emailUser = arrayData[1]; string name = arrayData[2]; string lastname = arrayData[3]; string gender = arrayData[4]; string codeMemb = arrayData[5].Trim(); auxidafi = int.Parse(arrayData[6]); auxnameafi = arrayData[7]; auxmembership = arrayData[8]; if (_action == 1) { BrMembershipPayDetail brMembershipPayDetail = new BrMembershipPayDetail(); anwser = brMembershipPayDetail.EnableByInitial(parameter, quote); if (!anwser) { Response.Write("false¬Ha Ocurrido un Error en cambiar el estado"); return; } //TODO: aqui se hace la actualizacion del rango anwser = brMembershipPayDetail.UpdateRange(userName); var isInitial = brMembershipPayDetail.GetDescriptionQuote(_id).Substring(0, 5); if (isInitial != "Cuota") { ruta = HttpContext.Current.Server.MapPath("~/Resources/PoliticsPdf/"); int correlativo = 0; BrTypeMembership brTypeMembership = new BrTypeMembership(); correlativo = int.Parse(brTypeMembership.GetTotalMemberships(userName)); correlativo--; if (correlativo < 0) { correlativo = 0; } userName = userName + correlativo.ToString(); if (codeMemb == "KIT") { anwser = this.SendEmailKit(name, gender, userName, ruta, emailUser); } if (codeMemb == "EXP" || codeMemb == "LHT" || codeMemb == "STD" || codeMemb == "PLUS" || codeMemb == "TOP" || codeMemb == "VIT") { anwser = this.SendEmailClub(name, gender, userName, ruta, emailUser); } if (codeMemb == "EVOL" || codeMemb == "MVC") { anwser = this.SendEmailVacational(name, gender, userName, ruta, emailUser); } if (codeMemb == "SBY") { anwser = this.SendEmailFounder(name, gender, userName, ruta, emailUser); } if (!anwser) { Response.Write("false¬Ocurrio un error al envio de email."); return; } } Response.Write("true¬La Operacion se ha efectuado con exito"); return; } //RECHAZAR if (_action == 3) { string messagge = "", subjet = ""; BrMembershipPayDetail brMembershipPayDetail = new BrMembershipPayDetail(); anwser = brMembershipPayDetail.EnableByInitial(parameter, "0"); if (!anwser) { Response.Write("false¬Ha Ocurrido un Error en cambiar el estado"); return; } messagge = "Su Recibo Fue rechazado.Por Favor subir un recibo valido."; subjet = "[RIBERA DEL RIO - RECIBO RECHAZADO]"; Email oemail = new Email(); oemail.SendEmail(emailUser, subjet, messagge, false); } Response.Write("true¬La Operacion se ha efectuado con exito"); return; }