Example #1
0
        private void btnRegistro_Click(object sender, EventArgs e)
        {
            int exito;

            if (verificarTextBox())
            {
                using (WCFSnickers.Service1Client conexion = new WCFSnickers.Service1Client())
                {
                    WCFSnickers.Cliente client = new WCFSnickers.Cliente()
                    {
                        Id_cliente    = txtNombre.Text.Length,
                        Nombre        = txtNombre.Text,
                        Apellidos     = txtApellidos.Text,
                        Correo        = txtCorreo.Text,
                        Telefono      = txtTel.Text,
                        Codigo_postal = txtCp.Text,
                        Estado        = txtEstado.Text,
                        Ciudad        = txtCiudad.Text,
                        Colonia       = txtColonia.Text,
                        Calle         = txtCalle.Text,
                        Contrasena    = txtContrasena.Text
                    };
                    exito = conexion.SetCliente(client);
                    if (exito == 0)
                    {
                        MessageBox.Show("ALGO SALIO MAL , VUELVA A INTENTARLO");
                    }
                }
                this.Close();
            }
        }
Example #2
0
 private void Compra_Load(object sender, EventArgs e)
 {
     this.TopMost = true;
     using (WCFSnickers.Service1Client conexion = new WCFSnickers.Service1Client())
     {
         dataGridView1.DataSource = conexion.GetBusquedaClave(modelo);
         foreach (DataGridViewRow row in dataGridView1.Rows)
         {
             lblImporte.Text     = ("" + row.Cells["precio"].Value.ToString());
             lblImporte1.Text    = ("$ " + row.Cells["precio"].Value.ToString());
             lblDescripcion.Text = (row.Cells["nombre"].Value.ToString()) + (" " + row.Cells["marca"].Value.ToString());
         }
         dataGridView1.DataSource = conexion.GetClientes(correo);
         foreach (DataGridViewRow row in dataGridView1.Rows)
         {
             lblCliente.Text   = ("" + row.Cells["nombre"].Value.ToString() + " " + row.Cells["apellidos"].Value.ToString());
             lblDireccion.Text = row.Cells["calle"].Value.ToString() + " " + row.Cells["colonia"].Value.ToString() + " " + row.Cells["ciudad"].Value.ToString() + " " + row.Cells["estado"].Value.ToString();
             lblCP.Text        = "CP: " + row.Cells["codigo_postal"].Value.ToString();
         }
         DateTime fecha = DateTime.Now;
         lblFecha.Text = fecha.ToString();
     }
 }
Example #3
0
        private void btnAccess_Click(object sender, EventArgs e)
        {
            int inicioSesion = 0;

            if (verificarCampos())
            {
                using (WCFSnickers.Service1Client conexion = new WCFSnickers.Service1Client())
                {
                    inicioSesion = conexion.VerificarLogin(txtUsuario.Text, txtContraseña.Text);
                    if (inicioSesion > 0)
                    {
                        claveCliente = txtUsuario.Text;
                        Metodo_pago pago = new Metodo_pago(claveCliente, claveTenis);
                        pago.Show();
                        this.Hide();
                    }
                    else
                    {
                        lblError.Visible = true;
                    }
                }
            }
        }
Example #4
0
        public void dibujarCatalogo()
        {
            using (WCFSnickers.Service1Client conexion = new WCFSnickers.Service1Client())
            {
                int figuras = 1;
                int x = 80, xTxt = 80, xBtn = 80;
                int y = 10, yTxt = 150, yBtn = 210;

                //string tamaño = this.Size.ToString();
                dataGridView1.DataSource = conexion.GetBusquedaMarcaModelo(descripcion);
                foreach (DataGridViewRow row in dataGridView1.Rows)
                {
                    //CREAMOS NUEVA IMAGEN CADA QUE ENCUENTRE UN PRODUCTO
                    var imgPictureBox = new PictureBox();
                    imgPictureBox.Location = new System.Drawing.Point(x, y);
                    imgPictureBox.Size     = new System.Drawing.Size(220, 130);
                    imgPictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
                    //imgPictureBox.Anchor = AnchorStyles.None;
                    imgPictureBox.Image = Image.FromFile(row.Cells["id_producto"].Value.ToString() + ".jpg");
                    Controls.Add(imgPictureBox);
                    imgPictureBox.Visible = true;
                    //CREAMOS LA DESCRIPCION DE DICHO PRODUCTO
                    TextBox txtDescripcion = new TextBox();
                    txtDescripcion.Location    = new System.Drawing.Point(xTxt, yTxt);
                    txtDescripcion.Size        = new System.Drawing.Size(220, 50);
                    txtDescripcion.Multiline   = true;
                    txtDescripcion.BorderStyle = BorderStyle.None;
                    txtDescripcion.ReadOnly    = true;
                    txtDescripcion.TextAlign   = HorizontalAlignment.Center;
                    txtDescripcion.BackColor   = Color.White;
                    //txtDescripcion.Anchor = AnchorStyles.None;
                    Controls.Add(txtDescripcion);
                    txtDescripcion.Text    = (row.Cells["nombre"].Value.ToString() + Environment.NewLine);
                    txtDescripcion.Text   += (row.Cells["marca"].Value.ToString() + Environment.NewLine);
                    txtDescripcion.Text   += ("$ " + row.Cells["precio"].Value.ToString() + Environment.NewLine);
                    txtDescripcion.Visible = true;
                    //CREAMOS EL BOTON PARA CADA PRODUCTO
                    Button btnComprar = new Button();
                    btnComprar.Location = new System.Drawing.Point(xBtn, yBtn);
                    btnComprar.Size     = new System.Drawing.Size(220, 25);
                    btnComprar.Text     = "COMPRAR";
                    btnComprar.Cursor   = Cursors.Hand;
                    // btnComprar.Anchor = AnchorStyles.None;
                    Controls.Add(btnComprar);
                    if (figuras <= 3)
                    {
                        xTxt += 240;
                        x    += 240;
                        xBtn += 240;
                    }
                    else
                    {
                        x       = 80;
                        xTxt    = 80;
                        xBtn    = 80;
                        y      += 250;
                        yTxt   += 250;
                        yBtn   += 250;
                        figuras = 0;
                    }
                    figuras++;
                }
            }
        }