Пример #1
0
        private void Ultimo()
        {
            AmazonFakeService.I_Base_DatosClient cliente = new AmazonFakeService.I_Base_DatosClient();
            cliente.UltimoCodigo();

            //VentasCN cnper = new VentasCN();
            //List<Ventas> per = cliente.UltimoCodigo();

            foreach (var ma in cliente.UltimoCodigo())
            {
                int codigo = 0;
                codigo = Convert.ToInt32(ma.Codigo);
                codigo = codigo + 1;
                if (codigo < 10)
                {
                    ma.Codigo = "000" + codigo.ToString();
                }
                if (codigo < 100 && codigo > 9)
                {
                    ma.Codigo = "00" + codigo.ToString();
                }
                if (codigo < 1000 && codigo > 99)
                {
                    ma.Codigo = "0" + codigo.ToString();
                }
                txtCodigo.Text = ma.Codigo;
            }
        }
 protected void btn_Cambiar_contrasena_Click(object sender, EventArgs e)
 {
     if ((txt_Old_Password.Text != string.Empty) && (txt_New_Password.Text != string.Empty) &&
         (txt_email.Text != string.Empty))
     {
         if (Cls_Secure.ValidarChangePasswod(txt_New_Password.Text))
         {
             AmazonFakeService.I_Base_DatosClient cliente = new AmazonFakeService.I_Base_DatosClient();
             List <string> lista  = new List <string>();
             string        passwd = "";
             foreach (var item in cliente.Password_Restore(txt_email.Text.Trim()))
             {
                 passwd = item.SPassword;
             }
             if (passwd.Equals(txt_Old_Password.Text.Trim()))
             {
                 lbl_Respuesta.Text = cliente.Change_Password(txt_email.Text.Trim(), txt_New_Password.Text.Trim());
                 Cls_Secure.Correo_Cambio_Contrasena(txt_email.Text.Trim(), txt_New_Password.Text.Trim());
             }
             else
             {
                 lbl_Respuesta.Text    = "La contraseña actual no coincide con los registros. Verifiquela!";
                 txt_Old_Password.Text = string.Empty;
                 txt_New_Password.Text = string.Empty;
                 txt_Old_Password.Focus();
             }
         }
     }
     else
     {
         lbl_Respuesta.Text = "Debe llenar todos los campos";
     }
 }
Пример #3
0
        public static void Correo_Cambio_Contrasena(string Correo, string pssword)
        {
            AmazonFakeService.I_Base_DatosClient Cliente = new AmazonFakeService.I_Base_DatosClient();
            string Correo_Target  = Correo;
            string Correo_Source  = "*****@*****.**";
            string Correo_Head    = "AmazonFake - Cambio de Contraseña";
            string Correo_Message = "<p>Estimado sus datos han sido actualizados: <br>Ahora sus datos son: <br>Usuario: " + Correo + "<br>Nueva Contraseña: " + pssword + "</p>";

            Cliente.Envio_Correo_Cliente(Correo_Target, Correo_Source, Correo_Head, Correo_Message);
        }
Пример #4
0
        public static void Correo_Creacion_Cuenta(string correo, string nombre, string pssword)
        {
            AmazonFakeService.I_Base_DatosClient Cliente = new AmazonFakeService.I_Base_DatosClient();
            string Correo_Target  = correo;
            string Correo_Source  = "*****@*****.**";
            string Correo_Head    = "AmazonFake - Creacion de Cuenta";
            string Correo_Message = "<p>Estimado " + nombre + " sus datos de acceso a su cuenta de AmazonFake son: <br>Usuario: " + correo + "<br>Contraseña: " + pssword + "</p>";

            Cliente.Envio_Correo_Cliente(Correo_Target, Correo_Source, Correo_Head, Correo_Message);
        }
Пример #5
0
        public static void Correo_Recuperacion(string Correo)
        {
            AmazonFakeService.I_Base_DatosClient Cliente = new AmazonFakeService.I_Base_DatosClient();
            List <string> listaLogin = new List <string>();
            string        passwd;

            foreach (var item in Cliente.Password_Restore(Correo))
            {
                passwd = item.SPassword;
                string Correo_Target  = Correo;
                string Correo_Source  = "*****@*****.**";
                string Correo_Head    = "AmazonFake - Recuperacion de Contraseña";
                string Correo_Message = "<p>Estimado sus datos son: <br>Usuario: " + Correo + "<br>Contraseña: " + passwd + "</p>";
                Cliente.Envio_Correo_Cliente(Correo_Target, Correo_Source, Correo_Head, Correo_Message);
            }
        }
Пример #6
0
        private void Administracion_Accesos()
        {
            AmazonFakeService.I_Base_DatosClient cliente = new AmazonFakeService.I_Base_DatosClient();
            List <string> listaLogin = new List <string>();
            string        usuario = txt_email.Text;
            string        passwd = txt_contrasena.Text;
            string        correo = "", nombre = "", pass;
            bool          estado = false;
            int           Perfil = 3;

            foreach (var item in cliente.Login(usuario, passwd))
            {
                correo = item.SCorreo;
                nombre = item.SNombre;
                pass   = item.SPassword;
                estado = item.BEstado;
                Perfil = item.IPerfil;
            }
            if (estado == true && Perfil == 2)
            {
                Session["UsuarioSession"] = nombre;
                Session["UsuarioPerfil"]  = Perfil.ToString();
                Session["Usuariocorreo"]  = correo.ToString();
                Response.Redirect("~/Index.aspx");
            }
            else if (estado == true && Perfil == 1)
            {
                Session["UsuarioSession"] = nombre;
                Session["UsuarioPerfil"]  = Perfil.ToString();
                Session["Usuariocorreo"]  = correo.ToString();
                Response.Redirect("~/Index.aspx");
            }
            else if (estado == true && Perfil == 0)
            {
                Session["UsuarioSession"] = usuario;
                Session["UsuarioPerfil"]  = Perfil.ToString();
                Session["Usuariocorreo"]  = correo.ToString();
                Response.Redirect("~/Index.aspx");
            }
            else
            {
                lbl_Errores.Text    = "Error de Usuario o Contraseña";
                txt_email.Text      = string.Empty;
                txt_contrasena.Text = string.Empty;
                txt_email.Focus();
            }
        }
Пример #7
0
        protected void Button3_Click(object sender, EventArgs e)
        {
            AmazonFakeService.I_Base_DatosClient cliente = new AmazonFakeService.I_Base_DatosClient();
            cliente.Insertar_Venta(txtCodigo.Text, lblFecha.Text, lblSubTotal.Text, lblIGV.Text,
                                   lblTotal.Text, txtCliente.Text);

            /*ComponenteNegocio.VentasCN oMatriculaCN = new ComponenteNegocio.VentasCN();
             * ComponenteEntidad.Ventas oMatriculaCE = new ComponenteEntidad.Ventas();
             * oMatriculaCE.Codigo = txtCodigo.Text;
             * oMatriculaCE.Fecha = lblFecha.Text;
             * oMatriculaCE.Subtotal = decimal.Parse(lblSubTotal.Text);
             * oMatriculaCE.Igv = decimal.Parse(lblIGV.Text);
             * oMatriculaCE.Total = decimal.Parse(lblTotal.Text);
             * oMatriculaCE.Cliente = txtCliente.Text;
             * oMatriculaCN.Insertar(oMatriculaCE);*/

            foreach (GridViewRow row in GridView1.Rows)
            {
                int     cantidad    = int.Parse(((TextBox)row.Cells[4].FindControl("TextBox1")).Text);
                decimal Precio      = decimal.Parse(Convert.ToString(row.Cells[3].Text));
                decimal Subtotal    = decimal.Parse(Convert.ToString(row.Cells[5].Text));
                string  Codproducto = Convert.ToString(row.Cells[1].Text);
                cliente.Insertar_Detalle_Venta(txtCodigo.Text, cantidad.ToString(), Precio.ToString(),
                                               Subtotal.ToString(), Codproducto);

                //ComponenteNegocio.DetalleVentaCN oMatriculaCNN = new ComponenteNegocio.DetalleVentaCN();
                //ComponenteEntidad.DetalleVenta oMatriculaCEE = new ComponenteEntidad.DetalleVenta();
                //oMatriculaCEE.Codigo = txtCodigo.Text;
                //oMatriculaCEE.Cantidad = int.Parse(((TextBox)row.Cells[4].FindControl("TextBox1")).Text);
                //oMatriculaCEE.Precio = decimal.Parse(Convert.ToString(row.Cells[3].Text));
                //oMatriculaCEE.Subtotal = decimal.Parse(Convert.ToString(row.Cells[5].Text));
                //oMatriculaCEE.Codproducto = Convert.ToString(row.Cells[1].Text);
                //oMatriculaCNN.Insertar(oMatriculaCEE);
            }
            SendEmail(sender, e);
            this.Response.Write("<script language='JavaScript'>window.alert('PROCESO TERMINADO CORRECTAMENTE')</script>");
            Response.Redirect("Carrito_Compra.aspx");
        }
Пример #8
0
 protected void btn_Createaccount_Click(object sender, EventArgs e)
 {
     if ((txt_nombre.Text != string.Empty) && (txt_email.Text != string.Empty) &&
         (txt_contrasena.Text != string.Empty))
     {
         if (txt_contrasena.Text.Trim().Equals(txt_contrasena2.Text.Trim()))
         {
             if (Cls_Secure.Validar(txt_nombre.Text, txt_email.Text.Trim(), txt_contrasena.Text.Trim()))
             {
                 AmazonFakeService.I_Base_DatosClient cliente = new AmazonFakeService.I_Base_DatosClient();
                 lbl_Errores.Text = cliente.Create_Account(txt_email.Text, txt_nombre.Text, txt_contrasena.Text);
                 Cls_Secure.Correo_Creacion_Cuenta(txt_email.Text, txt_nombre.Text, txt_contrasena.Text);
             }
         }
         else
         {
             lbl_Errores.Text = "Los campos de Password y Re-enter password deben ser iguales!";
         }
     }
     else
     {
         lbl_Errores.Text = "Todos los campos son obligatorios";
     }
 }