private void dgvClientes_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (update == 0)
     {
         id                  = int.Parse(this.dgvClientes.CurrentRow.Cells[0].Value.ToString());
         txtNombre.Text      = this.dgvClientes.CurrentRow.Cells[1].Value.ToString();
         txtApePaterno.Text  = this.dgvClientes.CurrentRow.Cells[2].Value.ToString();
         txtApeMaterno.Text  = this.dgvClientes.CurrentRow.Cells[3].Value.ToString();
         txtEmail.Text       = this.dgvClientes.CurrentRow.Cells[4].Value.ToString();
         txtTelefono.Text    = this.dgvClientes.CurrentRow.Cells[5].Value.ToString();
         txtCalle.Text       = this.dgvClientes.CurrentRow.Cells[6].Value.ToString();
         txtNomExt.Text      = this.dgvClientes.CurrentRow.Cells[7].Value.ToString();
         txtNomInt.Text      = this.dgvClientes.CurrentRow.Cells[8].Value.ToString();
         txtColonia.Text     = this.dgvClientes.CurrentRow.Cells[9].Value.ToString();
         txtCiudad.Text      = this.dgvClientes.CurrentRow.Cells[10].Value.ToString();
         txtComentarios.Text = this.dgvClientes.CurrentRow.Cells[12].Value.ToString();
     }
     else
     {
         venta.idCliente = int.Parse(this.dgvClientes.CurrentRow.Cells[0].Value.ToString());
         string nombrec = this.dgvClientes.CurrentRow.Cells[1].Value.ToString() + " " + this.dgvClientes.CurrentRow.Cells[2].Value.ToString() + " " + this.dgvClientes.CurrentRow.Cells[3].Value.ToString();
         venta  frm     = Owner as venta;
         frm.txtClientes.Text = nombrec;
         this.Hide();
     }
 }
Exemple #2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            HttpClient client = new HttpClient();

            client.BaseAddress = new Uri("http://www.facturadp.com/kenduAPI/api/");
            client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            // List all Names.
            HttpResponseMessage response = client.GetAsync($"usuario/?Usuario={txtUser.Text}&Password={txtUser.Text}&Conexion=2").Result;  // Blocking call!

            if (response.IsSuccessStatusCode)
            {
                var products = response.Content.ReadAsStringAsync().Result;
                //clientes = response.Content.ReadAsAsync<List<publicId>>().Result;
                var res = response.Content.ReadAsAsync <List <dynamic> >().Result;
                if (products.Length == 2)
                {
                    MessageBox.Show("El Usuario o contraseña son incorrectos");
                }
                else
                {
                    // var outs = products.TrimStart('[').TrimEnd(']').Split(',');

                    publicId.IdUsuario = res[0].IdUsuario;
                    //int a = outs[1].Length;
                    publicId.nombre = res[0].Nombre;
                    venta frm = new venta();
                    frm.Show();
                    this.Hide();
                }

                //if(products.ToString().Length = 2) { }

                /*
                 *
                 */
            }
            else
            {
                Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
            }
            Console.ReadLine();

            /*
             * venta frm = new venta();
             * frm.Show();
             * this.Hide();*/
        }
 private void gunaPictureBox1_Click(object sender, EventArgs e)
 {
     venta vd = new venta();
     vd.getIdCategoria(id);
     
 }
 private void Categorias_Click(object sender, EventArgs e)
 {
     venta frm = new venta();
     //frm.getIdCategoria(id);
 }