Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string      answer    = "ocurrio un error";
            BrAccount   brAccount = new BrAccount();
            MyFunctions mf        = new MyFunctions();

            var respdata = brAccount.GetUserNotConfirmedPayInitial().Split('¬');


            if (respdata.Length > 1)
            {
                answer  = "<table class='table table-hover'>";
                answer += "<tr>";
                answer += "<th>#</th>";
                answer += "<th>Fecha</th>";
                answer += "<th>Fecha Pago</th>";
                answer += "<th>UserName</th>";
                answer += "<th>Nombre del nuevo Socio</th>";
                answer += "<th>Telefono</th>";
                answer += "<th>Tipo de Membresia</th>";
                answer += "<th>Inicial</th>";
                answer += "<th>Patrocinador</th>";
                answer += "<th>Telefono Patrocinador</th>";
                answer += "</tr>";

                for (int i = 0; i < respdata.Length; i++)
                {
                    var row = respdata[i].Split('|');
                    answer += "<tr>";
                    answer += $"<td>{(i + 1).ToString()}</td>";
                    answer += $"<td>{mf.DateFormatClient(row[0])}</td>";
                    answer += $"<td>{mf.DateFormatClient(row[1])}</td>";
                    answer += $"<td>{row[2]}</td>";
                    answer += $"<td>{row[3]}</td>";
                    answer += $"<td>{row[4]}</td>";
                    answer += $"<td>{row[5]}</td>";
                    answer += $"<td>S/.{row[6]}</td>";
                    answer += $"<td>{row[7]}</td>";
                    answer += $"<td>{row[8]}</td>";
                    answer += "</tr>";
                }
                answer += "</table>";
            }
            else
            {
                answer = "No Hay Datos";
            }

            Response.Write(answer);
        }
Exemplo n.º 2
0
        private void UpdateBrAccPoss(GatewayId p_gatewayId)
        {
            List <BrAccSum>?accSums = BrokersWatcher.gWatcher.GetAccountSums(p_gatewayId);

            if (accSums == null)
            {
                return;
            }

            List <BrAccPos>?accPoss = BrokersWatcher.gWatcher.GetAccountPoss(p_gatewayId);

            if (accPoss == null)
            {
                return;
            }

            MemDb.gMemDb.UpdateBrAccPosAssetIds(accPoss);

            BrAccount?brAccount = null;

            foreach (var account in MemDb.gMemDb.BrAccounts)
            {
                if (account.GatewayId == p_gatewayId)
                {
                    brAccount = account;
                    break;
                }
            }
            if (brAccount == null)
            {
                brAccount = new BrAccount()
                {
                    GatewayId = p_gatewayId
                };
                MemDb.gMemDb.BrAccounts.Add(brAccount);
            }

            brAccount.NetLiquidation     = accSums.GetValue(AccountSummaryTags.NetLiquidation);
            brAccount.GrossPositionValue = accSums.GetValue(AccountSummaryTags.GrossPositionValue);
            brAccount.TotalCashValue     = accSums.GetValue(AccountSummaryTags.TotalCashValue);
            brAccount.InitMarginReq      = accSums.GetValue(AccountSummaryTags.InitMarginReq);
            brAccount.MaintMarginReq     = accSums.GetValue(AccountSummaryTags.MaintMarginReq);
            brAccount.AccPoss            = accPoss;
            brAccount.LastUpdate         = DateTime.UtcNow;
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string action = Request["action"];
            string answer = "ha ocurrido un error";

            if (action == "get")
            {
                BrPlacement brPlacement = new BrPlacement();
                MyFunctions mf          = new MyFunctions();
                string      cboUpli     = string.Empty;
                var         upliners    = brPlacement.GetUpliners(User.Identity.Name.Split('¬')[1]).Split('¬');

                cboUpli  = "<select>";
                cboUpli += $"<option value='0'>--Seleccionar--</option>";

                for (int i = 0; i < upliners.Length; i++)
                {
                    var row = upliners[i].Split('|');
                    if (row.Length > 1)
                    {
                        cboUpli += $"<option value='{row[0]}'>{row[1]}</option>";
                    }
                }
                cboUpli += "/<select>";

                string data = brPlacement.GetSponsored(User.Identity.Name.Split('¬')[1]);

                var arrayData = data.Split('¬');
                answer  = "<table class='table table-hover'>";
                answer += "<thead>";
                answer += "<tr>";
                answer += "<th></th>";
                answer += "<th>Nombres</th>";
                answer += "<th>Fecha</th>";
                answer += "<th>Tipo de Membresia</th>";
                answer += "<th>Estado</th>";
                answer += "<th>Upliner</th>";
                answer += "<th></th>";
                answer += "</tr>";
                answer += "<tbody>";

                for (int i = 0; i < arrayData.Length; i++)
                {
                    var row = arrayData[i].Split('|');
                    if (row.Length > 2)
                    {
                        var item = (i + 1).ToString();
                        var id   = $"{item}_{row[2]}";
                        answer += "<tr>";
                        answer += $"<td>{item}</td>";
                        answer += $"<td>{row[1]}</td>";
                        answer += $"<td>{mf.DateFormatClient(row[3])}</td>";
                        answer += $"<td>{row[5]}</td>";

                        if (row[4] == "0")
                        {
                            row[6] = "Pendiente";
                        }
                        answer += $"<td>{row[6]}</td>";

                        answer += $"<td id='{id}'>{cboUpli}</td>";
                        if (row[4] == "1" || row[4] == "2")
                        {
                            answer += $"<td><input type='button' onclick=ShowModalAsignar('{id}','{row[1].Replace(' ', '_')}') name='name' value='Posicionar' class='btn btn-primary' style='box-shadow: 1px 2px 0px black;background: white; color: #000000; border: 1px solid #000000;'></td>";
                        }
                        else
                        {
                            answer += $"<td></td>";
                        }
                        answer += "</tr>";
                    }
                    else
                    {
                        answer += "<tr>";
                        answer += $"<td>No hay Datos</td>";
                        answer += "</tr>";
                    }
                }
                answer += "</tbody>";
                answer += "</table>";
            }

            if (action == "posi")
            {
                var userNamechildren = Request["children"];
                var fatherId         = int.Parse(Request["father"]);

                BrAccount brAccount = new BrAccount();

                var existFather   = brAccount.Exist(fatherId);
                var existChildren = brAccount.Exist(userNamechildren);

                if (existFather && existChildren)
                {
                    //validar si tiene ya sus tres
                    //verdadero por que pasa el limite
                    var brUser      = new BrUser();
                    var isCompleted = brUser.IsTeamCompleted(fatherId);

                    if (isCompleted)
                    {
                        answer = "El usuario ya tiene su equipo completo.";
                    }
                    else
                    {
                        //validar si al affliate ya no se le pueden establecer mas hijos
                        var help = brUser.IsHelpTeam(fatherId);

                        var idCurrent = int.Parse(User.Identity.Name.Split('¬')[2]);

                        if (idCurrent == 1)
                        {
                            help = false;
                        }

                        if (help)
                        {
                            answer = "El usuario ya no puede recibir mas ayuda.";
                        }
                        else
                        {
                            var       data      = $"{userNamechildren}|{fatherId}";
                            BrPartner brPartner = new BrPartner();
                            var       IsAssign  = brPartner.Assign(data);

                            if (IsAssign)
                            {
                                answer = "La operacion se realizo con exito.";
                            }
                        }
                    }
                }
            }
            Response.Write(answer);
        }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BrUser brUser    = new BrUser();
                string returnUrl = Request["ReturnUrl"];

                if (!string.IsNullOrEmpty(returnUrl))
                {
                    this.ReturnUrl = returnUrl;
                }

                if (!string.IsNullOrEmpty(returnUrl))
                {
                    if (returnUrl == "/Views/Referred.aspx")
                    {
                        FormsAuthentication.RedirectFromLoginPage("", false);
                        Response.Redirect("Referred.aspx");
                    }
                }


                Session.Contents.RemoveAll();
                FormsAuthentication.SignOut();
                Session.Clear();
                Session["StatusExonerar"] = 0;
                Session["link"]           = "";
                string afiliate = Request["afiliate"];
                string upliner  = Request["upliner"];

                if (string.IsNullOrEmpty(upliner))
                {
                    upliner = "0";
                }

                if (!string.IsNullOrEmpty(afiliate) && !string.IsNullOrEmpty(upliner))
                {
                    string data = afiliate + "|" + upliner;

                    int idUpliner = brUser.ExistAccountLink(data);
                    if (idUpliner >= 0)
                    {
                        Session["Referido"] = afiliate;
                        Session["auxRef"]   = "1";
                        Session["link"]     = data + "|" + idUpliner;
                        FormsAuthentication.RedirectFromLoginPage(afiliate, chkPersistCookie.Checked);
                        Response.Redirect("Register.aspx");
                    }
                }


                //contador
                BrFundation brFundation = new BrFundation();
                int         contador    = int.Parse(brFundation.GetCount());

                foundingPartners.Text = contador.ToString();
                //foundingPartners2.Text = contador.ToString();



                BrAccount brAccount = new BrAccount();

                bool isRealize = brAccount.DeleteAccountUnconfirmed();
                if (isRealize)
                {
                    Email email = new Email();
                }
            }
        }
Exemplo n.º 5
0
        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.";
        }